~nskaggs/+junk/xenial-test

« back to all changes in this revision

Viewing changes to src/google.golang.org/api/datastore/v1beta2/datastore-gen.go

  • Committer: Nicholas Skaggs
  • Date: 2016-10-24 20:56:05 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20161024205605-z8lta0uvuhtxwzwl
Initi with beta15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Package datastore provides access to the Google Cloud Datastore API.
 
2
//
 
3
// See https://developers.google.com/datastore/
 
4
//
 
5
// Usage example:
 
6
//
 
7
//   import "google.golang.org/api/datastore/v1beta2"
 
8
//   ...
 
9
//   datastoreService, err := datastore.New(oauthHttpClient)
 
10
package datastore
 
11
 
 
12
import (
 
13
        "bytes"
 
14
        "encoding/json"
 
15
        "errors"
 
16
        "fmt"
 
17
        "google.golang.org/api/googleapi"
 
18
        "io"
 
19
        "net/http"
 
20
        "net/url"
 
21
        "strconv"
 
22
        "strings"
 
23
)
 
24
 
 
25
// Always reference these packages, just in case the auto-generated code
 
26
// below doesn't.
 
27
var _ = bytes.NewBuffer
 
28
var _ = strconv.Itoa
 
29
var _ = fmt.Sprintf
 
30
var _ = json.NewDecoder
 
31
var _ = io.Copy
 
32
var _ = url.Parse
 
33
var _ = googleapi.Version
 
34
var _ = errors.New
 
35
var _ = strings.Replace
 
36
 
 
37
const apiId = "datastore:v1beta2"
 
38
const apiName = "datastore"
 
39
const apiVersion = "v1beta2"
 
40
const basePath = "https://www.googleapis.com/datastore/v1beta2/datasets/"
 
41
 
 
42
// OAuth2 scopes used by this API.
 
43
const (
 
44
        // View and manage your data across Google Cloud Platform services
 
45
        CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
 
46
 
 
47
        // View and manage your Google Cloud Datastore data
 
48
        DatastoreScope = "https://www.googleapis.com/auth/datastore"
 
49
 
 
50
        // View your email address
 
51
        UserinfoEmailScope = "https://www.googleapis.com/auth/userinfo.email"
 
52
)
 
53
 
 
54
func New(client *http.Client) (*Service, error) {
 
55
        if client == nil {
 
56
                return nil, errors.New("client is nil")
 
57
        }
 
58
        s := &Service{client: client, BasePath: basePath}
 
59
        s.Datasets = NewDatasetsService(s)
 
60
        return s, nil
 
61
}
 
62
 
 
63
type Service struct {
 
64
        client   *http.Client
 
65
        BasePath string // API endpoint base URL
 
66
 
 
67
        Datasets *DatasetsService
 
68
}
 
69
 
 
70
func NewDatasetsService(s *Service) *DatasetsService {
 
71
        rs := &DatasetsService{s: s}
 
72
        return rs
 
73
}
 
74
 
 
75
type DatasetsService struct {
 
76
        s *Service
 
77
}
 
78
 
 
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"`
 
83
}
 
84
 
 
85
type AllocateIdsResponse struct {
 
86
        Header *ResponseHeader `json:"header,omitempty"`
 
87
 
 
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"`
 
91
}
 
92
 
 
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"`
 
102
}
 
103
 
 
104
type BeginTransactionResponse struct {
 
105
        Header *ResponseHeader `json:"header,omitempty"`
 
106
 
 
107
        // Transaction: The transaction identifier (always present).
 
108
        Transaction string `json:"transaction,omitempty"`
 
109
}
 
110
 
 
111
type CommitRequest struct {
 
112
        IgnoreReadOnly bool `json:"ignoreReadOnly,omitempty"`
 
113
 
 
114
        // Mode: The type of commit to perform. Either TRANSACTIONAL or
 
115
        // NON_TRANSACTIONAL.
 
116
        Mode string `json:"mode,omitempty"`
 
117
 
 
118
        // Mutation: The mutation to perform. Optional.
 
119
        Mutation *Mutation `json:"mutation,omitempty"`
 
120
 
 
121
        // Transaction: The transaction identifier, returned by a call to
 
122
        // beginTransaction. Must be set when mode is TRANSACTIONAL.
 
123
        Transaction string `json:"transaction,omitempty"`
 
124
}
 
125
 
 
126
type CommitResponse struct {
 
127
        Header *ResponseHeader `json:"header,omitempty"`
 
128
 
 
129
        // MutationResult: The result of performing the mutation (if any).
 
130
        MutationResult *MutationResult `json:"mutationResult,omitempty"`
 
131
}
 
132
 
 
133
type CompositeFilter struct {
 
134
        // Filters: The list of filters to combine. Must contain at least one
 
135
        // filter.
 
136
        Filters []*Filter `json:"filters,omitempty"`
 
137
 
 
138
        // Operator: The operator for combining multiple filters. Only "and" is
 
139
        // currently supported.
 
140
        Operator string `json:"operator,omitempty"`
 
141
}
 
142
 
 
143
type Entity struct {
 
144
        // Key: The entity's key.
 
145
        //
 
146
        // An entity must have a key, unless otherwise
 
147
        // documented (for example, an entity in Value.entityValue may have no
 
148
        // key). An entity's kind is its key's path's last element's kind, or
 
149
        // null if it has no key.
 
150
        Key *Key `json:"key,omitempty"`
 
151
 
 
152
        // Properties: The entity's properties.
 
153
        Properties map[string]Property `json:"properties,omitempty"`
 
154
}
 
155
 
 
156
type EntityResult struct {
 
157
        // Entity: The resulting entity.
 
158
        Entity *Entity `json:"entity,omitempty"`
 
159
}
 
