1
// Package datastore provides access to the Google Cloud Datastore API.
3
// See https://developers.google.com/datastore/
7
// import "google.golang.org/api/datastore/v1beta1"
9
// datastoreService, err := datastore.New(oauthHttpClient)
17
"google.golang.org/api/googleapi"
25
// Always reference these packages, just in case the auto-generated code
27
var _ = bytes.NewBuffer
30
var _ = json.NewDecoder
33
var _ = googleapi.Version
35
var _ = strings.Replace
37
const apiId = "datastore:v1beta1"
38
const apiName = "datastore"
39
const apiVersion = "v1beta1"
40
const basePath = "https://www.googleapis.com/datastore/v1beta1/datasets/"
42
// OAuth2 scopes used by this API.
44
// View and manage your data across Google Cloud Platform services
45
CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
47
// View and manage your Google Cloud Datastore data
48
DatastoreScope = "https://www.googleapis.com/auth/datastore"
50
// View your email address
51
UserinfoEmailScope = "https://www.googleapis.com/auth/userinfo.email"
54
func New(client *http.Client) (*Service, error) {
56
return nil, errors.New("client is nil")
58
s := &Service{client: client, BasePath: basePath}
59
s.Datasets = NewDatasetsService(s)
65
BasePath string // API endpoint base URL
67
Datasets *DatasetsService
70
func NewDatasetsService(s *Service) *DatasetsService {
71
rs := &DatasetsService{s: s}
75
type DatasetsService struct {
79
type AllocateIdsRequest struct {
80
// Keys: A list of keys with incomplete key paths to allocate IDs for.
81
// No key may be reserved/read-only.
82
Keys []*Key `json:"keys,omitempty"`
85
type AllocateIdsResponse struct {
86
Header *ResponseHeader `json:"header,omitempty"`
88
// Keys: The keys specified in the request (in the same order), each
89
// with its key path completed with a newly allocated ID.
90
Keys []*Key `json:"keys,omitempty"`
93
type BeginTransactionRequest struct {
94
// IsolationLevel: The transaction isolation level. Either snapshot or
95
// serializable. The default isolation level is snapshot isolation,
96
// which means that another transaction may not concurrently modify the
97
// data that is modified by this transaction. Optionally, a transaction
98
// can request to be made serializable which means that another
99
// transaction cannot concurrently modify the data that is read or
100
// modified by this transaction.
101
IsolationLevel string `json:"isolationLevel,omitempty"`
104
type BeginTransactionResponse struct {
105
Header *ResponseHeader `json:"header,omitempty"`
107
// Transaction: The transaction identifier (always present).
108
Transaction string `json:"transaction,omitempty"`
111
type BlindWriteRequest struct {
112
// Mutation: The mutation to perform.
113
Mutation *Mutation `json:"mutation,omitempty"`
116
type BlindWriteResponse struct {
117
Header *ResponseHeader `json:"header,omitempty"`
119
// MutationResult: The result of performing the mutation (always
121
MutationResult *MutationResult `json:"mutationResult,omitempty"`
124
type CommitRequest struct {
125
IgnoreReadOnly bool `json:"ignoreReadOnly,omitempty"`
127
// Mutation: The mutation to perform. Optional.
128
Mutation *Mutation `json:"mutation,omitempty"`
130
// Transaction: The transaction identifier, returned by a call to
131
// beginTransaction. Must be set when mode is TRANSACTIONAL.
132
Transaction string `json:"transaction,omitempty"`
135
type CommitResponse struct {
136
Header *ResponseHeader `json:"header,omitempty"`
138
// MutationResult: The result of performing the mutation (if any).
139
MutationResult *MutationResult `json:"mutationResult,omitempty"`
142
type CompositeFilter struct {
143
// Filters: The list of filters to combine. Must contain at least one
145
Filters []*Filter `json:"filters,omitempty"`
147
// Operator: The operator for combining multiple filters. Only "and" is
148
// currently supported.
149
Operator string `json:"operator,omitempty"`
153
// Key: The entity's key.
155
// An entity must have a key, unless otherwise
156
// documented (for example, an entity in Value.entityValue may have no
157
// key). An entity's kind is its key's path's last element's kind, or
158
// null if it has no key.
159
Key *Key `json:"key,omitempty"`
161
// Properties: The entity's properties.
162
Properties map[string]Property `json:"properties,omitempty"`
165
type EntityResult struct {
166
// Entity: The resulting entity.
167
Entity *Entity `json:"entity,omitempty"`
171
// CompositeFilter: A composite filter.
172
CompositeFilter *CompositeFilter `json:"compositeFilter,omitempty"`
174
// PropertyFilter: A filter on a property.
175
PropertyFilter *PropertyFilter `json:"propertyFilter,omitempty"`
178
type GqlQuery struct {
179
// AllowLiteral: When false, the query string must not contain a
181
AllowLiteral bool `json:"allowLiteral,omitempty"`
183
// NameArgs: A named argument must set field GqlQueryArg.name. No two
184
// named arguments may have the same name. For each non-reserved named
185
// binding site in the query string, there must be a named argument with
186
// that name, but not necessarily the inverse.
187
NameArgs []*GqlQueryArg `json:"nameArgs,omitempty"`
189
// NumberArgs: Numbered binding site @1 references the first numbered
190
// argument, effectively using 1-based indexing, rather than the usual
191
// 0. A numbered argument must NOT set field GqlQueryArg.name. For each
192
// binding site numbered i in query_string, there must be an ith
193
// numbered argument. The inverse must also be true.
194
NumberArgs []*GqlQueryArg `json:"numberArgs,omitempty"`
196
// QueryString: The query string.
197
QueryString string `json:"queryString,omitempty"`
200
type GqlQueryArg struct {
201
Cursor string `json:"cursor,omitempty"`
203
// Name: Must match regex "[A-Za-z_$][A-Za-z_$0-9]*". Must not match
204
// regex "__.*__". Must not be "".
205
Name string `json:"name,omitempty"`
207
Value *Value `json:"value,omitempty"`
211
// PartitionId: Entities are partitioned into subsets, currently
212
// identified by a dataset (usually implicitly specified by the project)
213
// and namespace ID. Queries are scoped to a single partition.
214
PartitionId *PartitionId `json:"partitionId,omitempty"`
216
// Path: The entity path. An entity path consists of one or more
217
// elements composed of a kind and a string or numerical identifier,
218
// which identify entities. The first element identifies a root entity,
219
// the second element identifies a child of the root entity, the third
220
// element a child of the second entity, and so forth. The entities
221
// identified by all prefixes of the path are called the element's
222
// ancestors. An entity path is always fully complete: ALL of the
223
// entity's ancestors are required to be in the path along with the
224
// entity identifier itself. The only exception is that in some
225
// documented cases, the identifier in the last path element (for the
226
// entity) itself may be omitted. A path can never be empty. The path
227
// can have at most 100 elements.
228
Path []*KeyPathElement `json:"path,omitempty"`
231
type KeyPathElement struct {
232
// Id: The ID of the entity. Never equal to zero. Values less than zero
233
// are discouraged and will not be supported in the future.
234
Id int64 `json:"id,omitempty,string"`
236
// Kind: The kind of the entity. A kind matching regex "__.*__" is
237
// reserved/read-only. A kind must not contain more than 500 characters.
239
Kind string `json:"kind,omitempty"`
241
// Name: The name of the entity. A name matching regex "__.*__" is
242
// reserved/read-only. A name must not be more than 500 characters.
244
Name string `json:"name,omitempty"`
247
type KindExpression struct {
248
// Name: The name of the kind.
249
Name string `json:"name,omitempty"`
252
type LookupRequest struct {
253
// Keys: Keys of entities to look up from the datastore.
254
Keys []*Key `json:"keys,omitempty"`
256
// ReadOptions: Options for this lookup request. Optional.
257
ReadOptions *ReadOptions `json:"readOptions,omitempty"`
260
type LookupResponse struct {
261
// Deferred: A list of keys that were not looked up due to resource
263
Deferred []*Key `json:"deferred,omitempty"`
265
// Found: Entities found.
266
Found []*EntityResult `json:"found,omitempty"`
268
Header *ResponseHeader `json:"header,omitempty"`
270
// Missing: Entities not found, with only the key populated.
271
Missing []*EntityResult `json:"missing,omitempty"`
274
type Mutation struct {
275
// Delete: Keys of entities to delete. Each key must have a complete key
276
// path and must not be reserved/read-only.
277
Delete []*Key `json:"delete,omitempty"`
279
// Force: Ignore a user specified read-only period. Optional.
280
Force bool `json:"force,omitempty"`
282
// Insert: Entities to insert. Each inserted entity's key must have a
283
// complete path and must not be reserved/read-only.
284
Insert []*Entity `json:"insert,omitempty"`
286
// InsertAutoId: Insert entities with a newly allocated ID. Each
287
// inserted entity's key must omit the final identifier in its path and
288
// must not be reserved/read-only.
289
InsertAutoId []*Entity `json:"insertAutoId,omitempty"`
291
// Update: Entities to update. Each updated entity's key must have a
292
// complete path and must not be reserved/read-only.
293
Update []*Entity `json:"update,omitempty"`
295
// Upsert: Entities to upsert. Each upserted entity's key must have a
296
// complete path and must not be reserved/read-only.
297
Upsert []*Entity `json:"upsert,omitempty"`
300
type MutationResult struct {
301
// IndexUpdates: Number of index writes.
302
IndexUpdates int64 `json:"indexUpdates,omitempty"`
304
// InsertAutoIdKeys: Keys for insertAutoId entities. One per entity from
305
// the request, in the same order.
306
InsertAutoIdKeys []*Key `json:"insertAutoIdKeys,omitempty"`
309
type PartitionId struct {
310
// DatasetId: The dataset ID.
311
DatasetId string `json:"datasetId,omitempty"`
313
// Namespace: The namespace.
314
Namespace string `json:"namespace,omitempty"`
317
type Property struct {
318
// Multi: If this property contains a list of values. Input values may
319
// explicitly set multi to false, but otherwise false is always
320
// represented by omitting multi.
321
Multi bool `json:"multi,omitempty"`
323
// Values: The value(s) of the property. When multi is false there is
324
// always exactly one value. When multi is true there are always one or
325
// more values. Each value can have only one value property populated.
326
// For example, you cannot have a values list of { values: [ {
327
// integerValue: 22, stringValue: "a" } ] }, but you can have { multi:
328
// true, values: [ { integerValue: 22 }, { stringValue: "a" } ] }.
329
Values []*Value `json:"values,omitempty"`
332
type PropertyExpression struct {
333
// AggregationFunction: The aggregation function to apply to the
334
// property. Optional. Can only be used when grouping by at least one
335
// property. Must then be set on all properties in the projection that
336
// are not being grouped by. Aggregation functions: first selects the
337
// first result as determined by the query's order.
338
AggregationFunction string `json:"aggregationFunction,omitempty"`
340
// Property: The property to project.
341
Property *PropertyReference `json:"property,omitempty"`
344
type PropertyFilter struct {
345
// Operator: The operator to filter by. One of lessThan,
346
// lessThanOrEqual, greaterThan, greaterThanOrEqual, equal, or
348
Operator string `json:"operator,omitempty"`
350
// Property: The property to filter by.
351
Property *PropertyReference `json:"property,omitempty"`
353
// Value: The value to compare the property to.
354
Value *Value `json:"value,omitempty"`
357
type PropertyOrder struct {
358
// Direction: The direction to order by. One of ascending or descending.
359
// Optional, defaults to ascending.
360
Direction string `json:"direction,omitempty"`
362
// Property: The property to order by.
363
Property *PropertyReference `json:"property,omitempty"`
366
type PropertyReference struct {
367
// Name: The name of the property.
368
Name string `json:"name,omitempty"`
372
// EndCursor: An ending point for the query results. Optional. Query
373
// cursors are returned in query result batches.
374
EndCursor string `json:"endCursor,omitempty"`
376
// Filter: The filter to apply (optional).
377
Filter *Filter `json:"filter,omitempty"`
379
// GroupBy: The properties to group by (if empty, no grouping is applied
380
// to the result set).
381
GroupBy []*PropertyReference `json:"groupBy,omitempty"`
383
// Kinds: The kinds to query (if empty, returns entities from all
385
Kinds []*KindExpression `json:"kinds,omitempty"`
387
// Limit: The maximum number of results to return. Applies after all
388
// other constraints. Optional.
389
Limit int64 `json:"limit,omitempty"`
391
// Offset: The number of results to skip. Applies before limit, but
392
// after all other constraints (optional, defaults to 0).
393
Offset int64 `json:"offset,omitempty"`
395
// Order: The order to apply to the query results (if empty, order is
397
Order []*PropertyOrder `json:"order,omitempty"`
399
// Projection: The projection to return. If not set the entire entity is
401
Projection []*PropertyExpression `json:"projection,omitempty"`
403
// StartCursor: A starting point for the query results. Optional. Query
404
// cursors are returned in query result batches.
405
StartCursor string `json:"startCursor,omitempty"`
408
type QueryResultBatch struct {
409
// EndCursor: A cursor that points to the position after the last result
410
// in the batch. May be absent. TODO(arfuller): Once all plans produce
411
// cursors update documentation here.
412
EndCursor string `json:"endCursor,omitempty"`
414
// EntityResultType: The result type for every entity in entityResults.
415
// full for full entities, projection for entities with only projected
416
// properties, keyOnly for entities with only a key.
417
EntityResultType string `json:"entityResultType,omitempty"`
419
// EntityResults: The results for this batch.
420
EntityResults []*EntityResult `json:"entityResults,omitempty"`
422
// MoreResults: The state of the query after the current batch. One of
423
// notFinished, moreResultsAfterLimit, noMoreResults.
424
MoreResults string `json:"moreResults,omitempty"`
426
// SkippedResults: The number of results skipped because of
428
SkippedResults int64 `json:"skippedResults,omitempty"`
431
type ReadOptions struct {
432
// ReadConsistency: The read consistency to use. One of default, strong,
433
// or eventual. Cannot be set when transaction is set. Lookup and
434
// ancestor queries default to strong, global queries default to
435
// eventual and cannot be set to strong. Optional. Default is default.
436
ReadConsistency string `json:"readConsistency,omitempty"`
438
// Transaction: The transaction to use. Optional.
439
Transaction string `json:"transaction,omitempty"`
442
type ResponseHeader struct {
443
// Kind: Identifies what kind of resource this is. Value: the fixed
444
// string "datastore#responseHeader".
445
Kind string `json:"kind,omitempty"`
448
type RollbackRequest struct {
449
// Transaction: The transaction identifier, returned by a call to
451
Transaction string `json:"transaction,omitempty"`
454
type RollbackResponse struct {
455
Header *ResponseHeader `json:"header,omitempty"`
458
type RunQueryRequest struct {
459
// GqlQuery: The GQL query to run. Either this field or field query must
460
// be set, but not both.
461
GqlQuery *GqlQuery `json:"gqlQuery,omitempty"`
463
// PartitionId: Entities are partitioned into subsets, identified by a
464
// dataset (usually implicitly specified by the project) and namespace
465
// ID. Queries are scoped to a single partition. This partition ID is
466
// normalized with the standard default context partition ID, but all
467
// other partition IDs in RunQueryRequest are normalized with this
468
// partition ID as the context partition ID.
469
PartitionId *PartitionId `json:"partitionId,omitempty"`
471
// Query: The query to run. Either this field or field gql_query must be
472
// set, but not both.
473
Query *Query `json:"query,omitempty"`
475
// ReadOptions: The options for this query.
476
ReadOptions *ReadOptions `json:"readOptions,omitempty"`
479
type RunQueryResponse struct {
480
// Batch: A batch of query results (always present).
481
Batch *QueryResultBatch `json:"batch,omitempty"`
483
Header *ResponseHeader `json:"header,omitempty"`
487
// BlobKeyValue: A blob key value.
488
BlobKeyValue string `json:"blobKeyValue,omitempty"`
490
// BlobValue: A blob value. May be a maximum of 1,000,000 bytes.
491
BlobValue string `json:"blobValue,omitempty"`
493
// BooleanValue: A boolean value.
494
BooleanValue bool `json:"booleanValue,omitempty"`
496
// DateTimeValue: A timestamp value.
497
DateTimeValue string `json:"dateTimeValue,omitempty"`
499
// DoubleValue: A double value.
500
DoubleValue float64 `json:"doubleValue,omitempty"`
502
// EntityValue: An entity value. May have no key. May have a key with an
503
// incomplete key path. May have a reserved/read-only key.
504
EntityValue *Entity `json:"entityValue,omitempty"`
506
// Indexed: If the value should be indexed.
508
// The indexed property may be
509
// set for a null value. When indexed is true, stringValue is limited to
510
// 500 characters and the blob value is limited to 500 bytes. Input
511
// values by default have indexed set to true; however, you can
512
// explicitly set indexed to true if you want. (An output value never
513
// has indexed explicitly set to true.) If a value is itself an entity,
514
// it cannot have indexed set to true.
515
Indexed bool `json:"indexed,omitempty"`
517
// IntegerValue: An integer value.
518
IntegerValue int64 `json:"integerValue,omitempty,string"`
520
// KeyValue: A key value.
521
KeyValue *Key `json:"keyValue,omitempty"`
523
// Meaning: The meaning field is reserved and should not be used.
524
Meaning int64 `json:"meaning,omitempty"`
526
// StringValue: A UTF-8 encoded string value.
527
StringValue string `json:"stringValue,omitempty"`
530
// method id "datastore.datasets.allocateIds":
532
type DatasetsAllocateIdsCall struct {
535
allocateidsrequest *AllocateIdsRequest
536
opt_ map[string]interface{}
539
// AllocateIds: Allocate IDs for incomplete keys (useful for referencing
540
// an entity before it is inserted).
541
func (r *DatasetsService) AllocateIds(datasetId string, allocateidsrequest *AllocateIdsRequest) *DatasetsAllocateIdsCall {
542
c := &DatasetsAllocateIdsCall{s: r.s, opt_: make(map[string]interface{})}
543
c.datasetId = datasetId
544
c.allocateidsrequest = allocateidsrequest
548
// Fields allows partial responses to be retrieved.
549
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
550
// for more information.
551
func (c *DatasetsAllocateIdsCall) Fields(s ...googleapi.Field) *DatasetsAllocateIdsCall {
552
c.opt_["fields"] = googleapi.CombineFields(s)
556
func (c *DatasetsAllocateIdsCall) Do() (*AllocateIdsResponse, error) {
557
var body io.Reader = nil
558
body, err := googleapi.WithoutDataWrapper.JSONReader(c.allocateidsrequest)
562
ctype := "application/json"
563
params := make(url.Values)
564
params.Set("alt", "json")
565
if v, ok := c.opt_["fields"]; ok {
566
params.Set("fields", fmt.Sprintf("%v", v))
568
urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/allocateIds")
569
urls += "?" + params.Encode()
570
req, _ := http.NewRequest("POST", urls, body)
571
googleapi.Expand(req.URL, map[string]string{
572
"datasetId": c.datasetId,
574
req.Header.Set("Content-Type", ctype)
575
req.Header.Set("User-Agent", "google-api-go-client/0.5")
576
res, err := c.s.client.Do(req)
580
defer googleapi.CloseBody(res)
581
if err := googleapi.CheckResponse(res); err != nil {
584
var ret *AllocateIdsResponse
585
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
590
// "description": "Allocate IDs for incomplete keys (useful for referencing an entity before it is inserted).",
591
// "httpMethod": "POST",
592
// "id": "datastore.datasets.allocateIds",
593
// "parameterOrder": [
598
// "description": "Identifies the dataset.",
599
// "location": "path",
604
// "path": "{datasetId}/allocateIds",
606
// "$ref": "AllocateIdsRequest"
609
// "$ref": "AllocateIdsResponse"
612
// "https://www.googleapis.com/auth/cloud-platform",
613
// "https://www.googleapis.com/auth/datastore",
614
// "https://www.googleapis.com/auth/userinfo.email"
620
// method id "datastore.datasets.beginTransaction":
622
type DatasetsBeginTransactionCall struct {
625
begintransactionrequest *BeginTransactionRequest
626
opt_ map[string]interface{}
629
// BeginTransaction: Begin a new transaction.
630
func (r *DatasetsService) BeginTransaction(datasetId string, begintransactionrequest *BeginTransactionRequest) *DatasetsBeginTransactionCall {
631
c := &DatasetsBeginTransactionCall{s: r.s, opt_: make(map[string]interface{})}
632
c.datasetId = datasetId
633
c.begintransactionrequest = begintransactionrequest
637
// Fields allows partial responses to be retrieved.
638
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
639
// for more information.
640
func (c *DatasetsBeginTransactionCall) Fields(s ...googleapi.Field) *DatasetsBeginTransactionCall {
641
c.opt_["fields"] = googleapi.CombineFields(s)
645
func (c *DatasetsBeginTransactionCall) Do() (*BeginTransactionResponse, error) {
646
var body io.Reader = nil
647
body, err := googleapi.WithoutDataWrapper.JSONReader(c.begintransactionrequest)
651
ctype := "application/json"
652
params := make(url.Values)
653
params.Set("alt", "json")
654
if v, ok := c.opt_["fields"]; ok {
655
params.Set("fields", fmt.Sprintf("%v", v))
657
urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/beginTransaction")
658
urls += "?" + params.Encode()
659
req, _ := http.NewRequest("POST", urls, body)
660
googleapi.Expand(req.URL, map[string]string{
661
"datasetId": c.datasetId,
663
req.Header.Set("Content-Type", ctype)
664
req.Header.Set("User-Agent", "google-api-go-client/0.5")
665
res, err := c.s.client.Do(req)
669
defer googleapi.CloseBody(res)
670
if err := googleapi.CheckResponse(res); err != nil {
673
var ret *BeginTransactionResponse
674
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
679
// "description": "Begin a new transaction.",
680
// "httpMethod": "POST",
681
// "id": "datastore.datasets.beginTransaction",
682
// "parameterOrder": [
687
// "description": "Identifies the dataset.",
688
// "location": "path",
693
// "path": "{datasetId}/beginTransaction",
695
// "$ref": "BeginTransactionRequest"
698
// "$ref": "BeginTransactionResponse"
701
// "https://www.googleapis.com/auth/cloud-platform",
702
// "https://www.googleapis.com/auth/datastore",
703
// "https://www.googleapis.com/auth/userinfo.email"
709
// method id "datastore.datasets.blindWrite":
711
type DatasetsBlindWriteCall struct {
714
blindwriterequest *BlindWriteRequest
715
opt_ map[string]interface{}
718
// BlindWrite: Create, delete or modify some entities outside a
720
func (r *DatasetsService) BlindWrite(datasetId string, blindwriterequest *BlindWriteRequest) *DatasetsBlindWriteCall {
721
c := &DatasetsBlindWriteCall{s: r.s, opt_: make(map[string]interface{})}
722
c.datasetId = datasetId
723
c.blindwriterequest = blindwriterequest
727
// Fields allows partial responses to be retrieved.
728
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
729
// for more information.
730
func (c *DatasetsBlindWriteCall) Fields(s ...googleapi.Field) *DatasetsBlindWriteCall {
731
c.opt_["fields"] = googleapi.CombineFields(s)
735
func (c *DatasetsBlindWriteCall) Do() (*BlindWriteResponse, error) {
736
var body io.Reader = nil
737
body, err := googleapi.WithoutDataWrapper.JSONReader(c.blindwriterequest)
741
ctype := "application/json"
742
params := make(url.Values)
743
params.Set("alt", "json")
744
if v, ok := c.opt_["fields"]; ok {
745
params.Set("fields", fmt.Sprintf("%v", v))
747
urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/blindWrite")
748
urls += "?" + params.Encode()
749
req, _ := http.NewRequest("POST", urls, body)
750
googleapi.Expand(req.URL, map[string]string{
751
"datasetId": c.datasetId,
753
req.Header.Set("Content-Type", ctype)
754
req.Header.Set("User-Agent", "google-api-go-client/0.5")
755
res, err := c.s.client.Do(req)
759
defer googleapi.CloseBody(res)
760
if err := googleapi.CheckResponse(res); err != nil {
763
var ret *BlindWriteResponse
764
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
769
// "description": "Create, delete or modify some entities outside a transaction.",
770
// "httpMethod": "POST",
771
// "id": "datastore.datasets.blindWrite",
772
// "parameterOrder": [
777
// "description": "Identifies the dataset.",
778
// "location": "path",
783
// "path": "{datasetId}/blindWrite",
785
// "$ref": "BlindWriteRequest"
788
// "$ref": "BlindWriteResponse"
791
// "https://www.googleapis.com/auth/cloud-platform",
792
// "https://www.googleapis.com/auth/datastore",
793
// "https://www.googleapis.com/auth/userinfo.email"
799
// method id "datastore.datasets.commit":
801
type DatasetsCommitCall struct {
804
commitrequest *CommitRequest
805
opt_ map[string]interface{}
808
// Commit: Commit a transaction, optionally creating, deleting or
809
// modifying some entities.
810
func (r *DatasetsService) Commit(datasetId string, commitrequest *CommitRequest) *DatasetsCommitCall {
811
c := &DatasetsCommitCall{s: r.s, opt_: make(map[string]interface{})}
812
c.datasetId = datasetId
813
c.commitrequest = commitrequest
817
// Fields allows partial responses to be retrieved.
818
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
819
// for more information.
820
func (c *DatasetsCommitCall) Fields(s ...googleapi.Field) *DatasetsCommitCall {
821
c.opt_["fields"] = googleapi.CombineFields(s)
825
func (c *DatasetsCommitCall) Do() (*CommitResponse, error) {
826
var body io.Reader = nil
827
body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitrequest)
831
ctype := "application/json"
832
params := make(url.Values)
833
params.Set("alt", "json")
834
if v, ok := c.opt_["fields"]; ok {
835
params.Set("fields", fmt.Sprintf("%v", v))
837
urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/commit")
838
urls += "?" + params.Encode()
839
req, _ := http.NewRequest("POST", urls, body)
840
googleapi.Expand(req.URL, map[string]string{
841
"datasetId": c.datasetId,
843
req.Header.Set("Content-Type", ctype)
844
req.Header.Set("User-Agent", "google-api-go-client/0.5")
845
res, err := c.s.client.Do(req)
849
defer googleapi.CloseBody(res)
850
if err := googleapi.CheckResponse(res); err != nil {
853
var ret *CommitResponse
854
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
859
// "description": "Commit a transaction, optionally creating, deleting or modifying some entities.",
860
// "httpMethod": "POST",
861
// "id": "datastore.datasets.commit",
862
// "parameterOrder": [
867
// "description": "Identifies the dataset.",
868
// "location": "path",
873
// "path": "{datasetId}/commit",
875
// "$ref": "CommitRequest"
878
// "$ref": "CommitResponse"
881
// "https://www.googleapis.com/auth/cloud-platform",
882
// "https://www.googleapis.com/auth/datastore",
883
// "https://www.googleapis.com/auth/userinfo.email"
889
// method id "datastore.datasets.lookup":
891
type DatasetsLookupCall struct {
894
lookuprequest *LookupRequest
895
opt_ map[string]interface{}
898
// Lookup: Look up some entities by key.
899
func (r *DatasetsService) Lookup(datasetId string, lookuprequest *LookupRequest) *DatasetsLookupCall {
900
c := &DatasetsLookupCall{s: r.s, opt_: make(map[string]interface{})}
901
c.datasetId = datasetId
902
c.lookuprequest = lookuprequest
906
// Fields allows partial responses to be retrieved.
907
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
908
// for more information.
909
func (c *DatasetsLookupCall) Fields(s ...googleapi.Field) *DatasetsLookupCall {
910
c.opt_["fields"] = googleapi.CombineFields(s)
914
func (c *DatasetsLookupCall) Do() (*LookupResponse, error) {
915
var body io.Reader = nil
916
body, err := googleapi.WithoutDataWrapper.JSONReader(c.lookuprequest)
920
ctype := "application/json"
921
params := make(url.Values)
922
params.Set("alt", "json")
923
if v, ok := c.opt_["fields"]; ok {
924
params.Set("fields", fmt.Sprintf("%v", v))
926
urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/lookup")
927
urls += "?" + params.Encode()
928
req, _ := http.NewRequest("POST", urls, body)
929
googleapi.Expand(req.URL, map[string]string{
930
"datasetId": c.datasetId,
932
req.Header.Set("Content-Type", ctype)
933
req.Header.Set("User-Agent", "google-api-go-client/0.5")
934
res, err := c.s.client.Do(req)
938
defer googleapi.CloseBody(res)
939
if err := googleapi.CheckResponse(res); err != nil {
942
var ret *LookupResponse
943
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
948
// "description": "Look up some entities by key.",
949
// "httpMethod": "POST",
950
// "id": "datastore.datasets.lookup",
951
// "parameterOrder": [
956
// "description": "Identifies the dataset.",
957
// "location": "path",
962
// "path": "{datasetId}/lookup",
964
// "$ref": "LookupRequest"
967
// "$ref": "LookupResponse"
970
// "https://www.googleapis.com/auth/cloud-platform",
971
// "https://www.googleapis.com/auth/datastore",
972
// "https://www.googleapis.com/auth/userinfo.email"
978
// method id "datastore.datasets.rollback":
980
type DatasetsRollbackCall struct {
983
rollbackrequest *RollbackRequest
984
opt_ map[string]interface{}
987
// Rollback: Roll back a transaction.
988
func (r *DatasetsService) Rollback(datasetId string, rollbackrequest *RollbackRequest) *DatasetsRollbackCall {
989
c := &DatasetsRollbackCall{s: r.s, opt_: make(map[string]interface{})}
990
c.datasetId = datasetId
991
c.rollbackrequest = rollbackrequest
995
// Fields allows partial responses to be retrieved.
996
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
997
// for more information.
998
func (c *DatasetsRollbackCall) Fields(s ...googleapi.Field) *DatasetsRollbackCall {
999
c.opt_["fields"] = googleapi.CombineFields(s)
1003
func (c *DatasetsRollbackCall) Do() (*RollbackResponse, error) {
1004
var body io.Reader = nil
1005
body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackrequest)
1009
ctype := "application/json"
1010
params := make(url.Values)
1011
params.Set("alt", "json")
1012
if v, ok := c.opt_["fields"]; ok {
1013
params.Set("fields", fmt.Sprintf("%v", v))
1015
urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/rollback")
1016
urls += "?" + params.Encode()
1017
req, _ := http.NewRequest("POST", urls, body)
1018
googleapi.Expand(req.URL, map[string]string{
1019
"datasetId": c.datasetId,
1021
req.Header.Set("Content-Type", ctype)
1022
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1023
res, err := c.s.client.Do(req)
1027
defer googleapi.CloseBody(res)
1028
if err := googleapi.CheckResponse(res); err != nil {
1031
var ret *RollbackResponse
1032
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1037
// "description": "Roll back a transaction.",
1038
// "httpMethod": "POST",
1039
// "id": "datastore.datasets.rollback",
1040
// "parameterOrder": [
1045
// "description": "Identifies the dataset.",
1046
// "location": "path",
1047
// "required": true,
1051
// "path": "{datasetId}/rollback",
1053
// "$ref": "RollbackRequest"
1056
// "$ref": "RollbackResponse"
1059
// "https://www.googleapis.com/auth/cloud-platform",
1060
// "https://www.googleapis.com/auth/datastore",
1061
// "https://www.googleapis.com/auth/userinfo.email"
1067
// method id "datastore.datasets.runQuery":
1069
type DatasetsRunQueryCall struct {
1072
runqueryrequest *RunQueryRequest
1073
opt_ map[string]interface{}
1076
// RunQuery: Query for entities.
1077
func (r *DatasetsService) RunQuery(datasetId string, runqueryrequest *RunQueryRequest) *DatasetsRunQueryCall {
1078
c := &DatasetsRunQueryCall{s: r.s, opt_: make(map[string]interface{})}
1079
c.datasetId = datasetId
1080
c.runqueryrequest = runqueryrequest
1084
// Fields allows partial responses to be retrieved.
1085
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
1086
// for more information.
1087
func (c *DatasetsRunQueryCall) Fields(s ...googleapi.Field) *DatasetsRunQueryCall {
1088
c.opt_["fields"] = googleapi.CombineFields(s)
1092
func (c *DatasetsRunQueryCall) Do() (*RunQueryResponse, error) {
1093
var body io.Reader = nil
1094
body, err := googleapi.WithoutDataWrapper.JSONReader(c.runqueryrequest)
1098
ctype := "application/json"
1099
params := make(url.Values)
1100
params.Set("alt", "json")
1101
if v, ok := c.opt_["fields"]; ok {
1102
params.Set("fields", fmt.Sprintf("%v", v))
1104
urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/runQuery")
1105
urls += "?" + params.Encode()
1106
req, _ := http.NewRequest("POST", urls, body)
1107
googleapi.Expand(req.URL, map[string]string{
1108
"datasetId": c.datasetId,
1110
req.Header.Set("Content-Type", ctype)
1111
req.Header.Set("User-Agent", "google-api-go-client/0.5")
1112
res, err := c.s.client.Do(req)
1116
defer googleapi.CloseBody(res)
1117
if err := googleapi.CheckResponse(res); err != nil {
1120
var ret *RunQueryResponse
1121
if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
1126
// "description": "Query for entities.",
1127
// "httpMethod": "POST",
1128
// "id": "datastore.datasets.runQuery",
1129
// "parameterOrder": [
1134
// "description": "Identifies the dataset.",
1135
// "location": "path",
1136
// "required": true,
1140
// "path": "{datasetId}/runQuery",
1142
// "$ref": "RunQueryRequest"
1145
// "$ref": "RunQueryResponse"
1148
// "https://www.googleapis.com/auth/cloud-platform",
1149
// "https://www.googleapis.com/auth/datastore",
1150
// "https://www.googleapis.com/auth/userinfo.email"