160
 
 
161
type Filter struct {
 
162
        // CompositeFilter: A composite filter.
 
163
        CompositeFilter *CompositeFilter `json:"compositeFilter,omitempty"`
 
164
 
 
165
        // PropertyFilter: A filter on a property.
 
166
        PropertyFilter *PropertyFilter `json:"propertyFilter,omitempty"`
 
167
}
 
168
 
 
169
type GqlQuery struct {
 
170
        // AllowLiteral: When false, the query string must not contain a
 
171
        // literal.
 
172
        AllowLiteral bool `json:"allowLiteral,omitempty"`
 
173
 
 
174
        // NameArgs: A named argument must set field GqlQueryArg.name. No two
 
175
        // named arguments may have the same name. For each non-reserved named
 
176
        // binding site in the query string, there must be a named argument with
 
177
        // that name, but not necessarily the inverse.
 
178
        NameArgs []*GqlQueryArg `json:"nameArgs,omitempty"`
 
179
 
 
180
        // NumberArgs: Numbered binding site @1 references the first numbered
 
181
        // argument, effectively using 1-based indexing, rather than the usual
 
182
        // 0. A numbered argument must NOT set field GqlQueryArg.name. For each
 
183
        // binding site numbered i in query_string, there must be an ith
 
184
        // numbered argument. The inverse must also be true.
 
185
        NumberArgs []*GqlQueryArg `json:"numberArgs,omitempty"`
 
186
 
 
187
        // QueryString: The query string.
 
188
        QueryString string `json:"queryString,omitempty"`
 
189
}
 
190
 
 
191
type GqlQueryArg struct {
 
192
        Cursor string `json:"cursor,omitempty"`
 
193
 
 
194
        // Name: Must match regex "[A-Za-z_$][A-Za-z_$0-9]*". Must not match
 
195
        // regex "__.*__". Must not be "".
 
196
        Name string `json:"name,omitempty"`
 
197
 
 
198
        Value *Value `json:"value,omitempty"`
 
199
}
 
200
 
 
201
type Key struct {
 
202
        // PartitionId: Entities are partitioned into subsets, currently
 
203
        // identified by a dataset (usually implicitly specified by the project)
 
204
        // and namespace ID. Queries are scoped to a single partition.
 
205
        PartitionId *PartitionId `json:"partitionId,omitempty"`
 
206
 
 
207
        // Path: The entity path. An entity path consists of one or more
 
208
        // elements composed of a kind and a string or numerical identifier,
 
209
        // which identify entities. The first element identifies a root entity,
 
210
        // the second element identifies a child of the root entity, the third
 
211
        // element a child of the second entity, and so forth. The entities
 
212
        // identified by all prefixes of the path are called the element's
 
213
        // ancestors. An entity path is always fully complete: ALL of the
 
214
        // entity's ancestors are required to be in the path along with the
 
215
        // entity identifier itself. The only exception is that in some
 
216
        // documented cases, the identifier in the last path element (for the
 
217
        // entity) itself may be omitted. A path can never be empty. The path
 
218
        // can have at most 100 elements.
 
219
        Path []*KeyPathElement `json:"path,omitempty"`
 
220
}
 
221
 
 
222
type KeyPathElement struct {
 
223
        // Id: The ID of the entity. Never equal to zero. Values less than zero
 
224
        // are discouraged and will not be supported in the future.
 
225
        Id int64 `json:"id,omitempty,string"`
 
226
 
 
227
        // Kind: The kind of the entity. A kind matching regex "__.*__" is
 
228
        // reserved/read-only. A kind must not contain more than 500 characters.
 
229
        // Cannot be "".
 
230
        Kind string `json:"kind,omitempty"`
 
231
 
 
232
        // Name: The name of the entity. A name matching regex "__.*__" is
 
233
        // reserved/read-only. A name must not be more than 500 characters.
 
234
        // Cannot be "".
 
235
        Name string `json:"name,omitempty"`
 
236
}
 
237
 
 
238
type KindExpression struct {
 
239
        // Name: The name of the kind.
 
240
        Name string `json:"name,omitempty"`
 
241
}
 
242
 
 
243
type LookupRequest struct {
 
244
        // Keys: Keys of entities to look up from the datastore.
 
245
        Keys []*Key `json:"keys,omitempty"`
 
246
 
 
247
        // ReadOptions: Options for this lookup request. Optional.
 
248
        ReadOptions *ReadOptions `json:"readOptions,omitempty"`
 
249
}
 
250
 
 
251
type LookupResponse struct {
 
252
        // Deferred: A list of keys that were not looked up due to resource
 
253
        // constraints.
 
254
        Deferred []*Key `json:"deferred,omitempty"`
 
255
 
 
256
        // Found: Entities found.
 
257
        Found []*EntityResult `json:"found,omitempty"`
 
258
 
 
259
        Header *ResponseHeader `json:"header,omitempty"`
 
260
 
 
261
        // Missing: Entities not found, with only the key populated.
 
262
        Missing []*EntityResult `json:"missing,omitempty"`
 
263
}
 
264
 
 
265
type Mutation struct {
 
266
        // Delete: Keys of entities to delete. Each key must have a complete key
 
267
        // path and must not be reserved/read-only.
 
268
        Delete []*Key `json:"delete,omitempty"`
 
269
 
 
270
        // Force: Ignore a user specified read-only period. Optional.
 
271
        Force bool `json:"force,omitempty"`
 
272
 
 
273
        // Insert: Entities to insert. Each inserted entity's key must have a
 
274
        // complete path and must not be reserved/read-only.
 
275
        Insert []*Entity `json:"insert,omitempty"`
 
276
 
 
277
        // InsertAutoId: Insert entities with a newly allocated ID. Each
 
278
        // inserted entity's key must omit the final identifier in its path and
 
279
        // must not be reserved/read-only.
 
280
        InsertAutoId []*Entity `json:"insertAutoId,omitempty"`
 
281
 
 
282
        // Update: Entities to update. Each updated entity's key must have a
 
283
        // complete path and must not be reserved/read-only.
 
284
        Update []*Entity `json:"update,omitempty"`
 
285
 
 
286
        // Upsert: Entities to upsert. Each upserted entity's key must have a
 
287
        // complete path and must not be reserved/read-only.
 
288
        Upsert []*Entity `json:"upsert,omitempty"`
 
289
}
 
290
 
 
291
type MutationResult struct {
 
292
        // IndexUpdates: Number of index writes.
 
293
        IndexUpdates int64 `json:"indexUpdates,omitempty"`
 
294
 
 
295
        // InsertAutoIdKeys: Keys for insertAutoId entities. One per entity from
 
296
        // the request, in the same order.
 
297
        InsertAutoIdKeys []*Key `json:"insertAutoIdKeys,omitempty"`
 
298
}
 
299
 
 
300
type PartitionId struct {
 
301
        // DatasetId: The dataset ID.
 
302
        DatasetId string `json:"datasetId,omitempty"`
 
303
 
 
304
        // Namespace: The namespace.
 
305
        Namespace string `json:"namespace,omitempty"`
 
306
}
 
307
 
 
308
type Property struct {
 
309
        // BlobKeyValue: A blob key value.
 
310
        BlobKeyValue string `json:"blobKeyValue,omitempty"`
 
311
 
 
312
        // BlobValue: A blob value. May be a maximum of 1,000,000 bytes.
 
313
        BlobValue string `json:"blobValue,omitempty"`
 
314
 
 
315
        // BooleanValue: A boolean value.
 
316
        BooleanValue bool `json:"booleanValue,omitempty"`
 
317
 
 
318
        // DateTimeValue: A timestamp value.
 
319
        DateTimeValue string `json:"dateTimeValue,omitempty"`
 
320
 
 
321
        // DoubleValue: A double value.
 
322
        DoubleValue float64 `json:"doubleValue,omitempty"`
 
323
 
 
324
        // EntityValue: An entity value. May have no key. May have a key with an
 
325
        // incomplete key path. May have a reserved/read-only key.
 
326
        EntityValue *Entity `json:"entityValue,omitempty"`
 
327
 
 
328
        // Indexed: If the value should be indexed.
 
329
        //
 
330
        // The indexed property may be
 
331
        // set for a null value. When indexed is true, stringValue is limited to
 
332
        // 500 characters and the blob value is limited to 500 bytes. Input
 
333
        // values by default have indexed set to true; however, you can
 
334
        // explicitly set indexed to true if you want. (An output value never
 
335
        // has indexed explicitly set to true.) If a value is itself an entity,
 
336
        // it cannot have indexed set to true.
 
337
        Indexed bool `json:"indexed,omitempty"`
 
338
 
 
339
        // IntegerValue: An integer value.
 
340
        IntegerValue int64 `json:"integerValue,omitempty,string"`
 
341
 
 
342
        // KeyValue: A key value.
 
343
        KeyValue *Key `json:"keyValue,omitempty"`
 
344
 
 
345
        // ListValue: A list value. Cannot contain another list value. Cannot
 
346
        // also have a meaning and indexing set.
 
347
        ListValue []*Value `json:"listValue,omitempty"`
 
348
 
 
349
        // Meaning: The meaning field is reserved and should not be used.
 
350
        Meaning int64 `json:"meaning,omitempty"`
 
351
 
 
352
        // StringValue: A UTF-8 encoded string value.
 
353
        StringValue string `json:"stringValue,omitempty"`
 
354
}
 
355
 
 
356
type PropertyExpression struct {
 
357
        // AggregationFunction: The aggregation function to apply to the
 
358
        // property. Optional. Can only be used when grouping by at least one
 
359
        // property. Must then be set on all properties in the projection that
 
360
        // are not being grouped by. Aggregation functions: first selects the
 
361
        // first result as determined by the query's order.
 
362
        AggregationFunction string `json:"aggregationFunction,omitempty"`
 
363
 
 
364
        // Property: The property to project.
 
365
        Property *PropertyReference `json:"property,omitempty"`
 
366
}
 
367
 
 
368
type PropertyFilter struct {
 
369
        // Operator: The operator to filter by. One of lessThan,
 
370
        // lessThanOrEqual, greaterThan, greaterThanOrEqual, equal, or
 
371
        // hasAncestor.
 
372
        Operator string `json:"operator,omitempty"`
 
373
 
 
374
        // Property: The property to filter by.
 
375
        Property *PropertyReference `json:"property,omitempty"`
 
376
 
 
377
        // Value: The value to compare the property to.
 
378
        Value *Value `json:"value,omitempty"`
 
379
}
 
380
 
 
381
type PropertyOrder struct {
 
382
        // Direction: The direction to order by. One of ascending or descending.
 
383
        // Optional, defaults to ascending.
 
384
        Direction string `json:"direction,omitempty"`
 
385
 
 
386
        // Property: The property to order by.
 
387
        Property *PropertyReference `json:"property,omitempty"`
 
388
}
 
389
 
 
390
type PropertyReference struct {
 
391
        // Name: The name of the property.
 
392
        Name string `json:"name,omitempty"`
 
393
}
 
394
 
 
395
type Query struct {
 
396
        // EndCursor: An ending point for the query results. Optional. Query
 
397
        // cursors are returned in query result batches.
 
398
        EndCursor string `json:"endCursor,omitempty"`
 
399
 
 
400
        // Filter: The filter to apply (optional).
 
401
        Filter *Filter `json:"filter,omitempty"`
 
402
 
 
403
        // GroupBy: The properties to group by (if empty, no grouping is applied
 
404
        // to the result set).
 
405
        GroupBy []*PropertyReference `json:"groupBy,omitempty"`
 
406
 
 
407
        // Kinds: The kinds to query (if empty, returns entities from all
 
408
        // kinds).
 
409
        Kinds []*KindExpression `json:"kinds,omitempty"`
 
410
 
 
411
        // Limit: The maximum number of results to return. Applies after all
 
412
        // other constraints. Optional.
 
413
        Limit int64 `json:"limit,omitempty"`
 
414
 
 
415
        // Offset: The number of results to skip. Applies before limit, but
 
416
        // after all other constraints (optional, defaults to 0).
 
417
        Offset int64 `json:"offset,omitempty"`
 
418
 
 
419
        // Order: The order to apply to the query results (if empty, order is
 
420
        // unspecified).
 
421
        Order []*PropertyOrder `json:"order,omitempty"`
 
422
 
 
423
        // Projection: The projection to return. If not set the entire entity is
 
424
        // returned.
 
425
        Projection []*PropertyExpression `json:"projection,omitempty"`
 
426
 
 
427
        // StartCursor: A starting point for the query results. Optional. Query
 
428
        // cursors are returned in query result batches.
 
429
        StartCursor string `json:"startCursor,omitempty"`
 
430
}
 
431
 
 
432
type QueryResultBatch struct {
 
433
        // EndCursor: A cursor that points to the position after the last result
 
434
        // in the batch. May be absent. TODO(arfuller): Once all plans produce
 
435
        // cursors update documentation here.
 
436
        EndCursor string `json:"endCursor,omitempty"`
 
437
 
 
438
        // EntityResultType: The result type for every entity in entityResults.
 
439
        // full for full entities, projection for entities with only projected
 
440
        // properties, keyOnly for entities with only a key.
 
441
        EntityResultType string `json:"entityResultType,omitempty"`
 
442
 
 
443
        // EntityResults: The results for this batch.
 
444
        EntityResults []*EntityResult `json:"entityResults,omitempty"`
 
445
 
 
446
        // MoreResults: The state of the query after the current batch. One of
 
447
        // notFinished, moreResultsAfterLimit, noMoreResults.
 
448
        MoreResults string `json:"moreResults,omitempty"`
 
449
 
 
450
        // SkippedResults: The number of results skipped because of
 
451
        // Query.offset.
 
452
        SkippedResults int64 `json:"skippedResults,omitempty"`
 
453
}
 
454
 
 
455
type ReadOptions struct {
 
456
        // ReadConsistency: The read consistency to use. One of default, strong,
 
457
        // or eventual. Cannot be set when transaction is set. Lookup and
 
458
        // ancestor queries default to strong, global queries default to
 
459
        // eventual and cannot be set to strong. Optional. Default is default.
 
460
        ReadConsistency string `json:"readConsistency,omitempty"`
 
461
 
 
462
        // Transaction: The transaction to use. Optional.
 
463
        Transaction string `json:"transaction,omitempty"`
 
464
}
 
465
 
 
466
type ResponseHeader struct {
 
467
        // Kind: Identifies what kind of resource this is. Value: the fixed
 
468
        // string "datastore#responseHeader".
 
469
        Kind string `json:"kind,omitempty"`
 
470
}
 
471
 
 
472
type RollbackRequest struct {
 
473
        // Transaction: The transaction identifier, returned by a call to
 
474
        // beginTransaction.
 
475
        Transaction string `json:"transaction,omitempty"`
 
476
}
 
477
 
 
478
type RollbackResponse struct {
 
479
        Header *ResponseHeader `json:"header,omitempty"`
 
480
}
 
481
 
 
482
type RunQueryRequest struct {
 
483
        // GqlQuery: The GQL query to run. Either this field or field query must
 
484
        // be set, but not both.
 
485
        GqlQuery *GqlQuery `json:"gqlQuery,omitempty"`
 
486
 
 
487
        // PartitionId: Entities are partitioned into subsets, identified by a
 
488
        // dataset (usually implicitly specified by the project) and namespace
 
489
        // ID. Queries are scoped to a single partition. This partition ID is
 
490
        // normalized with the standard default context partition ID, but all
 
491
        // other partition IDs in RunQueryRequest are normalized with this
 
492
        // partition ID as the context partition ID.
 
493
        PartitionId *PartitionId `json:"partitionId,omitempty"`
 
494
 
 
495
        // Query: The query to run. Either this field or field gql_query must be
 
496
        // set, but not both.
 
497
        Query *Query `json:"query,omitempty"`
 
498
 
 
499
        // ReadOptions: The options for this query.
 
500
        ReadOptions *ReadOptions `json:"readOptions,omitempty"`
 
501
}
 
502
 
 
503
type RunQueryResponse struct {
 
504
        // Batch: A batch of query results (always present).
 
505
        Batch *QueryResultBatch `json:"batch,omitempty"`
 
506
 
 
507
        Header *ResponseHeader `json:"header,omitempty"`
 
508
}
 
509
 
 
510
type Value struct {
 
511
        // BlobKeyValue: A blob key value.
 
512
        BlobKeyValue string `json:"blobKeyValue,omitempty"`
 
513
 
 
514
        // BlobValue: A blob value. May be a maximum of 1,000,000 bytes.
 
515
        BlobValue string `json:"blobValue,omitempty"`
 
516
 
 
517
        // BooleanValue: A boolean value.
 
518
        BooleanValue bool `json:"booleanValue,omitempty"`
 
519
 
 
520
        // DateTimeValue: A timestamp value.
 
521
        DateTimeValue string `json:"dateTimeValue,omitempty"`
 
522
 
 
523
        // DoubleValue: A double value.
 
524
        DoubleValue float64 `json:"doubleValue,omitempty"`
 
525
 
 
526
        // EntityValue: An entity value. May have no key. May have a key with an
 
527
        // incomplete key path. May have a reserved/read-only key.
 
528
        EntityValue *Entity `json:"entityValue,omitempty"`
 
529
 
 
530
        // Indexed: If the value should be indexed.
 
531
        //
 
532
        // The indexed property may be
 
533
        // set for a null value. When indexed is true, stringValue is limited to
 
534
        // 500 characters and the blob value is limited to 500 bytes. Input
 
535
        // values by default have indexed set to true; however, you can
 
536
        // explicitly set indexed to true if you want. (An output value never
 
537
        // has indexed explicitly set to true.) If a value is itself an entity,
 
538
        // it cannot have indexed set to true.
 
539
        Indexed bool `json:"indexed,omitempty"`
 
540
 
 
541
        // IntegerValue: An integer value.
 
542
        IntegerValue int64 `json:"integerValue,omitempty,string"`
 
543
 
 
544
        // KeyValue: A key value.
 
545
        KeyValue *Key `json:"keyValue,omitempty"`
 
546
 
 
547
        // ListValue: A list value. Cannot contain another list value. Cannot
 
548
        // also have a meaning and indexing set.
 
549
        ListValue []*Value `json:"listValue,omitempty"`
 
550
 
 
551
        // Meaning: The meaning field is reserved and should not be used.
 
552
        Meaning int64 `json:"meaning,omitempty"`
 
553
 
 
554
        // StringValue: A UTF-8 encoded string value.
 
555
        StringValue string `json:"stringValue,omitempty"`
 
556
}
 
557
 
 
558
// method id "datastore.datasets.allocateIds":
 
559
 
 
560
type DatasetsAllocateIdsCall struct {
 
561
        s                  *Service
 
562
        datasetId          string
 
563
        allocateidsrequest *AllocateIdsRequest
 
564
        opt_               map[string]interface{}
 
565
}
 
566
 
 
567
// AllocateIds: Allocate IDs for incomplete keys (useful for referencing
 
568
// an entity before it is inserted).
 
569
func (r *DatasetsService) AllocateIds(datasetId string, allocateidsrequest *AllocateIdsRequest) *DatasetsAllocateIdsCall {
 
570
        c := &DatasetsAllocateIdsCall{s: r.s, opt_: make(map[string]interface{})}
 
571
        c.datasetId = datasetId
 
572
        c.allocateidsrequest = allocateidsrequest
 
573
        return c
 
574
}
 
575
 
 
576
// Fields allows partial responses to be retrieved.
 
577
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
578
// for more information.
 
579
func (c *DatasetsAllocateIdsCall) Fields(s ...googleapi.Field) *DatasetsAllocateIdsCall {
 
580
        c.opt_["fields"] = googleapi.CombineFields(s)
 
581
        return c
 
582
}
 
583
 
 
584
func (c *DatasetsAllocateIdsCall) Do() (*AllocateIdsResponse, error) {
 
585
        var body io.Reader = nil
 
586
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.allocateidsrequest)
 
587
        if err != nil {
 
588
                return nil, err
 
589
        }
 
590
        ctype := "application/json"
 
591
        params := make(url.Values)
 
592
        params.Set("alt", "json")
 
593
        if v, ok := c.opt_["fields"]; ok {
 
594
                params.Set("fields", fmt.Sprintf("%v", v))
 
595
        }
 
596
        urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/allocateIds")
 
597
        urls += "?" + params.Encode()
 
598
        req, _ := http.NewRequest("POST", urls, body)
 
599
        googleapi.Expand(req.URL, map[string]string{
 
600
                "datasetId": c.datasetId,
 
601
        })
 
602
        req.Header.Set("Content-Type", ctype)
 
603
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
604
        res, err := c.s.client.Do(req)
 
605
        if err != nil {
 
606
                return nil, err
 
607
        }
 
608
        defer googleapi.CloseBody(res)
 
609
        if err := googleapi.CheckResponse(res); err != nil {
 
610
                return nil, err
 
611
        }
 
612
        var ret *AllocateIdsResponse
 
613
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
614
                return nil, err
 
615
        }
 
616
        return ret, nil
 
617
        // {
 
618
        //   "description": "Allocate IDs for incomplete keys (useful for referencing an entity before it is inserted).",
 
619
        //   "httpMethod": "POST",
 
620
        //   "id": "datastore.datasets.allocateIds",
 
621
        //   "parameterOrder": [
 
622
        //     "datasetId"
 
623
        //   ],
 
624
        //   "parameters": {
 
625
        //     "datasetId": {
 
626
        //       "description": "Identifies the dataset.",
 
627
        //       "location": "path",
 
628
        //       "required": true,
 
629
        //       "type": "string"
 
630
        //     }
 
631
        //   },
 
632
        //   "path": "{datasetId}/allocateIds",
 
633
        //   "request": {
 
634
        //     "$ref": "AllocateIdsRequest"
 
635
        //   },
 
636
        //   "response": {
 
637
        //     "$ref": "AllocateIdsResponse"
 
638
        //   },
 
639
        //   "scopes": [
 
640
        //     "https://www.googleapis.com/auth/cloud-platform",
 
641
        //     "https://www.googleapis.com/auth/datastore",
 
642
        //     "https://www.googleapis.com/auth/userinfo.email"
 
643
        //   ]
 
644
        // }
 
645
 
 
646
}
 
647
 
 
648
// method id "datastore.datasets.beginTransaction":
 
649
 
 
650
type DatasetsBeginTransactionCall struct {
 
651
        s                       *Service
 
652
        datasetId               string
 
653
        begintransactionrequest *BeginTransactionRequest
 
654
        opt_                    map[string]interface{}
 
655
}
 
656
 
 
657
// BeginTransaction: Begin a new transaction.
 
658
func (r *DatasetsService) BeginTransaction(datasetId string, begintransactionrequest *BeginTransactionRequest) *DatasetsBeginTransactionCall {
 
659
        c := &DatasetsBeginTransactionCall{s: r.s, opt_: make(map[string]interface{})}
 
660
        c.datasetId = datasetId
 
661
        c.begintransactionrequest = begintransactionrequest
 
662
        return c
 
663
}
 
664
 
 
665
// Fields allows partial responses to be retrieved.
 
666
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
667
// for more information.
 
668
func (c *DatasetsBeginTransactionCall) Fields(s ...googleapi.Field) *DatasetsBeginTransactionCall {
 
669
        c.opt_["fields"] = googleapi.CombineFields(s)
 
670
        return c
 
671
}
 
672
 
 
673
func (c *DatasetsBeginTransactionCall) Do() (*BeginTransactionResponse, error) {
 
674
        var body io.Reader = nil
 
675
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.begintransactionrequest)
 
676
        if err != nil {
 
677
                return nil, err
 
678
        }
 
679
        ctype := "application/json"
 
680
        params := make(url.Values)
 
681
        params.Set("alt", "json")
 
682
        if v, ok := c.opt_["fields"]; ok {
 
683
                params.Set("fields", fmt.Sprintf("%v", v))
 
684
        }
 
685
        urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/beginTransaction")
 
686
        urls += "?" + params.Encode()
 
687
        req, _ := http.NewRequest("POST", urls, body)
 
688
        googleapi.Expand(req.URL, map[string]string{
 
689
                "datasetId": c.datasetId,
 
690
        })
 
691
        req.Header.Set("Content-Type", ctype)
 
692
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
693
        res, err := c.s.client.Do(req)
 
694
        if err != nil {
 
695
                return nil, err
 
696
        }
 
697
        defer googleapi.CloseBody(res)
 
698
        if err := googleapi.CheckResponse(res); err != nil {
 
699
                return nil, err
 
700
        }
 
701
        var ret *BeginTransactionResponse
 
702
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
703
                return nil, err
 
704
        }
 
705
        return ret, nil
 
706
        // {
 
707
        //   "description": "Begin a new transaction.",
 
708
        //   "httpMethod": "POST",
 
709
        //   "id": "datastore.datasets.beginTransaction",
 
710
        //   "parameterOrder": [
 
711
        //     "datasetId"
 
712
        //   ],
 
713
        //   "parameters": {
 
714
        //     "datasetId": {
 
715
        //       "description": "Identifies the dataset.",
 
716
        //       "location": "path",
 
717
        //       "required": true,
 
718
        //       "type": "string"
 
719
        //     }
 
720
        //   },
 
721
        //   "path": "{datasetId}/beginTransaction",
 
722
        //   "request": {
 
723
        //     "$ref": "BeginTransactionRequest"
 
724
        //   },
 
725
        //   "response": {
 
726
        //     "$ref": "BeginTransactionResponse"
 
727
        //   },
 
728
        //   "scopes": [
 
729
        //     "https://www.googleapis.com/auth/cloud-platform",
 
730
        //     "https://www.googleapis.com/auth/datastore",
 
731
        //     "https://www.googleapis.com/auth/userinfo.email"
 
732
        //   ]
 
733
        // }
 
734
 
 
735
}
 
736
 
 
737
// method id "datastore.datasets.commit":
 
738
 
 
739
type DatasetsCommitCall struct {
 
740
        s             *Service
 
741
        datasetId     string
 
742
        commitrequest *CommitRequest
 
743
        opt_          map[string]interface{}
 
744
}
 
745
 
 
746
// Commit: Commit a transaction, optionally creating, deleting or
 
747
// modifying some entities.
 
748
func (r *DatasetsService) Commit(datasetId string, commitrequest *CommitRequest) *DatasetsCommitCall {
 
749
        c := &DatasetsCommitCall{s: r.s, opt_: make(map[string]interface{})}
 
750
        c.datasetId = datasetId
 
751
        c.commitrequest = commitrequest
 
752
        return c
 
753
}
 
754
 
 
755
// Fields allows partial responses to be retrieved.
 
756
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
757
// for more information.
 
758
func (c *DatasetsCommitCall) Fields(s ...googleapi.Field) *DatasetsCommitCall {
 
759
        c.opt_["fields"] = googleapi.CombineFields(s)
 
760
        return c
 
761
}
 
762
 
 
763
func (c *DatasetsCommitCall) Do() (*CommitResponse, error) {
 
764
        var body io.Reader = nil
 
765
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitrequest)
 
766
        if err != nil {
 
767
                return nil, err
 
768
        }
 
769
        ctype := "application/json"
 
770
        params := make(url.Values)
 
771
        params.Set("alt", "json")
 
772
        if v, ok := c.opt_["fields"]; ok {
 
773
                params.Set("fields", fmt.Sprintf("%v", v))
 
774
        }
 
775
        urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/commit")
 
776
        urls += "?" + params.Encode()
 
777
        req, _ := http.NewRequest("POST", urls, body)
 
778
        googleapi.Expand(req.URL, map[string]string{
 
779
                "datasetId": c.datasetId,
 
780
        })
 
781
        req.Header.Set("Content-Type", ctype)
 
782
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
783
        res, err := c.s.client.Do(req)
 
784
        if err != nil {
 
785
                return nil, err
 
786
        }
 
787
        defer googleapi.CloseBody(res)
 
788
        if err := googleapi.CheckResponse(res); err != nil {
 
789
                return nil, err
 
790
        }
 
791
        var ret *CommitResponse
 
792
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
793
                return nil, err
 
794
        }
 
795
        return ret, nil
 
796
        // {
 
797
        //   "description": "Commit a transaction, optionally creating, deleting or modifying some entities.",
 
798
        //   "httpMethod": "POST",
 
799
        //   "id": "datastore.datasets.commit",
 
800
        //   "parameterOrder": [
 
801
        //     "datasetId"
 
802
        //   ],
 
803
        //   "parameters": {
 
804
        //     "datasetId": {
 
805
        //       "description": "Identifies the dataset.",
 
806
        //       "location": "path",
 
807
        //       "required": true,
 
808
        //       "type": "string"
 
809
        //     }
 
810
        //   },
 
811
        //   "path": "{datasetId}/commit",
 
812
        //   "request": {
 
813
        //     "$ref": "CommitRequest"
 
814
        //   },
 
815
        //   "response": {
 
816
        //     "$ref": "CommitResponse"
 
817
        //   },
 
818
        //   "scopes": [
 
819
        //     "https://www.googleapis.com/auth/cloud-platform",
 
820
        //     "https://www.googleapis.com/auth/datastore",
 
821
        //     "https://www.googleapis.com/auth/userinfo.email"
 
822
        //   ]
 
823
        // }
 
824
 
 
825
}
 
826
 
 
827
// method id "datastore.datasets.lookup":
 
828
 
 
829
type DatasetsLookupCall struct {
 
830
        s             *Service
 
831
        datasetId     string
 
832
        lookuprequest *LookupRequest
 
833
        opt_          map[string]interface{}
 
834
}
 
835
 
 
836
// Lookup: Look up some entities by key.
 
837
func (r *DatasetsService) Lookup(datasetId string, lookuprequest *LookupRequest) *DatasetsLookupCall {
 
838
        c := &DatasetsLookupCall{s: r.s, opt_: make(map[string]interface{})}
 
839
        c.datasetId = datasetId
 
840
        c.lookuprequest = lookuprequest
 
841
        return c
 
842
}
 
843
 
 
844
// Fields allows partial responses to be retrieved.
 
845
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
846
// for more information.
 
847
func (c *DatasetsLookupCall) Fields(s ...googleapi.Field) *DatasetsLookupCall {
 
848
        c.opt_["fields"] = googleapi.CombineFields(s)
 
849
        return c
 
850
}
 
851
 
 
852
func (c *DatasetsLookupCall) Do() (*LookupResponse, error) {
 
853
        var body io.Reader = nil
 
854
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.lookuprequest)
 
855
        if err != nil {
 
856
                return nil, err
 
857
        }
 
858
        ctype := "application/json"
 
859
        params := make(url.Values)
 
860
        params.Set("alt", "json")
 
861
        if v, ok := c.opt_["fields"]; ok {
 
862
                params.Set("fields", fmt.Sprintf("%v", v))
 
863
        }
 
864
        urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/lookup")
 
865
        urls += "?" + params.Encode()
 
866
        req, _ := http.NewRequest("POST", urls, body)
 
867
        googleapi.Expand(req.URL, map[string]string{
 
868
                "datasetId": c.datasetId,
 
869
        })
 
870
        req.Header.Set("Content-Type", ctype)
 
871
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
872
        res, err := c.s.client.Do(req)
 
873
        if err != nil {
 
874
                return nil, err
 
875
        }
 
876
        defer googleapi.CloseBody(res)
 
877
        if err := googleapi.CheckResponse(res); err != nil {
 
878
                return nil, err
 
879
        }
 
880
        var ret *LookupResponse
 
881
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
882
                return nil, err
 
883
        }
 
884
        return ret, nil
 
885
        // {
 
886
        //   "description": "Look up some entities by key.",
 
887
        //   "httpMethod": "POST",
 
888
        //   "id": "datastore.datasets.lookup",
 
889
        //   "parameterOrder": [
 
890
        //     "datasetId"
 
891
        //   ],
 
892
        //   "parameters": {
 
893
        //     "datasetId": {
 
894
        //       "description": "Identifies the dataset.",
 
895
        //       "location": "path",
 
896
        //       "required": true,
 
897
        //       "type": "string"
 
898
        //     }
 
899
        //   },
 
900
        //   "path": "{datasetId}/lookup",
 
901
        //   "request": {
 
902
        //     "$ref": "LookupRequest"
 
903
        //   },
 
904
        //   "response": {
 
905
        //     "$ref": "LookupResponse"
 
906
        //   },
 
907
        //   "scopes": [
 
908
        //     "https://www.googleapis.com/auth/cloud-platform",
 
909
        //     "https://www.googleapis.com/auth/datastore",
 
910
        //     "https://www.googleapis.com/auth/userinfo.email"
 
911
        //   ]
 
912
        // }
 
913
 
 
914
}
 
915
 
 
916
// method id "datastore.datasets.rollback":
 
917
 
 
918
type DatasetsRollbackCall struct {
 
919
        s               *Service
 
920
        datasetId       string
 
921
        rollbackrequest *RollbackRequest
 
922
        opt_            map[string]interface{}
 
923
}
 
924
 
 
925
// Rollback: Roll back a transaction.
 
926
func (r *DatasetsService) Rollback(datasetId string, rollbackrequest *RollbackRequest) *DatasetsRollbackCall {
 
927
        c := &DatasetsRollbackCall{s: r.s, opt_: make(map[string]interface{})}
 
928
        c.datasetId = datasetId
 
929
        c.rollbackrequest = rollbackrequest
 
930
        return c
 
931
}
 
932
 
 
933
// Fields allows partial responses to be retrieved.
 
934
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
935
// for more information.
 
936
func (c *DatasetsRollbackCall) Fields(s ...googleapi.Field) *DatasetsRollbackCall {
 
937
        c.opt_["fields"] = googleapi.CombineFields(s)
 
938
        return c
 
939
}
 
940
 
 
941
func (c *DatasetsRollbackCall) Do() (*RollbackResponse, error) {
 
942
        var body io.Reader = nil
 
943
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackrequest)
 
944
        if err != nil {
 
945
                return nil, err
 
946
        }
 
947
        ctype := "application/json"
 
948
        params := make(url.Values)
 
949
        params.Set("alt", "json")
 
950
        if v, ok := c.opt_["fields"]; ok {
 
951
                params.Set("fields", fmt.Sprintf("%v", v))
 
952
        }
 
953
        urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/rollback")
 
954
        urls += "?" + params.Encode()
 
955
        req, _ := http.NewRequest("POST", urls, body)
 
956
        googleapi.Expand(req.URL, map[string]string{
 
957
                "datasetId": c.datasetId,
 
958
        })
 
959
        req.Header.Set("Content-Type", ctype)
 
960
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
961
        res, err := c.s.client.Do(req)
 
962
        if err != nil {
 
963
                return nil, err
 
964
        }
 
965
        defer googleapi.CloseBody(res)
 
966
        if err := googleapi.CheckResponse(res); err != nil {
 
967
                return nil, err
 
968
        }
 
969
        var ret *RollbackResponse
 
970
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
971
                return nil, err
 
972
        }
 
973
        return ret, nil
 
974
        // {
 
975
        //   "description": "Roll back a transaction.",
 
976
        //   "httpMethod": "POST",
 
977
        //   "id": "datastore.datasets.rollback",
 
978
        //   "parameterOrder": [
 
979
        //     "datasetId"
 
980
        //   ],
 
981
        //   "parameters": {
 
982
        //     "datasetId": {
 
983
        //       "description": "Identifies the dataset.",
 
984
        //       "location": "path",
 
985
        //       "required": true,
 
986
        //       "type": "string"
 
987
        //     }
 
988
        //   },
 
989
        //   "path": "{datasetId}/rollback",
 
990
        //   "request": {
 
991
        //     "$ref": "RollbackRequest"
 
992
        //   },
 
993
        //   "response": {
 
994
        //     "$ref": "RollbackResponse"
 
995
        //   },
 
996
        //   "scopes": [
 
997
        //     "https://www.googleapis.com/auth/cloud-platform",
 
998
        //     "https://www.googleapis.com/auth/datastore",
 
999
        //     "https://www.googleapis.com/auth/userinfo.email"
 
1000
        //   ]
 
1001
        // }
 
1002
 
 
1003
}
 
1004
 
 
1005
// method id "datastore.datasets.runQuery":
 
1006
 
 
1007
type DatasetsRunQueryCall struct {
 
1008
        s               *Service
 
1009
        datasetId       string
 
1010
        runqueryrequest *RunQueryRequest
 
1011
        opt_            map[string]interface{}
 
1012
}
 
1013
 
 
1014
// RunQuery: Query for entities.
 
1015
func (r *DatasetsService) RunQuery(datasetId string, runqueryrequest *RunQueryRequest) *DatasetsRunQueryCall {
 
1016
        c := &DatasetsRunQueryCall{s: r.s, opt_: make(map[string]interface{})}
 
1017
        c.datasetId = datasetId
 
1018
        c.runqueryrequest = runqueryrequest
 
1019
        return c
 
1020
}
 
1021
 
 
1022
// Fields allows partial responses to be retrieved.
 
1023
// See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
 
1024
// for more information.
 
1025
func (c *DatasetsRunQueryCall) Fields(s ...googleapi.Field) *DatasetsRunQueryCall {
 
1026
        c.opt_["fields"] = googleapi.CombineFields(s)
 
1027
        return c
 
1028
}
 
1029
 
 
1030
func (c *DatasetsRunQueryCall) Do() (*RunQueryResponse, error) {
 
1031
        var body io.Reader = nil
 
1032
        body, err := googleapi.WithoutDataWrapper.JSONReader(c.runqueryrequest)
 
1033
        if err != nil {
 
1034
                return nil, err
 
1035
        }
 
1036
        ctype := "application/json"
 
1037
        params := make(url.Values)
 
1038
        params.Set("alt", "json")
 
1039
        if v, ok := c.opt_["fields"]; ok {
 
1040
                params.Set("fields", fmt.Sprintf("%v", v))
 
1041
        }
 
1042
        urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/runQuery")
 
1043
        urls += "?" + params.Encode()
 
1044
        req, _ := http.NewRequest("POST", urls, body)
 
1045
        googleapi.Expand(req.URL, map[string]string{
 
1046
                "datasetId": c.datasetId,
 
1047
        })
 
1048
        req.Header.Set("Content-Type", ctype)
 
1049
        req.Header.Set("User-Agent", "google-api-go-client/0.5")
 
1050
        res, err := c.s.client.Do(req)
 
1051
        if err != nil {
 
1052
                return nil, err
 
1053
        }
 
1054
        defer googleapi.CloseBody(res)
 
1055
        if err := googleapi.CheckResponse(res); err != nil {
 
1056
                return nil, err
 
1057
        }
 
1058
        var ret *RunQueryResponse
 
1059
        if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
 
1060
                return nil, err
 
1061
        }
 
1062
        return ret, nil
 
1063
        // {
 
1064
        //   "description": "Query for entities.",
 
1065
        //   "httpMethod": "POST",
 
1066
        //   "id": "datastore.datasets.runQuery",
 
1067
        //   "parameterOrder": [
 
1068
        //     "datasetId"
 
1069
        //   ],
 
1070
        //   "parameters": {
 
1071
        //     "datasetId": {
 
1072
        //       "description": "Identifies the dataset.",
 
1073
        //       "location": "path",
 
1074
        //       "required": true,
 
1075
        //       "type": "string"
 
1076
        //     }
 
1077
        //   },
 
1078
        //   "path": "{datasetId}/runQuery",
 
1079
        //   "request": {
 
1080
        //     "$ref": "RunQueryRequest"
 
1081
        //   },
 
1082
        //   "response": {
 
1083
        //     "$ref": "RunQueryResponse"
 
1084
        //   },
 
1085
        //   "scopes": [
 
1086
        //     "https://www.googleapis.com/auth/cloud-platform",
 
1087
        //     "https://www.googleapis.com/auth/datastore",
 
1088
        //     "https://www.googleapis.com/auth/userinfo.email"
 
1089
        //   ]
 
1090
        // }
 
1091
 
 
1092
}