You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

3239 rivejä
121 KiB

  1. // Package datastore provides access to the Cloud Datastore API.
  2. //
  3. // See https://cloud.google.com/datastore/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/datastore/v1beta3"
  8. // ...
  9. // datastoreService, err := datastore.New(oauthHttpClient)
  10. package datastore // import "google.golang.org/api/datastore/v1beta3"
  11. import (
  12. "bytes"
  13. "encoding/json"
  14. "errors"
  15. "fmt"
  16. context "golang.org/x/net/context"
  17. ctxhttp "golang.org/x/net/context/ctxhttp"
  18. gensupport "google.golang.org/api/gensupport"
  19. googleapi "google.golang.org/api/googleapi"
  20. "io"
  21. "net/http"
  22. "net/url"
  23. "strconv"
  24. "strings"
  25. )
  26. // Always reference these packages, just in case the auto-generated code
  27. // below doesn't.
  28. var _ = bytes.NewBuffer
  29. var _ = strconv.Itoa
  30. var _ = fmt.Sprintf
  31. var _ = json.NewDecoder
  32. var _ = io.Copy
  33. var _ = url.Parse
  34. var _ = gensupport.MarshalJSON
  35. var _ = googleapi.Version
  36. var _ = errors.New
  37. var _ = strings.Replace
  38. var _ = context.Canceled
  39. var _ = ctxhttp.Do
  40. const apiId = "datastore:v1beta3"
  41. const apiName = "datastore"
  42. const apiVersion = "v1beta3"
  43. const basePath = "https://datastore.googleapis.com/"
  44. // OAuth2 scopes used by this API.
  45. const (
  46. // View and manage your data across Google Cloud Platform services
  47. CloudPlatformScope = "https://www.googleapis.com/auth/cloud-platform"
  48. // View and manage your Google Cloud Datastore data
  49. DatastoreScope = "https://www.googleapis.com/auth/datastore"
  50. )
  51. func New(client *http.Client) (*Service, error) {
  52. if client == nil {
  53. return nil, errors.New("client is nil")
  54. }
  55. s := &Service{client: client, BasePath: basePath}
  56. s.Projects = NewProjectsService(s)
  57. return s, nil
  58. }
  59. type Service struct {
  60. client *http.Client
  61. BasePath string // API endpoint base URL
  62. UserAgent string // optional additional User-Agent fragment
  63. Projects *ProjectsService
  64. }
  65. func (s *Service) userAgent() string {
  66. if s.UserAgent == "" {
  67. return googleapi.UserAgent
  68. }
  69. return googleapi.UserAgent + " " + s.UserAgent
  70. }
  71. func NewProjectsService(s *Service) *ProjectsService {
  72. rs := &ProjectsService{s: s}
  73. return rs
  74. }
  75. type ProjectsService struct {
  76. s *Service
  77. }
  78. // AllocateIdsRequest: The request for Datastore.AllocateIds.
  79. type AllocateIdsRequest struct {
  80. // Keys: A list of keys with incomplete key paths for which to allocate
  81. // IDs.
  82. // No key may be reserved/read-only.
  83. Keys []*Key `json:"keys,omitempty"`
  84. // ForceSendFields is a list of field names (e.g. "Keys") to
  85. // unconditionally include in API requests. By default, fields with
  86. // empty values are omitted from API requests. However, any non-pointer,
  87. // non-interface field appearing in ForceSendFields will be sent to the
  88. // server regardless of whether the field is empty or not. This may be
  89. // used to include empty fields in Patch requests.
  90. ForceSendFields []string `json:"-"`
  91. // NullFields is a list of field names (e.g. "Keys") to include in API
  92. // requests with the JSON null value. By default, fields with empty
  93. // values are omitted from API requests. However, any field with an
  94. // empty value appearing in NullFields will be sent to the server as
  95. // null. It is an error if a field in this list has a non-empty value.
  96. // This may be used to include null fields in Patch requests.
  97. NullFields []string `json:"-"`
  98. }
  99. func (s *AllocateIdsRequest) MarshalJSON() ([]byte, error) {
  100. type NoMethod AllocateIdsRequest
  101. raw := NoMethod(*s)
  102. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  103. }
  104. // AllocateIdsResponse: The response for Datastore.AllocateIds.
  105. type AllocateIdsResponse struct {
  106. // Keys: The keys specified in the request (in the same order), each
  107. // with
  108. // its key path completed with a newly allocated ID.
  109. Keys []*Key `json:"keys,omitempty"`
  110. // ServerResponse contains the HTTP response code and headers from the
  111. // server.
  112. googleapi.ServerResponse `json:"-"`
  113. // ForceSendFields is a list of field names (e.g. "Keys") to
  114. // unconditionally include in API requests. By default, fields with
  115. // empty values are omitted from API requests. However, any non-pointer,
  116. // non-interface field appearing in ForceSendFields will be sent to the
  117. // server regardless of whether the field is empty or not. This may be
  118. // used to include empty fields in Patch requests.
  119. ForceSendFields []string `json:"-"`
  120. // NullFields is a list of field names (e.g. "Keys") to include in API
  121. // requests with the JSON null value. By default, fields with empty
  122. // values are omitted from API requests. However, any field with an
  123. // empty value appearing in NullFields will be sent to the server as
  124. // null. It is an error if a field in this list has a non-empty value.
  125. // This may be used to include null fields in Patch requests.
  126. NullFields []string `json:"-"`
  127. }
  128. func (s *AllocateIdsResponse) MarshalJSON() ([]byte, error) {
  129. type NoMethod AllocateIdsResponse
  130. raw := NoMethod(*s)
  131. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  132. }
  133. // ArrayValue: An array value.
  134. type ArrayValue struct {
  135. // Values: Values in the array.
  136. // The order of this array may not be preserved if it contains a mix
  137. // of
  138. // indexed and unindexed values.
  139. Values []*Value `json:"values,omitempty"`
  140. // ForceSendFields is a list of field names (e.g. "Values") to
  141. // unconditionally include in API requests. By default, fields with
  142. // empty values are omitted from API requests. However, any non-pointer,
  143. // non-interface field appearing in ForceSendFields will be sent to the
  144. // server regardless of whether the field is empty or not. This may be
  145. // used to include empty fields in Patch requests.
  146. ForceSendFields []string `json:"-"`
  147. // NullFields is a list of field names (e.g. "Values") to include in API
  148. // requests with the JSON null value. By default, fields with empty
  149. // values are omitted from API requests. However, any field with an
  150. // empty value appearing in NullFields will be sent to the server as
  151. // null. It is an error if a field in this list has a non-empty value.
  152. // This may be used to include null fields in Patch requests.
  153. NullFields []string `json:"-"`
  154. }
  155. func (s *ArrayValue) MarshalJSON() ([]byte, error) {
  156. type NoMethod ArrayValue
  157. raw := NoMethod(*s)
  158. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  159. }
  160. // BeginTransactionRequest: The request for Datastore.BeginTransaction.
  161. type BeginTransactionRequest struct {
  162. // TransactionOptions: Options for a new transaction.
  163. TransactionOptions *TransactionOptions `json:"transactionOptions,omitempty"`
  164. // ForceSendFields is a list of field names (e.g. "TransactionOptions")
  165. // to unconditionally include in API requests. By default, fields with
  166. // empty values are omitted from API requests. However, any non-pointer,
  167. // non-interface field appearing in ForceSendFields will be sent to the
  168. // server regardless of whether the field is empty or not. This may be
  169. // used to include empty fields in Patch requests.
  170. ForceSendFields []string `json:"-"`
  171. // NullFields is a list of field names (e.g. "TransactionOptions") to
  172. // include in API requests with the JSON null value. By default, fields
  173. // with empty values are omitted from API requests. However, any field
  174. // with an empty value appearing in NullFields will be sent to the
  175. // server as null. It is an error if a field in this list has a
  176. // non-empty value. This may be used to include null fields in Patch
  177. // requests.
  178. NullFields []string `json:"-"`
  179. }
  180. func (s *BeginTransactionRequest) MarshalJSON() ([]byte, error) {
  181. type NoMethod BeginTransactionRequest
  182. raw := NoMethod(*s)
  183. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  184. }
  185. // BeginTransactionResponse: The response for
  186. // Datastore.BeginTransaction.
  187. type BeginTransactionResponse struct {
  188. // Transaction: The transaction identifier (always present).
  189. Transaction string `json:"transaction,omitempty"`
  190. // ServerResponse contains the HTTP response code and headers from the
  191. // server.
  192. googleapi.ServerResponse `json:"-"`
  193. // ForceSendFields is a list of field names (e.g. "Transaction") to
  194. // unconditionally include in API requests. By default, fields with
  195. // empty values are omitted from API requests. However, any non-pointer,
  196. // non-interface field appearing in ForceSendFields will be sent to the
  197. // server regardless of whether the field is empty or not. This may be
  198. // used to include empty fields in Patch requests.
  199. ForceSendFields []string `json:"-"`
  200. // NullFields is a list of field names (e.g. "Transaction") to include
  201. // in API requests with the JSON null value. By default, fields with
  202. // empty values are omitted from API requests. However, any field with
  203. // an empty value appearing in NullFields will be sent to the server as
  204. // null. It is an error if a field in this list has a non-empty value.
  205. // This may be used to include null fields in Patch requests.
  206. NullFields []string `json:"-"`
  207. }
  208. func (s *BeginTransactionResponse) MarshalJSON() ([]byte, error) {
  209. type NoMethod BeginTransactionResponse
  210. raw := NoMethod(*s)
  211. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  212. }
  213. // CommitRequest: The request for Datastore.Commit.
  214. type CommitRequest struct {
  215. // Mode: The type of commit to perform. Defaults to `TRANSACTIONAL`.
  216. //
  217. // Possible values:
  218. // "MODE_UNSPECIFIED" - Unspecified. This value must not be used.
  219. // "TRANSACTIONAL" - Transactional: The mutations are either all
  220. // applied, or none are applied.
  221. // Learn about transactions
  222. // [here](https://cloud.google.com/datastore/docs/concepts/transactions).
  223. // "NON_TRANSACTIONAL" - Non-transactional: The mutations may not
  224. // apply as all or none.
  225. Mode string `json:"mode,omitempty"`
  226. // Mutations: The mutations to perform.
  227. //
  228. // When mode is `TRANSACTIONAL`, mutations affecting a single entity
  229. // are
  230. // applied in order. The following sequences of mutations affecting a
  231. // single
  232. // entity are not permitted in a single `Commit` request:
  233. //
  234. // - `insert` followed by `insert`
  235. // - `update` followed by `insert`
  236. // - `upsert` followed by `insert`
  237. // - `delete` followed by `update`
  238. //
  239. // When mode is `NON_TRANSACTIONAL`, no two mutations may affect a
  240. // single
  241. // entity.
  242. Mutations []*Mutation `json:"mutations,omitempty"`
  243. // Transaction: The identifier of the transaction associated with the
  244. // commit. A
  245. // transaction identifier is returned by a call
  246. // to
  247. // Datastore.BeginTransaction.
  248. Transaction string `json:"transaction,omitempty"`
  249. // ForceSendFields is a list of field names (e.g. "Mode") to
  250. // unconditionally include in API requests. By default, fields with
  251. // empty values are omitted from API requests. However, any non-pointer,
  252. // non-interface field appearing in ForceSendFields will be sent to the
  253. // server regardless of whether the field is empty or not. This may be
  254. // used to include empty fields in Patch requests.
  255. ForceSendFields []string `json:"-"`
  256. // NullFields is a list of field names (e.g. "Mode") to include in API
  257. // requests with the JSON null value. By default, fields with empty
  258. // values are omitted from API requests. However, any field with an
  259. // empty value appearing in NullFields will be sent to the server as
  260. // null. It is an error if a field in this list has a non-empty value.
  261. // This may be used to include null fields in Patch requests.
  262. NullFields []string `json:"-"`
  263. }
  264. func (s *CommitRequest) MarshalJSON() ([]byte, error) {
  265. type NoMethod CommitRequest
  266. raw := NoMethod(*s)
  267. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  268. }
  269. // CommitResponse: The response for Datastore.Commit.
  270. type CommitResponse struct {
  271. // IndexUpdates: The number of index entries updated during the commit,
  272. // or zero if none were
  273. // updated.
  274. IndexUpdates int64 `json:"indexUpdates,omitempty"`
  275. // MutationResults: The result of performing the mutations.
  276. // The i-th mutation result corresponds to the i-th mutation in the
  277. // request.
  278. MutationResults []*MutationResult `json:"mutationResults,omitempty"`
  279. // ServerResponse contains the HTTP response code and headers from the
  280. // server.
  281. googleapi.ServerResponse `json:"-"`
  282. // ForceSendFields is a list of field names (e.g. "IndexUpdates") to
  283. // unconditionally include in API requests. By default, fields with
  284. // empty values are omitted from API requests. However, any non-pointer,
  285. // non-interface field appearing in ForceSendFields will be sent to the
  286. // server regardless of whether the field is empty or not. This may be
  287. // used to include empty fields in Patch requests.
  288. ForceSendFields []string `json:"-"`
  289. // NullFields is a list of field names (e.g. "IndexUpdates") to include
  290. // in API requests with the JSON null value. By default, fields with
  291. // empty values are omitted from API requests. However, any field with
  292. // an empty value appearing in NullFields will be sent to the server as
  293. // null. It is an error if a field in this list has a non-empty value.
  294. // This may be used to include null fields in Patch requests.
  295. NullFields []string `json:"-"`
  296. }
  297. func (s *CommitResponse) MarshalJSON() ([]byte, error) {
  298. type NoMethod CommitResponse
  299. raw := NoMethod(*s)
  300. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  301. }
  302. // CompositeFilter: A filter that merges multiple other filters using
  303. // the given operator.
  304. type CompositeFilter struct {
  305. // Filters: The list of filters to combine.
  306. // Must contain at least one filter.
  307. Filters []*Filter `json:"filters,omitempty"`
  308. // Op: The operator for combining multiple filters.
  309. //
  310. // Possible values:
  311. // "OPERATOR_UNSPECIFIED" - Unspecified. This value must not be used.
  312. // "AND" - The results are required to satisfy each of the combined
  313. // filters.
  314. Op string `json:"op,omitempty"`
  315. // ForceSendFields is a list of field names (e.g. "Filters") to
  316. // unconditionally include in API requests. By default, fields with
  317. // empty values are omitted from API requests. However, any non-pointer,
  318. // non-interface field appearing in ForceSendFields will be sent to the
  319. // server regardless of whether the field is empty or not. This may be
  320. // used to include empty fields in Patch requests.
  321. ForceSendFields []string `json:"-"`
  322. // NullFields is a list of field names (e.g. "Filters") to include in
  323. // API requests with the JSON null value. By default, fields with empty
  324. // values are omitted from API requests. However, any field with an
  325. // empty value appearing in NullFields will be sent to the server as
  326. // null. It is an error if a field in this list has a non-empty value.
  327. // This may be used to include null fields in Patch requests.
  328. NullFields []string `json:"-"`
  329. }
  330. func (s *CompositeFilter) MarshalJSON() ([]byte, error) {
  331. type NoMethod CompositeFilter
  332. raw := NoMethod(*s)
  333. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  334. }
  335. // Entity: A Datastore data object.
  336. //
  337. // An entity is limited to 1 megabyte when stored. That
  338. // _roughly_
  339. // corresponds to a limit of 1 megabyte for the serialized form of
  340. // this
  341. // message.
  342. type Entity struct {
  343. // Key: The entity's key.
  344. //
  345. // An entity must have a key, unless otherwise documented (for
  346. // example,
  347. // an entity in `Value.entity_value` may have no key).
  348. // An entity's kind is its key path's last element's kind,
  349. // or null if it has no key.
  350. Key *Key `json:"key,omitempty"`
  351. // Properties: The entity's properties.
  352. // The map's keys are property names.
  353. // A property name matching regex `__.*__` is reserved.
  354. // A reserved property name is forbidden in certain documented
  355. // contexts.
  356. // The name must not contain more than 500 characters.
  357. // The name cannot be "".
  358. Properties map[string]Value `json:"properties,omitempty"`
  359. // ForceSendFields is a list of field names (e.g. "Key") to
  360. // unconditionally include in API requests. By default, fields with
  361. // empty values are omitted from API requests. However, any non-pointer,
  362. // non-interface field appearing in ForceSendFields will be sent to the
  363. // server regardless of whether the field is empty or not. This may be
  364. // used to include empty fields in Patch requests.
  365. ForceSendFields []string `json:"-"`
  366. // NullFields is a list of field names (e.g. "Key") to include in API
  367. // requests with the JSON null value. By default, fields with empty
  368. // values are omitted from API requests. However, any field with an
  369. // empty value appearing in NullFields will be sent to the server as
  370. // null. It is an error if a field in this list has a non-empty value.
  371. // This may be used to include null fields in Patch requests.
  372. NullFields []string `json:"-"`
  373. }
  374. func (s *Entity) MarshalJSON() ([]byte, error) {
  375. type NoMethod Entity
  376. raw := NoMethod(*s)
  377. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  378. }
  379. // EntityResult: The result of fetching an entity from Datastore.
  380. type EntityResult struct {
  381. // Cursor: A cursor that points to the position after the result
  382. // entity.
  383. // Set only when the `EntityResult` is part of a `QueryResultBatch`
  384. // message.
  385. Cursor string `json:"cursor,omitempty"`
  386. // Entity: The resulting entity.
  387. Entity *Entity `json:"entity,omitempty"`
  388. // Version: The version of the entity, a strictly positive number that
  389. // monotonically
  390. // increases with changes to the entity.
  391. //
  392. // This field is set for `FULL` entity
  393. // results.
  394. //
  395. // For missing entities in `LookupResponse`, this
  396. // is the version of the snapshot that was used to look up the entity,
  397. // and it
  398. // is always set except for eventually consistent reads.
  399. Version int64 `json:"version,omitempty,string"`
  400. // ForceSendFields is a list of field names (e.g. "Cursor") to
  401. // unconditionally include in API requests. By default, fields with
  402. // empty values are omitted from API requests. However, any non-pointer,
  403. // non-interface field appearing in ForceSendFields will be sent to the
  404. // server regardless of whether the field is empty or not. This may be
  405. // used to include empty fields in Patch requests.
  406. ForceSendFields []string `json:"-"`
  407. // NullFields is a list of field names (e.g. "Cursor") to include in API
  408. // requests with the JSON null value. By default, fields with empty
  409. // values are omitted from API requests. However, any field with an
  410. // empty value appearing in NullFields will be sent to the server as
  411. // null. It is an error if a field in this list has a non-empty value.
  412. // This may be used to include null fields in Patch requests.
  413. NullFields []string `json:"-"`
  414. }
  415. func (s *EntityResult) MarshalJSON() ([]byte, error) {
  416. type NoMethod EntityResult
  417. raw := NoMethod(*s)
  418. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  419. }
  420. // Filter: A holder for any type of filter.
  421. type Filter struct {
  422. // CompositeFilter: A composite filter.
  423. CompositeFilter *CompositeFilter `json:"compositeFilter,omitempty"`
  424. // PropertyFilter: A filter on a property.
  425. PropertyFilter *PropertyFilter `json:"propertyFilter,omitempty"`
  426. // ForceSendFields is a list of field names (e.g. "CompositeFilter") to
  427. // unconditionally include in API requests. By default, fields with
  428. // empty values are omitted from API requests. However, any non-pointer,
  429. // non-interface field appearing in ForceSendFields will be sent to the
  430. // server regardless of whether the field is empty or not. This may be
  431. // used to include empty fields in Patch requests.
  432. ForceSendFields []string `json:"-"`
  433. // NullFields is a list of field names (e.g. "CompositeFilter") to
  434. // include in API requests with the JSON null value. By default, fields
  435. // with empty values are omitted from API requests. However, any field
  436. // with an empty value appearing in NullFields will be sent to the
  437. // server as null. It is an error if a field in this list has a
  438. // non-empty value. This may be used to include null fields in Patch
  439. // requests.
  440. NullFields []string `json:"-"`
  441. }
  442. func (s *Filter) MarshalJSON() ([]byte, error) {
  443. type NoMethod Filter
  444. raw := NoMethod(*s)
  445. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  446. }
  447. // GoogleDatastoreAdminV1CommonMetadata: Metadata common to all
  448. // Datastore Admin operations.
  449. type GoogleDatastoreAdminV1CommonMetadata struct {
  450. // EndTime: The time the operation ended, either successfully or
  451. // otherwise.
  452. EndTime string `json:"endTime,omitempty"`
  453. // Labels: The client-assigned labels which were provided when the
  454. // operation was
  455. // created. May also include additional labels.
  456. Labels map[string]string `json:"labels,omitempty"`
  457. // OperationType: The type of the operation. Can be used as a filter
  458. // in
  459. // ListOperationsRequest.
  460. //
  461. // Possible values:
  462. // "OPERATION_TYPE_UNSPECIFIED" - Unspecified.
  463. // "EXPORT_ENTITIES" - ExportEntities.
  464. // "IMPORT_ENTITIES" - ImportEntities.
  465. OperationType string `json:"operationType,omitempty"`
  466. // StartTime: The time that work began on the operation.
  467. StartTime string `json:"startTime,omitempty"`
  468. // State: The current state of the Operation.
  469. //
  470. // Possible values:
  471. // "STATE_UNSPECIFIED" - Unspecified.
  472. // "INITIALIZING" - Request is being prepared for processing.
  473. // "PROCESSING" - Request is actively being processed.
  474. // "CANCELLING" - Request is in the process of being cancelled after
  475. // user called
  476. // google.longrunning.Operations.CancelOperation on the operation.
  477. // "FINALIZING" - Request has been processed and is in its
  478. // finalization stage.
  479. // "SUCCESSFUL" - Request has completed successfully.
  480. // "FAILED" - Request has finished being processed, but encountered an
  481. // error.
  482. // "CANCELLED" - Request has finished being cancelled after user
  483. // called
  484. // google.longrunning.Operations.CancelOperation.
  485. State string `json:"state,omitempty"`
  486. // ForceSendFields is a list of field names (e.g. "EndTime") to
  487. // unconditionally include in API requests. By default, fields with
  488. // empty values are omitted from API requests. However, any non-pointer,
  489. // non-interface field appearing in ForceSendFields will be sent to the
  490. // server regardless of whether the field is empty or not. This may be
  491. // used to include empty fields in Patch requests.
  492. ForceSendFields []string `json:"-"`
  493. // NullFields is a list of field names (e.g. "EndTime") to include in
  494. // API requests with the JSON null value. By default, fields with empty
  495. // values are omitted from API requests. However, any field with an
  496. // empty value appearing in NullFields will be sent to the server as
  497. // null. It is an error if a field in this list has a non-empty value.
  498. // This may be used to include null fields in Patch requests.
  499. NullFields []string `json:"-"`
  500. }
  501. func (s *GoogleDatastoreAdminV1CommonMetadata) MarshalJSON() ([]byte, error) {
  502. type NoMethod GoogleDatastoreAdminV1CommonMetadata
  503. raw := NoMethod(*s)
  504. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  505. }
  506. // GoogleDatastoreAdminV1EntityFilter: Identifies a subset of entities
  507. // in a project. This is specified as
  508. // combinations of kinds and namespaces (either or both of which may be
  509. // all, as
  510. // described in the following examples).
  511. // Example usage:
  512. //
  513. // Entire project:
  514. // kinds=[], namespace_ids=[]
  515. //
  516. // Kinds Foo and Bar in all namespaces:
  517. // kinds=['Foo', 'Bar'], namespace_ids=[]
  518. //
  519. // Kinds Foo and Bar only in the default namespace:
  520. // kinds=['Foo', 'Bar'], namespace_ids=['']
  521. //
  522. // Kinds Foo and Bar in both the default and Baz namespaces:
  523. // kinds=['Foo', 'Bar'], namespace_ids=['', 'Baz']
  524. //
  525. // The entire Baz namespace:
  526. // kinds=[], namespace_ids=['Baz']
  527. type GoogleDatastoreAdminV1EntityFilter struct {
  528. // Kinds: If empty, then this represents all kinds.
  529. Kinds []string `json:"kinds,omitempty"`
  530. // NamespaceIds: An empty list represents all namespaces. This is the
  531. // preferred
  532. // usage for projects that don't use namespaces.
  533. //
  534. // An empty string element represents the default namespace. This should
  535. // be
  536. // used if the project has data in non-default namespaces, but doesn't
  537. // want to
  538. // include them.
  539. // Each namespace in this list must be unique.
  540. NamespaceIds []string `json:"namespaceIds,omitempty"`
  541. // ForceSendFields is a list of field names (e.g. "Kinds") to
  542. // unconditionally include in API requests. By default, fields with
  543. // empty values are omitted from API requests. However, any non-pointer,
  544. // non-interface field appearing in ForceSendFields will be sent to the
  545. // server regardless of whether the field is empty or not. This may be
  546. // used to include empty fields in Patch requests.
  547. ForceSendFields []string `json:"-"`
  548. // NullFields is a list of field names (e.g. "Kinds") to include in API
  549. // requests with the JSON null value. By default, fields with empty
  550. // values are omitted from API requests. However, any field with an
  551. // empty value appearing in NullFields will be sent to the server as
  552. // null. It is an error if a field in this list has a non-empty value.
  553. // This may be used to include null fields in Patch requests.
  554. NullFields []string `json:"-"`
  555. }
  556. func (s *GoogleDatastoreAdminV1EntityFilter) MarshalJSON() ([]byte, error) {
  557. type NoMethod GoogleDatastoreAdminV1EntityFilter
  558. raw := NoMethod(*s)
  559. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  560. }
  561. // GoogleDatastoreAdminV1ExportEntitiesMetadata: Metadata for
  562. // ExportEntities operations.
  563. type GoogleDatastoreAdminV1ExportEntitiesMetadata struct {
  564. // Common: Metadata common to all Datastore Admin operations.
  565. Common *GoogleDatastoreAdminV1CommonMetadata `json:"common,omitempty"`
  566. // EntityFilter: Description of which entities are being exported.
  567. EntityFilter *GoogleDatastoreAdminV1EntityFilter `json:"entityFilter,omitempty"`
  568. // OutputUrlPrefix: Location for the export metadata and data files.
  569. // This will be the same
  570. // value as
  571. // the
  572. // google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix
  573. //
  574. // field. The final output location is provided
  575. // in
  576. // google.datastore.admin.v1.ExportEntitiesResponse.output_url.
  577. OutputUrlPrefix string `json:"outputUrlPrefix,omitempty"`
  578. // ProgressBytes: An estimate of the number of bytes processed.
  579. ProgressBytes *GoogleDatastoreAdminV1Progress `json:"progressBytes,omitempty"`
  580. // ProgressEntities: An estimate of the number of entities processed.
  581. ProgressEntities *GoogleDatastoreAdminV1Progress `json:"progressEntities,omitempty"`
  582. // ForceSendFields is a list of field names (e.g. "Common") to
  583. // unconditionally include in API requests. By default, fields with
  584. // empty values are omitted from API requests. However, any non-pointer,
  585. // non-interface field appearing in ForceSendFields will be sent to the
  586. // server regardless of whether the field is empty or not. This may be
  587. // used to include empty fields in Patch requests.
  588. ForceSendFields []string `json:"-"`
  589. // NullFields is a list of field names (e.g. "Common") to include in API
  590. // requests with the JSON null value. By default, fields with empty
  591. // values are omitted from API requests. However, any field with an
  592. // empty value appearing in NullFields will be sent to the server as
  593. // null. It is an error if a field in this list has a non-empty value.
  594. // This may be used to include null fields in Patch requests.
  595. NullFields []string `json:"-"`
  596. }
  597. func (s *GoogleDatastoreAdminV1ExportEntitiesMetadata) MarshalJSON() ([]byte, error) {
  598. type NoMethod GoogleDatastoreAdminV1ExportEntitiesMetadata
  599. raw := NoMethod(*s)
  600. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  601. }
  602. // GoogleDatastoreAdminV1ExportEntitiesResponse: The response
  603. // for
  604. // google.datastore.admin.v1.DatastoreAdmin.ExportEntities.
  605. type GoogleDatastoreAdminV1ExportEntitiesResponse struct {
  606. // OutputUrl: Location of the output metadata file. This can be used to
  607. // begin an import
  608. // into Cloud Datastore (this project or another project).
  609. // See
  610. // google.datastore.admin.v1.ImportEntitiesRequest.input_url.
  611. // Only present if the operation completed successfully.
  612. OutputUrl string `json:"outputUrl,omitempty"`
  613. // ForceSendFields is a list of field names (e.g. "OutputUrl") to
  614. // unconditionally include in API requests. By default, fields with
  615. // empty values are omitted from API requests. However, any non-pointer,
  616. // non-interface field appearing in ForceSendFields will be sent to the
  617. // server regardless of whether the field is empty or not. This may be
  618. // used to include empty fields in Patch requests.
  619. ForceSendFields []string `json:"-"`
  620. // NullFields is a list of field names (e.g. "OutputUrl") to include in
  621. // API requests with the JSON null value. By default, fields with empty
  622. // values are omitted from API requests. However, any field with an
  623. // empty value appearing in NullFields will be sent to the server as
  624. // null. It is an error if a field in this list has a non-empty value.
  625. // This may be used to include null fields in Patch requests.
  626. NullFields []string `json:"-"`
  627. }
  628. func (s *GoogleDatastoreAdminV1ExportEntitiesResponse) MarshalJSON() ([]byte, error) {
  629. type NoMethod GoogleDatastoreAdminV1ExportEntitiesResponse
  630. raw := NoMethod(*s)
  631. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  632. }
  633. // GoogleDatastoreAdminV1ImportEntitiesMetadata: Metadata for
  634. // ImportEntities operations.
  635. type GoogleDatastoreAdminV1ImportEntitiesMetadata struct {
  636. // Common: Metadata common to all Datastore Admin operations.
  637. Common *GoogleDatastoreAdminV1CommonMetadata `json:"common,omitempty"`
  638. // EntityFilter: Description of which entities are being imported.
  639. EntityFilter *GoogleDatastoreAdminV1EntityFilter `json:"entityFilter,omitempty"`
  640. // InputUrl: The location of the import metadata file. This will be the
  641. // same value as
  642. // the google.datastore.admin.v1.ExportEntitiesResponse.output_url
  643. // field.
  644. InputUrl string `json:"inputUrl,omitempty"`
  645. // ProgressBytes: An estimate of the number of bytes processed.
  646. ProgressBytes *GoogleDatastoreAdminV1Progress `json:"progressBytes,omitempty"`
  647. // ProgressEntities: An estimate of the number of entities processed.
  648. ProgressEntities *GoogleDatastoreAdminV1Progress `json:"progressEntities,omitempty"`
  649. // ForceSendFields is a list of field names (e.g. "Common") to
  650. // unconditionally include in API requests. By default, fields with
  651. // empty values are omitted from API requests. However, any non-pointer,
  652. // non-interface field appearing in ForceSendFields will be sent to the
  653. // server regardless of whether the field is empty or not. This may be
  654. // used to include empty fields in Patch requests.
  655. ForceSendFields []string `json:"-"`
  656. // NullFields is a list of field names (e.g. "Common") to include in API
  657. // requests with the JSON null value. By default, fields with empty
  658. // values are omitted from API requests. However, any field with an
  659. // empty value appearing in NullFields will be sent to the server as
  660. // null. It is an error if a field in this list has a non-empty value.
  661. // This may be used to include null fields in Patch requests.
  662. NullFields []string `json:"-"`
  663. }
  664. func (s *GoogleDatastoreAdminV1ImportEntitiesMetadata) MarshalJSON() ([]byte, error) {
  665. type NoMethod GoogleDatastoreAdminV1ImportEntitiesMetadata
  666. raw := NoMethod(*s)
  667. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  668. }
  669. // GoogleDatastoreAdminV1Progress: Measures the progress of a particular
  670. // metric.
  671. type GoogleDatastoreAdminV1Progress struct {
  672. // WorkCompleted: The amount of work that has been completed. Note that
  673. // this may be greater
  674. // than work_estimated.
  675. WorkCompleted int64 `json:"workCompleted,omitempty,string"`
  676. // WorkEstimated: An estimate of how much work needs to be performed.
  677. // May be zero if the
  678. // work estimate is unavailable.
  679. WorkEstimated int64 `json:"workEstimated,omitempty,string"`
  680. // ForceSendFields is a list of field names (e.g. "WorkCompleted") to
  681. // unconditionally include in API requests. By default, fields with
  682. // empty values are omitted from API requests. However, any non-pointer,
  683. // non-interface field appearing in ForceSendFields will be sent to the
  684. // server regardless of whether the field is empty or not. This may be
  685. // used to include empty fields in Patch requests.
  686. ForceSendFields []string `json:"-"`
  687. // NullFields is a list of field names (e.g. "WorkCompleted") to include
  688. // in API requests with the JSON null value. By default, fields with
  689. // empty values are omitted from API requests. However, any field with
  690. // an empty value appearing in NullFields will be sent to the server as
  691. // null. It is an error if a field in this list has a non-empty value.
  692. // This may be used to include null fields in Patch requests.
  693. NullFields []string `json:"-"`
  694. }
  695. func (s *GoogleDatastoreAdminV1Progress) MarshalJSON() ([]byte, error) {
  696. type NoMethod GoogleDatastoreAdminV1Progress
  697. raw := NoMethod(*s)
  698. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  699. }
  700. // GoogleDatastoreAdminV1beta1CommonMetadata: Metadata common to all
  701. // Datastore Admin operations.
  702. type GoogleDatastoreAdminV1beta1CommonMetadata struct {
  703. // EndTime: The time the operation ended, either successfully or
  704. // otherwise.
  705. EndTime string `json:"endTime,omitempty"`
  706. // Labels: The client-assigned labels which were provided when the
  707. // operation was
  708. // created. May also include additional labels.
  709. Labels map[string]string `json:"labels,omitempty"`
  710. // OperationType: The type of the operation. Can be used as a filter
  711. // in
  712. // ListOperationsRequest.
  713. //
  714. // Possible values:
  715. // "OPERATION_TYPE_UNSPECIFIED" - Unspecified.
  716. // "EXPORT_ENTITIES" - ExportEntities.
  717. // "IMPORT_ENTITIES" - ImportEntities.
  718. OperationType string `json:"operationType,omitempty"`
  719. // StartTime: The time that work began on the operation.
  720. StartTime string `json:"startTime,omitempty"`
  721. // State: The current state of the Operation.
  722. //
  723. // Possible values:
  724. // "STATE_UNSPECIFIED" - Unspecified.
  725. // "INITIALIZING" - Request is being prepared for processing.
  726. // "PROCESSING" - Request is actively being processed.
  727. // "CANCELLING" - Request is in the process of being cancelled after
  728. // user called
  729. // google.longrunning.Operations.CancelOperation on the operation.
  730. // "FINALIZING" - Request has been processed and is in its
  731. // finalization stage.
  732. // "SUCCESSFUL" - Request has completed successfully.
  733. // "FAILED" - Request has finished being processed, but encountered an
  734. // error.
  735. // "CANCELLED" - Request has finished being cancelled after user
  736. // called
  737. // google.longrunning.Operations.CancelOperation.
  738. State string `json:"state,omitempty"`
  739. // ForceSendFields is a list of field names (e.g. "EndTime") to
  740. // unconditionally include in API requests. By default, fields with
  741. // empty values are omitted from API requests. However, any non-pointer,
  742. // non-interface field appearing in ForceSendFields will be sent to the
  743. // server regardless of whether the field is empty or not. This may be
  744. // used to include empty fields in Patch requests.
  745. ForceSendFields []string `json:"-"`
  746. // NullFields is a list of field names (e.g. "EndTime") to include in
  747. // API requests with the JSON null value. By default, fields with empty
  748. // values are omitted from API requests. However, any field with an
  749. // empty value appearing in NullFields will be sent to the server as
  750. // null. It is an error if a field in this list has a non-empty value.
  751. // This may be used to include null fields in Patch requests.
  752. NullFields []string `json:"-"`
  753. }
  754. func (s *GoogleDatastoreAdminV1beta1CommonMetadata) MarshalJSON() ([]byte, error) {
  755. type NoMethod GoogleDatastoreAdminV1beta1CommonMetadata
  756. raw := NoMethod(*s)
  757. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  758. }
  759. // GoogleDatastoreAdminV1beta1EntityFilter: Identifies a subset of
  760. // entities in a project. This is specified as
  761. // combinations of kinds and namespaces (either or both of which may be
  762. // all, as
  763. // described in the following examples).
  764. // Example usage:
  765. //
  766. // Entire project:
  767. // kinds=[], namespace_ids=[]
  768. //
  769. // Kinds Foo and Bar in all namespaces:
  770. // kinds=['Foo', 'Bar'], namespace_ids=[]
  771. //
  772. // Kinds Foo and Bar only in the default namespace:
  773. // kinds=['Foo', 'Bar'], namespace_ids=['']
  774. //
  775. // Kinds Foo and Bar in both the default and Baz namespaces:
  776. // kinds=['Foo', 'Bar'], namespace_ids=['', 'Baz']
  777. //
  778. // The entire Baz namespace:
  779. // kinds=[], namespace_ids=['Baz']
  780. type GoogleDatastoreAdminV1beta1EntityFilter struct {
  781. // Kinds: If empty, then this represents all kinds.
  782. Kinds []string `json:"kinds,omitempty"`
  783. // NamespaceIds: An empty list represents all namespaces. This is the
  784. // preferred
  785. // usage for projects that don't use namespaces.
  786. //
  787. // An empty string element represents the default namespace. This should
  788. // be
  789. // used if the project has data in non-default namespaces, but doesn't
  790. // want to
  791. // include them.
  792. // Each namespace in this list must be unique.
  793. NamespaceIds []string `json:"namespaceIds,omitempty"`
  794. // ForceSendFields is a list of field names (e.g. "Kinds") to
  795. // unconditionally include in API requests. By default, fields with
  796. // empty values are omitted from API requests. However, any non-pointer,
  797. // non-interface field appearing in ForceSendFields will be sent to the
  798. // server regardless of whether the field is empty or not. This may be
  799. // used to include empty fields in Patch requests.
  800. ForceSendFields []string `json:"-"`
  801. // NullFields is a list of field names (e.g. "Kinds") to include in API
  802. // requests with the JSON null value. By default, fields with empty
  803. // values are omitted from API requests. However, any field with an
  804. // empty value appearing in NullFields will be sent to the server as
  805. // null. It is an error if a field in this list has a non-empty value.
  806. // This may be used to include null fields in Patch requests.
  807. NullFields []string `json:"-"`
  808. }
  809. func (s *GoogleDatastoreAdminV1beta1EntityFilter) MarshalJSON() ([]byte, error) {
  810. type NoMethod GoogleDatastoreAdminV1beta1EntityFilter
  811. raw := NoMethod(*s)
  812. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  813. }
  814. // GoogleDatastoreAdminV1beta1ExportEntitiesMetadata: Metadata for
  815. // ExportEntities operations.
  816. type GoogleDatastoreAdminV1beta1ExportEntitiesMetadata struct {
  817. // Common: Metadata common to all Datastore Admin operations.
  818. Common *GoogleDatastoreAdminV1beta1CommonMetadata `json:"common,omitempty"`
  819. // EntityFilter: Description of which entities are being exported.
  820. EntityFilter *GoogleDatastoreAdminV1beta1EntityFilter `json:"entityFilter,omitempty"`
  821. // OutputUrlPrefix: Location for the export metadata and data files.
  822. // This will be the same
  823. // value as
  824. // the
  825. // google.datastore.admin.v1beta1.ExportEntitiesRequest.output_url_pr
  826. // efix
  827. // field. The final output location is provided
  828. // in
  829. // google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url.
  830. OutputUrlPrefix string `json:"outputUrlPrefix,omitempty"`
  831. // ProgressBytes: An estimate of the number of bytes processed.
  832. ProgressBytes *GoogleDatastoreAdminV1beta1Progress `json:"progressBytes,omitempty"`
  833. // ProgressEntities: An estimate of the number of entities processed.
  834. ProgressEntities *GoogleDatastoreAdminV1beta1Progress `json:"progressEntities,omitempty"`
  835. // ForceSendFields is a list of field names (e.g. "Common") to
  836. // unconditionally include in API requests. By default, fields with
  837. // empty values are omitted from API requests. However, any non-pointer,
  838. // non-interface field appearing in ForceSendFields will be sent to the
  839. // server regardless of whether the field is empty or not. This may be
  840. // used to include empty fields in Patch requests.
  841. ForceSendFields []string `json:"-"`
  842. // NullFields is a list of field names (e.g. "Common") to include in API
  843. // requests with the JSON null value. By default, fields with empty
  844. // values are omitted from API requests. However, any field with an
  845. // empty value appearing in NullFields will be sent to the server as
  846. // null. It is an error if a field in this list has a non-empty value.
  847. // This may be used to include null fields in Patch requests.
  848. NullFields []string `json:"-"`
  849. }
  850. func (s *GoogleDatastoreAdminV1beta1ExportEntitiesMetadata) MarshalJSON() ([]byte, error) {
  851. type NoMethod GoogleDatastoreAdminV1beta1ExportEntitiesMetadata
  852. raw := NoMethod(*s)
  853. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  854. }
  855. // GoogleDatastoreAdminV1beta1ExportEntitiesResponse: The response
  856. // for
  857. // google.datastore.admin.v1beta1.DatastoreAdmin.ExportEntities.
  858. type GoogleDatastoreAdminV1beta1ExportEntitiesResponse struct {
  859. // OutputUrl: Location of the output metadata file. This can be used to
  860. // begin an import
  861. // into Cloud Datastore (this project or another project).
  862. // See
  863. // google.datastore.admin.v1beta1.ImportEntitiesRequest.input_url.
  864. // On
  865. // ly present if the operation completed successfully.
  866. OutputUrl string `json:"outputUrl,omitempty"`
  867. // ForceSendFields is a list of field names (e.g. "OutputUrl") to
  868. // unconditionally include in API requests. By default, fields with
  869. // empty values are omitted from API requests. However, any non-pointer,
  870. // non-interface field appearing in ForceSendFields will be sent to the
  871. // server regardless of whether the field is empty or not. This may be
  872. // used to include empty fields in Patch requests.
  873. ForceSendFields []string `json:"-"`
  874. // NullFields is a list of field names (e.g. "OutputUrl") to include in
  875. // API requests with the JSON null value. By default, fields with empty
  876. // values are omitted from API requests. However, any field with an
  877. // empty value appearing in NullFields will be sent to the server as
  878. // null. It is an error if a field in this list has a non-empty value.
  879. // This may be used to include null fields in Patch requests.
  880. NullFields []string `json:"-"`
  881. }
  882. func (s *GoogleDatastoreAdminV1beta1ExportEntitiesResponse) MarshalJSON() ([]byte, error) {
  883. type NoMethod GoogleDatastoreAdminV1beta1ExportEntitiesResponse
  884. raw := NoMethod(*s)
  885. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  886. }
  887. // GoogleDatastoreAdminV1beta1ImportEntitiesMetadata: Metadata for
  888. // ImportEntities operations.
  889. type GoogleDatastoreAdminV1beta1ImportEntitiesMetadata struct {
  890. // Common: Metadata common to all Datastore Admin operations.
  891. Common *GoogleDatastoreAdminV1beta1CommonMetadata `json:"common,omitempty"`
  892. // EntityFilter: Description of which entities are being imported.
  893. EntityFilter *GoogleDatastoreAdminV1beta1EntityFilter `json:"entityFilter,omitempty"`
  894. // InputUrl: The location of the import metadata file. This will be the
  895. // same value as
  896. // the
  897. // google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url
  898. // field
  899. // .
  900. InputUrl string `json:"inputUrl,omitempty"`
  901. // ProgressBytes: An estimate of the number of bytes processed.
  902. ProgressBytes *GoogleDatastoreAdminV1beta1Progress `json:"progressBytes,omitempty"`
  903. // ProgressEntities: An estimate of the number of entities processed.
  904. ProgressEntities *GoogleDatastoreAdminV1beta1Progress `json:"progressEntities,omitempty"`
  905. // ForceSendFields is a list of field names (e.g. "Common") to
  906. // unconditionally include in API requests. By default, fields with
  907. // empty values are omitted from API requests. However, any non-pointer,
  908. // non-interface field appearing in ForceSendFields will be sent to the
  909. // server regardless of whether the field is empty or not. This may be
  910. // used to include empty fields in Patch requests.
  911. ForceSendFields []string `json:"-"`
  912. // NullFields is a list of field names (e.g. "Common") to include in API
  913. // requests with the JSON null value. By default, fields with empty
  914. // values are omitted from API requests. However, any field with an
  915. // empty value appearing in NullFields will be sent to the server as
  916. // null. It is an error if a field in this list has a non-empty value.
  917. // This may be used to include null fields in Patch requests.
  918. NullFields []string `json:"-"`
  919. }
  920. func (s *GoogleDatastoreAdminV1beta1ImportEntitiesMetadata) MarshalJSON() ([]byte, error) {
  921. type NoMethod GoogleDatastoreAdminV1beta1ImportEntitiesMetadata
  922. raw := NoMethod(*s)
  923. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  924. }
  925. // GoogleDatastoreAdminV1beta1Progress: Measures the progress of a
  926. // particular metric.
  927. type GoogleDatastoreAdminV1beta1Progress struct {
  928. // WorkCompleted: The amount of work that has been completed. Note that
  929. // this may be greater
  930. // than work_estimated.
  931. WorkCompleted int64 `json:"workCompleted,omitempty,string"`
  932. // WorkEstimated: An estimate of how much work needs to be performed.
  933. // May be zero if the
  934. // work estimate is unavailable.
  935. WorkEstimated int64 `json:"workEstimated,omitempty,string"`
  936. // ForceSendFields is a list of field names (e.g. "WorkCompleted") to
  937. // unconditionally include in API requests. By default, fields with
  938. // empty values are omitted from API requests. However, any non-pointer,
  939. // non-interface field appearing in ForceSendFields will be sent to the
  940. // server regardless of whether the field is empty or not. This may be
  941. // used to include empty fields in Patch requests.
  942. ForceSendFields []string `json:"-"`
  943. // NullFields is a list of field names (e.g. "WorkCompleted") to include
  944. // in API requests with the JSON null value. By default, fields with
  945. // empty values are omitted from API requests. However, any field with
  946. // an empty value appearing in NullFields will be sent to the server as
  947. // null. It is an error if a field in this list has a non-empty value.
  948. // This may be used to include null fields in Patch requests.
  949. NullFields []string `json:"-"`
  950. }
  951. func (s *GoogleDatastoreAdminV1beta1Progress) MarshalJSON() ([]byte, error) {
  952. type NoMethod GoogleDatastoreAdminV1beta1Progress
  953. raw := NoMethod(*s)
  954. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  955. }
  956. // GqlQuery: A [GQL
  957. // query](https://cloud.google.com/datastore/docs/apis/gql/gql_reference)
  958. // .
  959. type GqlQuery struct {
  960. // AllowLiterals: When false, the query string must not contain any
  961. // literals and instead must
  962. // bind all values. For example,
  963. // `SELECT * FROM Kind WHERE a = 'string literal'` is not allowed,
  964. // while
  965. // `SELECT * FROM Kind WHERE a = @value` is.
  966. AllowLiterals bool `json:"allowLiterals,omitempty"`
  967. // NamedBindings: For each non-reserved named binding site in the query
  968. // string, there must be
  969. // a named parameter with that name, but not necessarily the
  970. // inverse.
  971. //
  972. // Key must match regex `A-Za-z_$*`, must not match regex
  973. // `__.*__`, and must not be "".
  974. NamedBindings map[string]GqlQueryParameter `json:"namedBindings,omitempty"`
  975. // PositionalBindings: Numbered binding site @1 references the first
  976. // numbered parameter,
  977. // effectively using 1-based indexing, rather than the usual 0.
  978. //
  979. // For each binding site numbered i in `query_string`, there must be an
  980. // i-th
  981. // numbered parameter. The inverse must also be true.
  982. PositionalBindings []*GqlQueryParameter `json:"positionalBindings,omitempty"`
  983. // QueryString: A string of the format
  984. // described
  985. // [here](https://cloud.google.com/datastore/docs/apis/gql/gql_
  986. // reference).
  987. QueryString string `json:"queryString,omitempty"`
  988. // ForceSendFields is a list of field names (e.g. "AllowLiterals") to
  989. // unconditionally include in API requests. By default, fields with
  990. // empty values are omitted from API requests. However, any non-pointer,
  991. // non-interface field appearing in ForceSendFields will be sent to the
  992. // server regardless of whether the field is empty or not. This may be
  993. // used to include empty fields in Patch requests.
  994. ForceSendFields []string `json:"-"`
  995. // NullFields is a list of field names (e.g. "AllowLiterals") to include
  996. // in API requests with the JSON null value. By default, fields with
  997. // empty values are omitted from API requests. However, any field with
  998. // an empty value appearing in NullFields will be sent to the server as
  999. // null. It is an error if a field in this list has a non-empty value.
  1000. // This may be used to include null fields in Patch requests.
  1001. NullFields []string `json:"-"`
  1002. }
  1003. func (s *GqlQuery) MarshalJSON() ([]byte, error) {
  1004. type NoMethod GqlQuery
  1005. raw := NoMethod(*s)
  1006. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1007. }
  1008. // GqlQueryParameter: A binding parameter for a GQL query.
  1009. type GqlQueryParameter struct {
  1010. // Cursor: A query cursor. Query cursors are returned in query
  1011. // result batches.
  1012. Cursor string `json:"cursor,omitempty"`
  1013. // Value: A value parameter.
  1014. Value *Value `json:"value,omitempty"`
  1015. // ForceSendFields is a list of field names (e.g. "Cursor") to
  1016. // unconditionally include in API requests. By default, fields with
  1017. // empty values are omitted from API requests. However, any non-pointer,
  1018. // non-interface field appearing in ForceSendFields will be sent to the
  1019. // server regardless of whether the field is empty or not. This may be
  1020. // used to include empty fields in Patch requests.
  1021. ForceSendFields []string `json:"-"`
  1022. // NullFields is a list of field names (e.g. "Cursor") to include in API
  1023. // requests with the JSON null value. By default, fields with empty
  1024. // values are omitted from API requests. However, any field with an
  1025. // empty value appearing in NullFields will be sent to the server as
  1026. // null. It is an error if a field in this list has a non-empty value.
  1027. // This may be used to include null fields in Patch requests.
  1028. NullFields []string `json:"-"`
  1029. }
  1030. func (s *GqlQueryParameter) MarshalJSON() ([]byte, error) {
  1031. type NoMethod GqlQueryParameter
  1032. raw := NoMethod(*s)
  1033. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1034. }
  1035. // Key: A unique identifier for an entity.
  1036. // If a key's partition ID or any of its path kinds or names
  1037. // are
  1038. // reserved/read-only, the key is reserved/read-only.
  1039. // A reserved/read-only key is forbidden in certain documented contexts.
  1040. type Key struct {
  1041. // PartitionId: Entities are partitioned into subsets, currently
  1042. // identified by a project
  1043. // ID and namespace ID.
  1044. // Queries are scoped to a single partition.
  1045. PartitionId *PartitionId `json:"partitionId,omitempty"`
  1046. // Path: The entity path.
  1047. // An entity path consists of one or more elements composed of a kind
  1048. // and a
  1049. // string or numerical identifier, which identify entities. The
  1050. // first
  1051. // element identifies a _root entity_, the second element identifies
  1052. // a _child_ of the root entity, the third element identifies a child of
  1053. // the
  1054. // second entity, and so forth. The entities identified by all prefixes
  1055. // of
  1056. // the path are called the element's _ancestors_.
  1057. //
  1058. // An entity path is always fully complete: *all* of the entity's
  1059. // ancestors
  1060. // are required to be in the path along with the entity identifier
  1061. // itself.
  1062. // The only exception is that in some documented cases, the identifier
  1063. // in the
  1064. // last path element (for the entity) itself may be omitted. For
  1065. // example,
  1066. // the last path element of the key of `Mutation.insert` may have
  1067. // no
  1068. // identifier.
  1069. //
  1070. // A path can never be empty, and a path can have at most 100 elements.
  1071. Path []*PathElement `json:"path,omitempty"`
  1072. // ForceSendFields is a list of field names (e.g. "PartitionId") to
  1073. // unconditionally include in API requests. By default, fields with
  1074. // empty values are omitted from API requests. However, any non-pointer,
  1075. // non-interface field appearing in ForceSendFields will be sent to the
  1076. // server regardless of whether the field is empty or not. This may be
  1077. // used to include empty fields in Patch requests.
  1078. ForceSendFields []string `json:"-"`
  1079. // NullFields is a list of field names (e.g. "PartitionId") to include
  1080. // in API requests with the JSON null value. By default, fields with
  1081. // empty values are omitted from API requests. However, any field with
  1082. // an empty value appearing in NullFields will be sent to the server as
  1083. // null. It is an error if a field in this list has a non-empty value.
  1084. // This may be used to include null fields in Patch requests.
  1085. NullFields []string `json:"-"`
  1086. }
  1087. func (s *Key) MarshalJSON() ([]byte, error) {
  1088. type NoMethod Key
  1089. raw := NoMethod(*s)
  1090. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1091. }
  1092. // KindExpression: A representation of a kind.
  1093. type KindExpression struct {
  1094. // Name: The name of the kind.
  1095. Name string `json:"name,omitempty"`
  1096. // ForceSendFields is a list of field names (e.g. "Name") to
  1097. // unconditionally include in API requests. By default, fields with
  1098. // empty values are omitted from API requests. However, any non-pointer,
  1099. // non-interface field appearing in ForceSendFields will be sent to the
  1100. // server regardless of whether the field is empty or not. This may be
  1101. // used to include empty fields in Patch requests.
  1102. ForceSendFields []string `json:"-"`
  1103. // NullFields is a list of field names (e.g. "Name") to include in API
  1104. // requests with the JSON null value. By default, fields with empty
  1105. // values are omitted from API requests. However, any field with an
  1106. // empty value appearing in NullFields will be sent to the server as
  1107. // null. It is an error if a field in this list has a non-empty value.
  1108. // This may be used to include null fields in Patch requests.
  1109. NullFields []string `json:"-"`
  1110. }
  1111. func (s *KindExpression) MarshalJSON() ([]byte, error) {
  1112. type NoMethod KindExpression
  1113. raw := NoMethod(*s)
  1114. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1115. }
  1116. // LatLng: An object representing a latitude/longitude pair. This is
  1117. // expressed as a pair
  1118. // of doubles representing degrees latitude and degrees longitude.
  1119. // Unless
  1120. // specified otherwise, this must conform to the
  1121. // <a
  1122. // href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
  1123. // st
  1124. // andard</a>. Values must be within normalized ranges.
  1125. type LatLng struct {
  1126. // Latitude: The latitude in degrees. It must be in the range [-90.0,
  1127. // +90.0].
  1128. Latitude float64 `json:"latitude,omitempty"`
  1129. // Longitude: The longitude in degrees. It must be in the range [-180.0,
  1130. // +180.0].
  1131. Longitude float64 `json:"longitude,omitempty"`
  1132. // ForceSendFields is a list of field names (e.g. "Latitude") to
  1133. // unconditionally include in API requests. By default, fields with
  1134. // empty values are omitted from API requests. However, any non-pointer,
  1135. // non-interface field appearing in ForceSendFields will be sent to the
  1136. // server regardless of whether the field is empty or not. This may be
  1137. // used to include empty fields in Patch requests.
  1138. ForceSendFields []string `json:"-"`
  1139. // NullFields is a list of field names (e.g. "Latitude") to include in
  1140. // API requests with the JSON null value. By default, fields with empty
  1141. // values are omitted from API requests. However, any field with an
  1142. // empty value appearing in NullFields will be sent to the server as
  1143. // null. It is an error if a field in this list has a non-empty value.
  1144. // This may be used to include null fields in Patch requests.
  1145. NullFields []string `json:"-"`
  1146. }
  1147. func (s *LatLng) MarshalJSON() ([]byte, error) {
  1148. type NoMethod LatLng
  1149. raw := NoMethod(*s)
  1150. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1151. }
  1152. func (s *LatLng) UnmarshalJSON(data []byte) error {
  1153. type NoMethod LatLng
  1154. var s1 struct {
  1155. Latitude gensupport.JSONFloat64 `json:"latitude"`
  1156. Longitude gensupport.JSONFloat64 `json:"longitude"`
  1157. *NoMethod
  1158. }
  1159. s1.NoMethod = (*NoMethod)(s)
  1160. if err := json.Unmarshal(data, &s1); err != nil {
  1161. return err
  1162. }
  1163. s.Latitude = float64(s1.Latitude)
  1164. s.Longitude = float64(s1.Longitude)
  1165. return nil
  1166. }
  1167. // LookupRequest: The request for Datastore.Lookup.
  1168. type LookupRequest struct {
  1169. // Keys: Keys of entities to look up.
  1170. Keys []*Key `json:"keys,omitempty"`
  1171. // ReadOptions: The options for this lookup request.
  1172. ReadOptions *ReadOptions `json:"readOptions,omitempty"`
  1173. // ForceSendFields is a list of field names (e.g. "Keys") to
  1174. // unconditionally include in API requests. By default, fields with
  1175. // empty values are omitted from API requests. However, any non-pointer,
  1176. // non-interface field appearing in ForceSendFields will be sent to the
  1177. // server regardless of whether the field is empty or not. This may be
  1178. // used to include empty fields in Patch requests.
  1179. ForceSendFields []string `json:"-"`
  1180. // NullFields is a list of field names (e.g. "Keys") to include in API
  1181. // requests with the JSON null value. By default, fields with empty
  1182. // values are omitted from API requests. However, any field with an
  1183. // empty value appearing in NullFields will be sent to the server as
  1184. // null. It is an error if a field in this list has a non-empty value.
  1185. // This may be used to include null fields in Patch requests.
  1186. NullFields []string `json:"-"`
  1187. }
  1188. func (s *LookupRequest) MarshalJSON() ([]byte, error) {
  1189. type NoMethod LookupRequest
  1190. raw := NoMethod(*s)
  1191. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1192. }
  1193. // LookupResponse: The response for Datastore.Lookup.
  1194. type LookupResponse struct {
  1195. // Deferred: A list of keys that were not looked up due to resource
  1196. // constraints. The
  1197. // order of results in this field is undefined and has no relation to
  1198. // the
  1199. // order of the keys in the input.
  1200. Deferred []*Key `json:"deferred,omitempty"`
  1201. // Found: Entities found as `ResultType.FULL` entities. The order of
  1202. // results in this
  1203. // field is undefined and has no relation to the order of the keys in
  1204. // the
  1205. // input.
  1206. Found []*EntityResult `json:"found,omitempty"`
  1207. // Missing: Entities not found as `ResultType.KEY_ONLY` entities. The
  1208. // order of results
  1209. // in this field is undefined and has no relation to the order of the
  1210. // keys
  1211. // in the input.
  1212. Missing []*EntityResult `json:"missing,omitempty"`
  1213. // ServerResponse contains the HTTP response code and headers from the
  1214. // server.
  1215. googleapi.ServerResponse `json:"-"`
  1216. // ForceSendFields is a list of field names (e.g. "Deferred") to
  1217. // unconditionally include in API requests. By default, fields with
  1218. // empty values are omitted from API requests. However, any non-pointer,
  1219. // non-interface field appearing in ForceSendFields will be sent to the
  1220. // server regardless of whether the field is empty or not. This may be
  1221. // used to include empty fields in Patch requests.
  1222. ForceSendFields []string `json:"-"`
  1223. // NullFields is a list of field names (e.g. "Deferred") to include in
  1224. // API requests with the JSON null value. By default, fields with empty
  1225. // values are omitted from API requests. However, any field with an
  1226. // empty value appearing in NullFields will be sent to the server as
  1227. // null. It is an error if a field in this list has a non-empty value.
  1228. // This may be used to include null fields in Patch requests.
  1229. NullFields []string `json:"-"`
  1230. }
  1231. func (s *LookupResponse) MarshalJSON() ([]byte, error) {
  1232. type NoMethod LookupResponse
  1233. raw := NoMethod(*s)
  1234. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1235. }
  1236. // Mutation: A mutation to apply to an entity.
  1237. type Mutation struct {
  1238. // BaseVersion: The version of the entity that this mutation is being
  1239. // applied to. If this
  1240. // does not match the current version on the server, the mutation
  1241. // conflicts.
  1242. BaseVersion int64 `json:"baseVersion,omitempty,string"`
  1243. // Delete: The key of the entity to delete. The entity may or may not
  1244. // already exist.
  1245. // Must have a complete key path and must not be reserved/read-only.
  1246. Delete *Key `json:"delete,omitempty"`
  1247. // Insert: The entity to insert. The entity must not already exist.
  1248. // The entity key's final path element may be incomplete.
  1249. Insert *Entity `json:"insert,omitempty"`
  1250. // Update: The entity to update. The entity must already exist.
  1251. // Must have a complete key path.
  1252. Update *Entity `json:"update,omitempty"`
  1253. // Upsert: The entity to upsert. The entity may or may not already
  1254. // exist.
  1255. // The entity key's final path element may be incomplete.
  1256. Upsert *Entity `json:"upsert,omitempty"`
  1257. // ForceSendFields is a list of field names (e.g. "BaseVersion") to
  1258. // unconditionally include in API requests. By default, fields with
  1259. // empty values are omitted from API requests. However, any non-pointer,
  1260. // non-interface field appearing in ForceSendFields will be sent to the
  1261. // server regardless of whether the field is empty or not. This may be
  1262. // used to include empty fields in Patch requests.
  1263. ForceSendFields []string `json:"-"`
  1264. // NullFields is a list of field names (e.g. "BaseVersion") to include
  1265. // in API requests with the JSON null value. By default, fields with
  1266. // empty values are omitted from API requests. However, any field with
  1267. // an empty value appearing in NullFields will be sent to the server as
  1268. // null. It is an error if a field in this list has a non-empty value.
  1269. // This may be used to include null fields in Patch requests.
  1270. NullFields []string `json:"-"`
  1271. }
  1272. func (s *Mutation) MarshalJSON() ([]byte, error) {
  1273. type NoMethod Mutation
  1274. raw := NoMethod(*s)
  1275. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1276. }
  1277. // MutationResult: The result of applying a mutation.
  1278. type MutationResult struct {
  1279. // ConflictDetected: Whether a conflict was detected for this mutation.
  1280. // Always false when a
  1281. // conflict detection strategy field is not set in the mutation.
  1282. ConflictDetected bool `json:"conflictDetected,omitempty"`
  1283. // Key: The automatically allocated key.
  1284. // Set only when the mutation allocated a key.
  1285. Key *Key `json:"key,omitempty"`
  1286. // Version: The version of the entity on the server after processing the
  1287. // mutation. If
  1288. // the mutation doesn't change anything on the server, then the version
  1289. // will
  1290. // be the version of the current entity or, if no entity is present, a
  1291. // version
  1292. // that is strictly greater than the version of any previous entity and
  1293. // less
  1294. // than the version of any possible future entity.
  1295. Version int64 `json:"version,omitempty,string"`
  1296. // ForceSendFields is a list of field names (e.g. "ConflictDetected") to
  1297. // unconditionally include in API requests. By default, fields with
  1298. // empty values are omitted from API requests. However, any non-pointer,
  1299. // non-interface field appearing in ForceSendFields will be sent to the
  1300. // server regardless of whether the field is empty or not. This may be
  1301. // used to include empty fields in Patch requests.
  1302. ForceSendFields []string `json:"-"`
  1303. // NullFields is a list of field names (e.g. "ConflictDetected") to
  1304. // include in API requests with the JSON null value. By default, fields
  1305. // with empty values are omitted from API requests. However, any field
  1306. // with an empty value appearing in NullFields will be sent to the
  1307. // server as null. It is an error if a field in this list has a
  1308. // non-empty value. This may be used to include null fields in Patch
  1309. // requests.
  1310. NullFields []string `json:"-"`
  1311. }
  1312. func (s *MutationResult) MarshalJSON() ([]byte, error) {
  1313. type NoMethod MutationResult
  1314. raw := NoMethod(*s)
  1315. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1316. }
  1317. // PartitionId: A partition ID identifies a grouping of entities. The
  1318. // grouping is always
  1319. // by project and namespace, however the namespace ID may be empty.
  1320. //
  1321. // A partition ID contains several dimensions:
  1322. // project ID and namespace ID.
  1323. //
  1324. // Partition dimensions:
  1325. //
  1326. // - May be "".
  1327. // - Must be valid UTF-8 bytes.
  1328. // - Must have values that match regex `[A-Za-z\d\.\-_]{1,100}`
  1329. // If the value of any dimension matches regex `__.*__`, the partition
  1330. // is
  1331. // reserved/read-only.
  1332. // A reserved/read-only partition ID is forbidden in certain
  1333. // documented
  1334. // contexts.
  1335. //
  1336. // Foreign partition IDs (in which the project ID does
  1337. // not match the context project ID ) are discouraged.
  1338. // Reads and writes of foreign partition IDs may fail if the project is
  1339. // not in an active state.
  1340. type PartitionId struct {
  1341. // NamespaceId: If not empty, the ID of the namespace to which the
  1342. // entities belong.
  1343. NamespaceId string `json:"namespaceId,omitempty"`
  1344. // ProjectId: The ID of the project to which the entities belong.
  1345. ProjectId string `json:"projectId,omitempty"`
  1346. // ForceSendFields is a list of field names (e.g. "NamespaceId") to
  1347. // unconditionally include in API requests. By default, fields with
  1348. // empty values are omitted from API requests. However, any non-pointer,
  1349. // non-interface field appearing in ForceSendFields will be sent to the
  1350. // server regardless of whether the field is empty or not. This may be
  1351. // used to include empty fields in Patch requests.
  1352. ForceSendFields []string `json:"-"`
  1353. // NullFields is a list of field names (e.g. "NamespaceId") to include
  1354. // in API requests with the JSON null value. By default, fields with
  1355. // empty values are omitted from API requests. However, any field with
  1356. // an empty value appearing in NullFields will be sent to the server as
  1357. // null. It is an error if a field in this list has a non-empty value.
  1358. // This may be used to include null fields in Patch requests.
  1359. NullFields []string `json:"-"`
  1360. }
  1361. func (s *PartitionId) MarshalJSON() ([]byte, error) {
  1362. type NoMethod PartitionId
  1363. raw := NoMethod(*s)
  1364. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1365. }
  1366. // PathElement: A (kind, ID/name) pair used to construct a key path.
  1367. //
  1368. // If either name or ID is set, the element is complete.
  1369. // If neither is set, the element is incomplete.
  1370. type PathElement struct {
  1371. // Id: The auto-allocated ID of the entity.
  1372. // Never equal to zero. Values less than zero are discouraged and may
  1373. // not
  1374. // be supported in the future.
  1375. Id int64 `json:"id,omitempty,string"`
  1376. // Kind: The kind of the entity.
  1377. // A kind matching regex `__.*__` is reserved/read-only.
  1378. // A kind must not contain more than 1500 bytes when UTF-8
  1379. // encoded.
  1380. // Cannot be "".
  1381. Kind string `json:"kind,omitempty"`
  1382. // Name: The name of the entity.
  1383. // A name matching regex `__.*__` is reserved/read-only.
  1384. // A name must not be more than 1500 bytes when UTF-8 encoded.
  1385. // Cannot be "".
  1386. Name string `json:"name,omitempty"`
  1387. // ForceSendFields is a list of field names (e.g. "Id") to
  1388. // unconditionally include in API requests. By default, fields with
  1389. // empty values are omitted from API requests. However, any non-pointer,
  1390. // non-interface field appearing in ForceSendFields will be sent to the
  1391. // server regardless of whether the field is empty or not. This may be
  1392. // used to include empty fields in Patch requests.
  1393. ForceSendFields []string `json:"-"`
  1394. // NullFields is a list of field names (e.g. "Id") to include in API
  1395. // requests with the JSON null value. By default, fields with empty
  1396. // values are omitted from API requests. However, any field with an
  1397. // empty value appearing in NullFields will be sent to the server as
  1398. // null. It is an error if a field in this list has a non-empty value.
  1399. // This may be used to include null fields in Patch requests.
  1400. NullFields []string `json:"-"`
  1401. }
  1402. func (s *PathElement) MarshalJSON() ([]byte, error) {
  1403. type NoMethod PathElement
  1404. raw := NoMethod(*s)
  1405. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1406. }
  1407. // Projection: A representation of a property in a projection.
  1408. type Projection struct {
  1409. // Property: The property to project.
  1410. Property *PropertyReference `json:"property,omitempty"`
  1411. // ForceSendFields is a list of field names (e.g. "Property") to
  1412. // unconditionally include in API requests. By default, fields with
  1413. // empty values are omitted from API requests. However, any non-pointer,
  1414. // non-interface field appearing in ForceSendFields will be sent to the
  1415. // server regardless of whether the field is empty or not. This may be
  1416. // used to include empty fields in Patch requests.
  1417. ForceSendFields []string `json:"-"`
  1418. // NullFields is a list of field names (e.g. "Property") to include in
  1419. // API requests with the JSON null value. By default, fields with empty
  1420. // values are omitted from API requests. However, any field with an
  1421. // empty value appearing in NullFields will be sent to the server as
  1422. // null. It is an error if a field in this list has a non-empty value.
  1423. // This may be used to include null fields in Patch requests.
  1424. NullFields []string `json:"-"`
  1425. }
  1426. func (s *Projection) MarshalJSON() ([]byte, error) {
  1427. type NoMethod Projection
  1428. raw := NoMethod(*s)
  1429. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1430. }
  1431. // PropertyFilter: A filter on a specific property.
  1432. type PropertyFilter struct {
  1433. // Op: The operator to filter by.
  1434. //
  1435. // Possible values:
  1436. // "OPERATOR_UNSPECIFIED" - Unspecified. This value must not be used.
  1437. // "LESS_THAN" - Less than.
  1438. // "LESS_THAN_OR_EQUAL" - Less than or equal.
  1439. // "GREATER_THAN" - Greater than.
  1440. // "GREATER_THAN_OR_EQUAL" - Greater than or equal.
  1441. // "EQUAL" - Equal.
  1442. // "HAS_ANCESTOR" - Has ancestor.
  1443. Op string `json:"op,omitempty"`
  1444. // Property: The property to filter by.
  1445. Property *PropertyReference `json:"property,omitempty"`
  1446. // Value: The value to compare the property to.
  1447. Value *Value `json:"value,omitempty"`
  1448. // ForceSendFields is a list of field names (e.g. "Op") to
  1449. // unconditionally include in API requests. By default, fields with
  1450. // empty values are omitted from API requests. However, any non-pointer,
  1451. // non-interface field appearing in ForceSendFields will be sent to the
  1452. // server regardless of whether the field is empty or not. This may be
  1453. // used to include empty fields in Patch requests.
  1454. ForceSendFields []string `json:"-"`
  1455. // NullFields is a list of field names (e.g. "Op") to include in API
  1456. // requests with the JSON null value. By default, fields with empty
  1457. // values are omitted from API requests. However, any field with an
  1458. // empty value appearing in NullFields will be sent to the server as
  1459. // null. It is an error if a field in this list has a non-empty value.
  1460. // This may be used to include null fields in Patch requests.
  1461. NullFields []string `json:"-"`
  1462. }
  1463. func (s *PropertyFilter) MarshalJSON() ([]byte, error) {
  1464. type NoMethod PropertyFilter
  1465. raw := NoMethod(*s)
  1466. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1467. }
  1468. // PropertyOrder: The desired order for a specific property.
  1469. type PropertyOrder struct {
  1470. // Direction: The direction to order by. Defaults to `ASCENDING`.
  1471. //
  1472. // Possible values:
  1473. // "DIRECTION_UNSPECIFIED" - Unspecified. This value must not be used.
  1474. // "ASCENDING" - Ascending.
  1475. // "DESCENDING" - Descending.
  1476. Direction string `json:"direction,omitempty"`
  1477. // Property: The property to order by.
  1478. Property *PropertyReference `json:"property,omitempty"`
  1479. // ForceSendFields is a list of field names (e.g. "Direction") to
  1480. // unconditionally include in API requests. By default, fields with
  1481. // empty values are omitted from API requests. However, any non-pointer,
  1482. // non-interface field appearing in ForceSendFields will be sent to the
  1483. // server regardless of whether the field is empty or not. This may be
  1484. // used to include empty fields in Patch requests.
  1485. ForceSendFields []string `json:"-"`
  1486. // NullFields is a list of field names (e.g. "Direction") to include in
  1487. // API requests with the JSON null value. By default, fields with empty
  1488. // values are omitted from API requests. However, any field with an
  1489. // empty value appearing in NullFields will be sent to the server as
  1490. // null. It is an error if a field in this list has a non-empty value.
  1491. // This may be used to include null fields in Patch requests.
  1492. NullFields []string `json:"-"`
  1493. }
  1494. func (s *PropertyOrder) MarshalJSON() ([]byte, error) {
  1495. type NoMethod PropertyOrder
  1496. raw := NoMethod(*s)
  1497. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1498. }
  1499. // PropertyReference: A reference to a property relative to the kind
  1500. // expressions.
  1501. type PropertyReference struct {
  1502. // Name: The name of the property.
  1503. // If name includes "."s, it may be interpreted as a property name path.
  1504. Name string `json:"name,omitempty"`
  1505. // ForceSendFields is a list of field names (e.g. "Name") to
  1506. // unconditionally include in API requests. By default, fields with
  1507. // empty values are omitted from API requests. However, any non-pointer,
  1508. // non-interface field appearing in ForceSendFields will be sent to the
  1509. // server regardless of whether the field is empty or not. This may be
  1510. // used to include empty fields in Patch requests.
  1511. ForceSendFields []string `json:"-"`
  1512. // NullFields is a list of field names (e.g. "Name") to include in API
  1513. // requests with the JSON null value. By default, fields with empty
  1514. // values are omitted from API requests. However, any field with an
  1515. // empty value appearing in NullFields will be sent to the server as
  1516. // null. It is an error if a field in this list has a non-empty value.
  1517. // This may be used to include null fields in Patch requests.
  1518. NullFields []string `json:"-"`
  1519. }
  1520. func (s *PropertyReference) MarshalJSON() ([]byte, error) {
  1521. type NoMethod PropertyReference
  1522. raw := NoMethod(*s)
  1523. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1524. }
  1525. // Query: A query for entities.
  1526. type Query struct {
  1527. // DistinctOn: The properties to make distinct. The query results will
  1528. // contain the first
  1529. // result for each distinct combination of values for the given
  1530. // properties
  1531. // (if empty, all results are returned).
  1532. DistinctOn []*PropertyReference `json:"distinctOn,omitempty"`
  1533. // EndCursor: An ending point for the query results. Query cursors
  1534. // are
  1535. // returned in query result batches and
  1536. // [can only be used to limit the same
  1537. // query](https://cloud.google.com/datastore/docs/concepts/queries#cursor
  1538. // s_limits_and_offsets).
  1539. EndCursor string `json:"endCursor,omitempty"`
  1540. // Filter: The filter to apply.
  1541. Filter *Filter `json:"filter,omitempty"`
  1542. // Kind: The kinds to query (if empty, returns entities of all
  1543. // kinds).
  1544. // Currently at most 1 kind may be specified.
  1545. Kind []*KindExpression `json:"kind,omitempty"`
  1546. // Limit: The maximum number of results to return. Applies after all
  1547. // other
  1548. // constraints. Optional.
  1549. // Unspecified is interpreted as no limit.
  1550. // Must be >= 0 if specified.
  1551. Limit int64 `json:"limit,omitempty"`
  1552. // Offset: The number of results to skip. Applies before limit, but
  1553. // after all other
  1554. // constraints. Optional. Must be >= 0 if specified.
  1555. Offset int64 `json:"offset,omitempty"`
  1556. // Order: The order to apply to the query results (if empty, order is
  1557. // unspecified).
  1558. Order []*PropertyOrder `json:"order,omitempty"`
  1559. // Projection: The projection to return. Defaults to returning all
  1560. // properties.
  1561. Projection []*Projection `json:"projection,omitempty"`
  1562. // StartCursor: A starting point for the query results. Query cursors
  1563. // are
  1564. // returned in query result batches and
  1565. // [can only be used to continue the same
  1566. // query](https://cloud.google.com/datastore/docs/concepts/queries#cursor
  1567. // s_limits_and_offsets).
  1568. StartCursor string `json:"startCursor,omitempty"`
  1569. // ForceSendFields is a list of field names (e.g. "DistinctOn") to
  1570. // unconditionally include in API requests. By default, fields with
  1571. // empty values are omitted from API requests. However, any non-pointer,
  1572. // non-interface field appearing in ForceSendFields will be sent to the
  1573. // server regardless of whether the field is empty or not. This may be
  1574. // used to include empty fields in Patch requests.
  1575. ForceSendFields []string `json:"-"`
  1576. // NullFields is a list of field names (e.g. "DistinctOn") to include in
  1577. // API requests with the JSON null value. By default, fields with empty
  1578. // values are omitted from API requests. However, any field with an
  1579. // empty value appearing in NullFields will be sent to the server as
  1580. // null. It is an error if a field in this list has a non-empty value.
  1581. // This may be used to include null fields in Patch requests.
  1582. NullFields []string `json:"-"`
  1583. }
  1584. func (s *Query) MarshalJSON() ([]byte, error) {
  1585. type NoMethod Query
  1586. raw := NoMethod(*s)
  1587. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1588. }
  1589. // QueryResultBatch: A batch of results produced by a query.
  1590. type QueryResultBatch struct {
  1591. // EndCursor: A cursor that points to the position after the last result
  1592. // in the batch.
  1593. EndCursor string `json:"endCursor,omitempty"`
  1594. // EntityResultType: The result type for every entity in
  1595. // `entity_results`.
  1596. //
  1597. // Possible values:
  1598. // "RESULT_TYPE_UNSPECIFIED" - Unspecified. This value is never used.
  1599. // "FULL" - The key and properties.
  1600. // "PROJECTION" - A projected subset of properties. The entity may
  1601. // have no key.
  1602. // "KEY_ONLY" - Only the key.
  1603. EntityResultType string `json:"entityResultType,omitempty"`
  1604. // EntityResults: The results for this batch.
  1605. EntityResults []*EntityResult `json:"entityResults,omitempty"`
  1606. // MoreResults: The state of the query after the current batch.
  1607. //
  1608. // Possible values:
  1609. // "MORE_RESULTS_TYPE_UNSPECIFIED" - Unspecified. This value is never
  1610. // used.
  1611. // "NOT_FINISHED" - There may be additional batches to fetch from this
  1612. // query.
  1613. // "MORE_RESULTS_AFTER_LIMIT" - The query is finished, but there may
  1614. // be more results after the limit.
  1615. // "MORE_RESULTS_AFTER_CURSOR" - The query is finished, but there may
  1616. // be more results after the end
  1617. // cursor.
  1618. // "NO_MORE_RESULTS" - The query is finished, and there are no more
  1619. // results.
  1620. MoreResults string `json:"moreResults,omitempty"`
  1621. // SkippedCursor: A cursor that points to the position after the last
  1622. // skipped result.
  1623. // Will be set when `skipped_results` != 0.
  1624. SkippedCursor string `json:"skippedCursor,omitempty"`
  1625. // SkippedResults: The number of results skipped, typically because of
  1626. // an offset.
  1627. SkippedResults int64 `json:"skippedResults,omitempty"`
  1628. // SnapshotVersion: The version number of the snapshot this batch was
  1629. // returned from.
  1630. // This applies to the range of results from the query's `start_cursor`
  1631. // (or
  1632. // the beginning of the query if no cursor was given) to this
  1633. // batch's
  1634. // `end_cursor` (not the query's `end_cursor`).
  1635. //
  1636. // In a single transaction, subsequent query result batches for the same
  1637. // query
  1638. // can have a greater snapshot version number. Each batch's snapshot
  1639. // version
  1640. // is valid for all preceding batches.
  1641. // The value will be zero for eventually consistent queries.
  1642. SnapshotVersion int64 `json:"snapshotVersion,omitempty,string"`
  1643. // ForceSendFields is a list of field names (e.g. "EndCursor") to
  1644. // unconditionally include in API requests. By default, fields with
  1645. // empty values are omitted from API requests. However, any non-pointer,
  1646. // non-interface field appearing in ForceSendFields will be sent to the
  1647. // server regardless of whether the field is empty or not. This may be
  1648. // used to include empty fields in Patch requests.
  1649. ForceSendFields []string `json:"-"`
  1650. // NullFields is a list of field names (e.g. "EndCursor") to include in
  1651. // API requests with the JSON null value. By default, fields with empty
  1652. // values are omitted from API requests. However, any field with an
  1653. // empty value appearing in NullFields will be sent to the server as
  1654. // null. It is an error if a field in this list has a non-empty value.
  1655. // This may be used to include null fields in Patch requests.
  1656. NullFields []string `json:"-"`
  1657. }
  1658. func (s *QueryResultBatch) MarshalJSON() ([]byte, error) {
  1659. type NoMethod QueryResultBatch
  1660. raw := NoMethod(*s)
  1661. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1662. }
  1663. // ReadOnly: Options specific to read-only transactions.
  1664. type ReadOnly struct {
  1665. }
  1666. // ReadOptions: The options shared by read requests.
  1667. type ReadOptions struct {
  1668. // ReadConsistency: The non-transactional read consistency to
  1669. // use.
  1670. // Cannot be set to `STRONG` for global queries.
  1671. //
  1672. // Possible values:
  1673. // "READ_CONSISTENCY_UNSPECIFIED" - Unspecified. This value must not
  1674. // be used.
  1675. // "STRONG" - Strong consistency.
  1676. // "EVENTUAL" - Eventual consistency.
  1677. ReadConsistency string `json:"readConsistency,omitempty"`
  1678. // Transaction: The identifier of the transaction in which to read.
  1679. // A
  1680. // transaction identifier is returned by a call
  1681. // to
  1682. // Datastore.BeginTransaction.
  1683. Transaction string `json:"transaction,omitempty"`
  1684. // ForceSendFields is a list of field names (e.g. "ReadConsistency") to
  1685. // unconditionally include in API requests. By default, fields with
  1686. // empty values are omitted from API requests. However, any non-pointer,
  1687. // non-interface field appearing in ForceSendFields will be sent to the
  1688. // server regardless of whether the field is empty or not. This may be
  1689. // used to include empty fields in Patch requests.
  1690. ForceSendFields []string `json:"-"`
  1691. // NullFields is a list of field names (e.g. "ReadConsistency") to
  1692. // include in API requests with the JSON null value. By default, fields
  1693. // with empty values are omitted from API requests. However, any field
  1694. // with an empty value appearing in NullFields will be sent to the
  1695. // server as null. It is an error if a field in this list has a
  1696. // non-empty value. This may be used to include null fields in Patch
  1697. // requests.
  1698. NullFields []string `json:"-"`
  1699. }
  1700. func (s *ReadOptions) MarshalJSON() ([]byte, error) {
  1701. type NoMethod ReadOptions
  1702. raw := NoMethod(*s)
  1703. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1704. }
  1705. // ReadWrite: Options specific to read / write transactions.
  1706. type ReadWrite struct {
  1707. // PreviousTransaction: The transaction identifier of the transaction
  1708. // being retried.
  1709. PreviousTransaction string `json:"previousTransaction,omitempty"`
  1710. // ForceSendFields is a list of field names (e.g. "PreviousTransaction")
  1711. // to unconditionally include in API requests. By default, fields with
  1712. // empty values are omitted from API requests. However, any non-pointer,
  1713. // non-interface field appearing in ForceSendFields will be sent to the
  1714. // server regardless of whether the field is empty or not. This may be
  1715. // used to include empty fields in Patch requests.
  1716. ForceSendFields []string `json:"-"`
  1717. // NullFields is a list of field names (e.g. "PreviousTransaction") to
  1718. // include in API requests with the JSON null value. By default, fields
  1719. // with empty values are omitted from API requests. However, any field
  1720. // with an empty value appearing in NullFields will be sent to the
  1721. // server as null. It is an error if a field in this list has a
  1722. // non-empty value. This may be used to include null fields in Patch
  1723. // requests.
  1724. NullFields []string `json:"-"`
  1725. }
  1726. func (s *ReadWrite) MarshalJSON() ([]byte, error) {
  1727. type NoMethod ReadWrite
  1728. raw := NoMethod(*s)
  1729. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1730. }
  1731. // ReserveIdsRequest: The request for Datastore.ReserveIds.
  1732. type ReserveIdsRequest struct {
  1733. // DatabaseId: If not empty, the ID of the database against which to
  1734. // make the request.
  1735. DatabaseId string `json:"databaseId,omitempty"`
  1736. // Keys: A list of keys with complete key paths whose numeric IDs should
  1737. // not be
  1738. // auto-allocated.
  1739. Keys []*Key `json:"keys,omitempty"`
  1740. // ForceSendFields is a list of field names (e.g. "DatabaseId") to
  1741. // unconditionally include in API requests. By default, fields with
  1742. // empty values are omitted from API requests. However, any non-pointer,
  1743. // non-interface field appearing in ForceSendFields will be sent to the
  1744. // server regardless of whether the field is empty or not. This may be
  1745. // used to include empty fields in Patch requests.
  1746. ForceSendFields []string `json:"-"`
  1747. // NullFields is a list of field names (e.g. "DatabaseId") to include in
  1748. // API requests with the JSON null value. By default, fields with empty
  1749. // values are omitted from API requests. However, any field with an
  1750. // empty value appearing in NullFields will be sent to the server as
  1751. // null. It is an error if a field in this list has a non-empty value.
  1752. // This may be used to include null fields in Patch requests.
  1753. NullFields []string `json:"-"`
  1754. }
  1755. func (s *ReserveIdsRequest) MarshalJSON() ([]byte, error) {
  1756. type NoMethod ReserveIdsRequest
  1757. raw := NoMethod(*s)
  1758. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1759. }
  1760. // ReserveIdsResponse: The response for Datastore.ReserveIds.
  1761. type ReserveIdsResponse struct {
  1762. // ServerResponse contains the HTTP response code and headers from the
  1763. // server.
  1764. googleapi.ServerResponse `json:"-"`
  1765. }
  1766. // RollbackRequest: The request for Datastore.Rollback.
  1767. type RollbackRequest struct {
  1768. // Transaction: The transaction identifier, returned by a call
  1769. // to
  1770. // Datastore.BeginTransaction.
  1771. Transaction string `json:"transaction,omitempty"`
  1772. // ForceSendFields is a list of field names (e.g. "Transaction") to
  1773. // unconditionally include in API requests. By default, fields with
  1774. // empty values are omitted from API requests. However, any non-pointer,
  1775. // non-interface field appearing in ForceSendFields will be sent to the
  1776. // server regardless of whether the field is empty or not. This may be
  1777. // used to include empty fields in Patch requests.
  1778. ForceSendFields []string `json:"-"`
  1779. // NullFields is a list of field names (e.g. "Transaction") to include
  1780. // in API requests with the JSON null value. By default, fields with
  1781. // empty values are omitted from API requests. However, any field with
  1782. // an empty value appearing in NullFields will be sent to the server as
  1783. // null. It is an error if a field in this list has a non-empty value.
  1784. // This may be used to include null fields in Patch requests.
  1785. NullFields []string `json:"-"`
  1786. }
  1787. func (s *RollbackRequest) MarshalJSON() ([]byte, error) {
  1788. type NoMethod RollbackRequest
  1789. raw := NoMethod(*s)
  1790. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1791. }
  1792. // RollbackResponse: The response for Datastore.Rollback.
  1793. // (an empty message).
  1794. type RollbackResponse struct {
  1795. // ServerResponse contains the HTTP response code and headers from the
  1796. // server.
  1797. googleapi.ServerResponse `json:"-"`
  1798. }
  1799. // RunQueryRequest: The request for Datastore.RunQuery.
  1800. type RunQueryRequest struct {
  1801. // GqlQuery: The GQL query to run.
  1802. GqlQuery *GqlQuery `json:"gqlQuery,omitempty"`
  1803. // PartitionId: Entities are partitioned into subsets, identified by a
  1804. // partition ID.
  1805. // Queries are scoped to a single partition.
  1806. // This partition ID is normalized with the standard default
  1807. // context
  1808. // partition ID.
  1809. PartitionId *PartitionId `json:"partitionId,omitempty"`
  1810. // Query: The query to run.
  1811. Query *Query `json:"query,omitempty"`
  1812. // ReadOptions: The options for this query.
  1813. ReadOptions *ReadOptions `json:"readOptions,omitempty"`
  1814. // ForceSendFields is a list of field names (e.g. "GqlQuery") to
  1815. // unconditionally include in API requests. By default, fields with
  1816. // empty values are omitted from API requests. However, any non-pointer,
  1817. // non-interface field appearing in ForceSendFields will be sent to the
  1818. // server regardless of whether the field is empty or not. This may be
  1819. // used to include empty fields in Patch requests.
  1820. ForceSendFields []string `json:"-"`
  1821. // NullFields is a list of field names (e.g. "GqlQuery") to include in
  1822. // API requests with the JSON null value. By default, fields with empty
  1823. // values are omitted from API requests. However, any field with an
  1824. // empty value appearing in NullFields will be sent to the server as
  1825. // null. It is an error if a field in this list has a non-empty value.
  1826. // This may be used to include null fields in Patch requests.
  1827. NullFields []string `json:"-"`
  1828. }
  1829. func (s *RunQueryRequest) MarshalJSON() ([]byte, error) {
  1830. type NoMethod RunQueryRequest
  1831. raw := NoMethod(*s)
  1832. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1833. }
  1834. // RunQueryResponse: The response for Datastore.RunQuery.
  1835. type RunQueryResponse struct {
  1836. // Batch: A batch of query results (always present).
  1837. Batch *QueryResultBatch `json:"batch,omitempty"`
  1838. // Query: The parsed form of the `GqlQuery` from the request, if it was
  1839. // set.
  1840. Query *Query `json:"query,omitempty"`
  1841. // ServerResponse contains the HTTP response code and headers from the
  1842. // server.
  1843. googleapi.ServerResponse `json:"-"`
  1844. // ForceSendFields is a list of field names (e.g. "Batch") to
  1845. // unconditionally include in API requests. By default, fields with
  1846. // empty values are omitted from API requests. However, any non-pointer,
  1847. // non-interface field appearing in ForceSendFields will be sent to the
  1848. // server regardless of whether the field is empty or not. This may be
  1849. // used to include empty fields in Patch requests.
  1850. ForceSendFields []string `json:"-"`
  1851. // NullFields is a list of field names (e.g. "Batch") to include in API
  1852. // requests with the JSON null value. By default, fields with empty
  1853. // values are omitted from API requests. However, any field with an
  1854. // empty value appearing in NullFields will be sent to the server as
  1855. // null. It is an error if a field in this list has a non-empty value.
  1856. // This may be used to include null fields in Patch requests.
  1857. NullFields []string `json:"-"`
  1858. }
  1859. func (s *RunQueryResponse) MarshalJSON() ([]byte, error) {
  1860. type NoMethod RunQueryResponse
  1861. raw := NoMethod(*s)
  1862. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1863. }
  1864. // TransactionOptions: Options for beginning a new
  1865. // transaction.
  1866. //
  1867. // Transactions can be created explicitly with calls
  1868. // to
  1869. // Datastore.BeginTransaction or implicitly by
  1870. // setting
  1871. // ReadOptions.new_transaction in read requests.
  1872. type TransactionOptions struct {
  1873. // ReadOnly: The transaction should only allow reads.
  1874. ReadOnly *ReadOnly `json:"readOnly,omitempty"`
  1875. // ReadWrite: The transaction should allow both reads and writes.
  1876. ReadWrite *ReadWrite `json:"readWrite,omitempty"`
  1877. // ForceSendFields is a list of field names (e.g. "ReadOnly") to
  1878. // unconditionally include in API requests. By default, fields with
  1879. // empty values are omitted from API requests. However, any non-pointer,
  1880. // non-interface field appearing in ForceSendFields will be sent to the
  1881. // server regardless of whether the field is empty or not. This may be
  1882. // used to include empty fields in Patch requests.
  1883. ForceSendFields []string `json:"-"`
  1884. // NullFields is a list of field names (e.g. "ReadOnly") to include in
  1885. // API requests with the JSON null value. By default, fields with empty
  1886. // values are omitted from API requests. However, any field with an
  1887. // empty value appearing in NullFields will be sent to the server as
  1888. // null. It is an error if a field in this list has a non-empty value.
  1889. // This may be used to include null fields in Patch requests.
  1890. NullFields []string `json:"-"`
  1891. }
  1892. func (s *TransactionOptions) MarshalJSON() ([]byte, error) {
  1893. type NoMethod TransactionOptions
  1894. raw := NoMethod(*s)
  1895. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1896. }
  1897. // Value: A message that can hold any of the supported value types and
  1898. // associated
  1899. // metadata.
  1900. type Value struct {
  1901. // ArrayValue: An array value.
  1902. // Cannot contain another array value.
  1903. // A `Value` instance that sets field `array_value` must not set
  1904. // fields
  1905. // `meaning` or `exclude_from_indexes`.
  1906. ArrayValue *ArrayValue `json:"arrayValue,omitempty"`
  1907. // BlobValue: A blob value.
  1908. // May have at most 1,000,000 bytes.
  1909. // When `exclude_from_indexes` is false, may have at most 1500 bytes.
  1910. // In JSON requests, must be base64-encoded.
  1911. BlobValue *string `json:"blobValue,omitempty"`
  1912. // BooleanValue: A boolean value.
  1913. BooleanValue *bool `json:"booleanValue,omitempty"`
  1914. // DoubleValue: A double value.
  1915. DoubleValue *float64 `json:"doubleValue,omitempty"`
  1916. // EntityValue: An entity value.
  1917. //
  1918. // - May have no key.
  1919. // - May have a key with an incomplete key path.
  1920. // - May have a reserved/read-only key.
  1921. EntityValue *Entity `json:"entityValue,omitempty"`
  1922. // ExcludeFromIndexes: If the value should be excluded from all indexes
  1923. // including those defined
  1924. // explicitly.
  1925. ExcludeFromIndexes bool `json:"excludeFromIndexes,omitempty"`
  1926. // GeoPointValue: A geo point value representing a point on the surface
  1927. // of Earth.
  1928. GeoPointValue *LatLng `json:"geoPointValue,omitempty"`
  1929. // IntegerValue: An integer value.
  1930. IntegerValue *int64 `json:"integerValue,omitempty,string"`
  1931. // KeyValue: A key value.
  1932. KeyValue *Key `json:"keyValue,omitempty"`
  1933. // Meaning: The `meaning` field should only be populated for backwards
  1934. // compatibility.
  1935. Meaning int64 `json:"meaning,omitempty"`
  1936. // NullValue: A null value.
  1937. //
  1938. // Possible values:
  1939. // "NULL_VALUE" - Null value.
  1940. NullValue string `json:"nullValue,omitempty"`
  1941. // StringValue: A UTF-8 encoded string value.
  1942. // When `exclude_from_indexes` is false (it is indexed) , may have at
  1943. // most 1500 bytes.
  1944. // Otherwise, may be set to at least 1,000,000 bytes.
  1945. StringValue *string `json:"stringValue,omitempty"`
  1946. // TimestampValue: A timestamp value.
  1947. // When stored in the Datastore, precise only to microseconds;
  1948. // any additional precision is rounded down.
  1949. TimestampValue *string `json:"timestampValue,omitempty"`
  1950. // ForceSendFields is a list of field names (e.g. "ArrayValue") to
  1951. // unconditionally include in API requests. By default, fields with
  1952. // empty values are omitted from API requests. However, any non-pointer,
  1953. // non-interface field appearing in ForceSendFields will be sent to the
  1954. // server regardless of whether the field is empty or not. This may be
  1955. // used to include empty fields in Patch requests.
  1956. ForceSendFields []string `json:"-"`
  1957. // NullFields is a list of field names (e.g. "ArrayValue") to include in
  1958. // API requests with the JSON null value. By default, fields with empty
  1959. // values are omitted from API requests. However, any field with an
  1960. // empty value appearing in NullFields will be sent to the server as
  1961. // null. It is an error if a field in this list has a non-empty value.
  1962. // This may be used to include null fields in Patch requests.
  1963. NullFields []string `json:"-"`
  1964. }
  1965. func (s *Value) MarshalJSON() ([]byte, error) {
  1966. type NoMethod Value
  1967. raw := NoMethod(*s)
  1968. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1969. }
  1970. func (s *Value) UnmarshalJSON(data []byte) error {
  1971. type NoMethod Value
  1972. var s1 struct {
  1973. DoubleValue *gensupport.JSONFloat64 `json:"doubleValue"`
  1974. *NoMethod
  1975. }
  1976. s1.NoMethod = (*NoMethod)(s)
  1977. if err := json.Unmarshal(data, &s1); err != nil {
  1978. return err
  1979. }
  1980. if s1.DoubleValue != nil {
  1981. s.DoubleValue = (*float64)(s1.DoubleValue)
  1982. }
  1983. return nil
  1984. }
  1985. // method id "datastore.projects.allocateIds":
  1986. type ProjectsAllocateIdsCall struct {
  1987. s *Service
  1988. projectId string
  1989. allocateidsrequest *AllocateIdsRequest
  1990. urlParams_ gensupport.URLParams
  1991. ctx_ context.Context
  1992. header_ http.Header
  1993. }
  1994. // AllocateIds: Allocates IDs for the given keys, which is useful for
  1995. // referencing an entity
  1996. // before it is inserted.
  1997. func (r *ProjectsService) AllocateIds(projectId string, allocateidsrequest *AllocateIdsRequest) *ProjectsAllocateIdsCall {
  1998. c := &ProjectsAllocateIdsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1999. c.projectId = projectId
  2000. c.allocateidsrequest = allocateidsrequest
  2001. return c
  2002. }
  2003. // Fields allows partial responses to be retrieved. See
  2004. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2005. // for more information.
  2006. func (c *ProjectsAllocateIdsCall) Fields(s ...googleapi.Field) *ProjectsAllocateIdsCall {
  2007. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2008. return c
  2009. }
  2010. // Context sets the context to be used in this call's Do method. Any
  2011. // pending HTTP request will be aborted if the provided context is
  2012. // canceled.
  2013. func (c *ProjectsAllocateIdsCall) Context(ctx context.Context) *ProjectsAllocateIdsCall {
  2014. c.ctx_ = ctx
  2015. return c
  2016. }
  2017. // Header returns an http.Header that can be modified by the caller to
  2018. // add HTTP headers to the request.
  2019. func (c *ProjectsAllocateIdsCall) Header() http.Header {
  2020. if c.header_ == nil {
  2021. c.header_ = make(http.Header)
  2022. }
  2023. return c.header_
  2024. }
  2025. func (c *ProjectsAllocateIdsCall) doRequest(alt string) (*http.Response, error) {
  2026. reqHeaders := make(http.Header)
  2027. for k, v := range c.header_ {
  2028. reqHeaders[k] = v
  2029. }
  2030. reqHeaders.Set("User-Agent", c.s.userAgent())
  2031. var body io.Reader = nil
  2032. body, err := googleapi.WithoutDataWrapper.JSONReader(c.allocateidsrequest)
  2033. if err != nil {
  2034. return nil, err
  2035. }
  2036. reqHeaders.Set("Content-Type", "application/json")
  2037. c.urlParams_.Set("alt", alt)
  2038. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectId}:allocateIds")
  2039. urls += "?" + c.urlParams_.Encode()
  2040. req, _ := http.NewRequest("POST", urls, body)
  2041. req.Header = reqHeaders
  2042. googleapi.Expand(req.URL, map[string]string{
  2043. "projectId": c.projectId,
  2044. })
  2045. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2046. }
  2047. // Do executes the "datastore.projects.allocateIds" call.
  2048. // Exactly one of *AllocateIdsResponse or error will be non-nil. Any
  2049. // non-2xx status code is an error. Response headers are in either
  2050. // *AllocateIdsResponse.ServerResponse.Header or (if a response was
  2051. // returned at all) in error.(*googleapi.Error).Header. Use
  2052. // googleapi.IsNotModified to check whether the returned error was
  2053. // because http.StatusNotModified was returned.
  2054. func (c *ProjectsAllocateIdsCall) Do(opts ...googleapi.CallOption) (*AllocateIdsResponse, error) {
  2055. gensupport.SetOptions(c.urlParams_, opts...)
  2056. res, err := c.doRequest("json")
  2057. if res != nil && res.StatusCode == http.StatusNotModified {
  2058. if res.Body != nil {
  2059. res.Body.Close()
  2060. }
  2061. return nil, &googleapi.Error{
  2062. Code: res.StatusCode,
  2063. Header: res.Header,
  2064. }
  2065. }
  2066. if err != nil {
  2067. return nil, err
  2068. }
  2069. defer googleapi.CloseBody(res)
  2070. if err := googleapi.CheckResponse(res); err != nil {
  2071. return nil, err
  2072. }
  2073. ret := &AllocateIdsResponse{
  2074. ServerResponse: googleapi.ServerResponse{
  2075. Header: res.Header,
  2076. HTTPStatusCode: res.StatusCode,
  2077. },
  2078. }
  2079. target := &ret
  2080. if err := gensupport.DecodeResponse(target, res); err != nil {
  2081. return nil, err
  2082. }
  2083. return ret, nil
  2084. // {
  2085. // "description": "Allocates IDs for the given keys, which is useful for referencing an entity\nbefore it is inserted.",
  2086. // "flatPath": "v1beta3/projects/{projectId}:allocateIds",
  2087. // "httpMethod": "POST",
  2088. // "id": "datastore.projects.allocateIds",
  2089. // "parameterOrder": [
  2090. // "projectId"
  2091. // ],
  2092. // "parameters": {
  2093. // "projectId": {
  2094. // "description": "The ID of the project against which to make the request.",
  2095. // "location": "path",
  2096. // "required": true,
  2097. // "type": "string"
  2098. // }
  2099. // },
  2100. // "path": "v1beta3/projects/{projectId}:allocateIds",
  2101. // "request": {
  2102. // "$ref": "AllocateIdsRequest"
  2103. // },
  2104. // "response": {
  2105. // "$ref": "AllocateIdsResponse"
  2106. // },
  2107. // "scopes": [
  2108. // "https://www.googleapis.com/auth/cloud-platform",
  2109. // "https://www.googleapis.com/auth/datastore"
  2110. // ]
  2111. // }
  2112. }
  2113. // method id "datastore.projects.beginTransaction":
  2114. type ProjectsBeginTransactionCall struct {
  2115. s *Service
  2116. projectId string
  2117. begintransactionrequest *BeginTransactionRequest
  2118. urlParams_ gensupport.URLParams
  2119. ctx_ context.Context
  2120. header_ http.Header
  2121. }
  2122. // BeginTransaction: Begins a new transaction.
  2123. func (r *ProjectsService) BeginTransaction(projectId string, begintransactionrequest *BeginTransactionRequest) *ProjectsBeginTransactionCall {
  2124. c := &ProjectsBeginTransactionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2125. c.projectId = projectId
  2126. c.begintransactionrequest = begintransactionrequest
  2127. return c
  2128. }
  2129. // Fields allows partial responses to be retrieved. See
  2130. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2131. // for more information.
  2132. func (c *ProjectsBeginTransactionCall) Fields(s ...googleapi.Field) *ProjectsBeginTransactionCall {
  2133. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2134. return c
  2135. }
  2136. // Context sets the context to be used in this call's Do method. Any
  2137. // pending HTTP request will be aborted if the provided context is
  2138. // canceled.
  2139. func (c *ProjectsBeginTransactionCall) Context(ctx context.Context) *ProjectsBeginTransactionCall {
  2140. c.ctx_ = ctx
  2141. return c
  2142. }
  2143. // Header returns an http.Header that can be modified by the caller to
  2144. // add HTTP headers to the request.
  2145. func (c *ProjectsBeginTransactionCall) Header() http.Header {
  2146. if c.header_ == nil {
  2147. c.header_ = make(http.Header)
  2148. }
  2149. return c.header_
  2150. }
  2151. func (c *ProjectsBeginTransactionCall) doRequest(alt string) (*http.Response, error) {
  2152. reqHeaders := make(http.Header)
  2153. for k, v := range c.header_ {
  2154. reqHeaders[k] = v
  2155. }
  2156. reqHeaders.Set("User-Agent", c.s.userAgent())
  2157. var body io.Reader = nil
  2158. body, err := googleapi.WithoutDataWrapper.JSONReader(c.begintransactionrequest)
  2159. if err != nil {
  2160. return nil, err
  2161. }
  2162. reqHeaders.Set("Content-Type", "application/json")
  2163. c.urlParams_.Set("alt", alt)
  2164. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectId}:beginTransaction")
  2165. urls += "?" + c.urlParams_.Encode()
  2166. req, _ := http.NewRequest("POST", urls, body)
  2167. req.Header = reqHeaders
  2168. googleapi.Expand(req.URL, map[string]string{
  2169. "projectId": c.projectId,
  2170. })
  2171. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2172. }
  2173. // Do executes the "datastore.projects.beginTransaction" call.
  2174. // Exactly one of *BeginTransactionResponse or error will be non-nil.
  2175. // Any non-2xx status code is an error. Response headers are in either
  2176. // *BeginTransactionResponse.ServerResponse.Header or (if a response was
  2177. // returned at all) in error.(*googleapi.Error).Header. Use
  2178. // googleapi.IsNotModified to check whether the returned error was
  2179. // because http.StatusNotModified was returned.
  2180. func (c *ProjectsBeginTransactionCall) Do(opts ...googleapi.CallOption) (*BeginTransactionResponse, error) {
  2181. gensupport.SetOptions(c.urlParams_, opts...)
  2182. res, err := c.doRequest("json")
  2183. if res != nil && res.StatusCode == http.StatusNotModified {
  2184. if res.Body != nil {
  2185. res.Body.Close()
  2186. }
  2187. return nil, &googleapi.Error{
  2188. Code: res.StatusCode,
  2189. Header: res.Header,
  2190. }
  2191. }
  2192. if err != nil {
  2193. return nil, err
  2194. }
  2195. defer googleapi.CloseBody(res)
  2196. if err := googleapi.CheckResponse(res); err != nil {
  2197. return nil, err
  2198. }
  2199. ret := &BeginTransactionResponse{
  2200. ServerResponse: googleapi.ServerResponse{
  2201. Header: res.Header,
  2202. HTTPStatusCode: res.StatusCode,
  2203. },
  2204. }
  2205. target := &ret
  2206. if err := gensupport.DecodeResponse(target, res); err != nil {
  2207. return nil, err
  2208. }
  2209. return ret, nil
  2210. // {
  2211. // "description": "Begins a new transaction.",
  2212. // "flatPath": "v1beta3/projects/{projectId}:beginTransaction",
  2213. // "httpMethod": "POST",
  2214. // "id": "datastore.projects.beginTransaction",
  2215. // "parameterOrder": [
  2216. // "projectId"
  2217. // ],
  2218. // "parameters": {
  2219. // "projectId": {
  2220. // "description": "The ID of the project against which to make the request.",
  2221. // "location": "path",
  2222. // "required": true,
  2223. // "type": "string"
  2224. // }
  2225. // },
  2226. // "path": "v1beta3/projects/{projectId}:beginTransaction",
  2227. // "request": {
  2228. // "$ref": "BeginTransactionRequest"
  2229. // },
  2230. // "response": {
  2231. // "$ref": "BeginTransactionResponse"
  2232. // },
  2233. // "scopes": [
  2234. // "https://www.googleapis.com/auth/cloud-platform",
  2235. // "https://www.googleapis.com/auth/datastore"
  2236. // ]
  2237. // }
  2238. }
  2239. // method id "datastore.projects.commit":
  2240. type ProjectsCommitCall struct {
  2241. s *Service
  2242. projectId string
  2243. commitrequest *CommitRequest
  2244. urlParams_ gensupport.URLParams
  2245. ctx_ context.Context
  2246. header_ http.Header
  2247. }
  2248. // Commit: Commits a transaction, optionally creating, deleting or
  2249. // modifying some
  2250. // entities.
  2251. func (r *ProjectsService) Commit(projectId string, commitrequest *CommitRequest) *ProjectsCommitCall {
  2252. c := &ProjectsCommitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2253. c.projectId = projectId
  2254. c.commitrequest = commitrequest
  2255. return c
  2256. }
  2257. // Fields allows partial responses to be retrieved. See
  2258. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2259. // for more information.
  2260. func (c *ProjectsCommitCall) Fields(s ...googleapi.Field) *ProjectsCommitCall {
  2261. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2262. return c
  2263. }
  2264. // Context sets the context to be used in this call's Do method. Any
  2265. // pending HTTP request will be aborted if the provided context is
  2266. // canceled.
  2267. func (c *ProjectsCommitCall) Context(ctx context.Context) *ProjectsCommitCall {
  2268. c.ctx_ = ctx
  2269. return c
  2270. }
  2271. // Header returns an http.Header that can be modified by the caller to
  2272. // add HTTP headers to the request.
  2273. func (c *ProjectsCommitCall) Header() http.Header {
  2274. if c.header_ == nil {
  2275. c.header_ = make(http.Header)
  2276. }
  2277. return c.header_
  2278. }
  2279. func (c *ProjectsCommitCall) doRequest(alt string) (*http.Response, error) {
  2280. reqHeaders := make(http.Header)
  2281. for k, v := range c.header_ {
  2282. reqHeaders[k] = v
  2283. }
  2284. reqHeaders.Set("User-Agent", c.s.userAgent())
  2285. var body io.Reader = nil
  2286. body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitrequest)
  2287. if err != nil {
  2288. return nil, err
  2289. }
  2290. reqHeaders.Set("Content-Type", "application/json")
  2291. c.urlParams_.Set("alt", alt)
  2292. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectId}:commit")
  2293. urls += "?" + c.urlParams_.Encode()
  2294. req, _ := http.NewRequest("POST", urls, body)
  2295. req.Header = reqHeaders
  2296. googleapi.Expand(req.URL, map[string]string{
  2297. "projectId": c.projectId,
  2298. })
  2299. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2300. }
  2301. // Do executes the "datastore.projects.commit" call.
  2302. // Exactly one of *CommitResponse or error will be non-nil. Any non-2xx
  2303. // status code is an error. Response headers are in either
  2304. // *CommitResponse.ServerResponse.Header or (if a response was returned
  2305. // at all) in error.(*googleapi.Error).Header. Use
  2306. // googleapi.IsNotModified to check whether the returned error was
  2307. // because http.StatusNotModified was returned.
  2308. func (c *ProjectsCommitCall) Do(opts ...googleapi.CallOption) (*CommitResponse, error) {
  2309. gensupport.SetOptions(c.urlParams_, opts...)
  2310. res, err := c.doRequest("json")
  2311. if res != nil && res.StatusCode == http.StatusNotModified {
  2312. if res.Body != nil {
  2313. res.Body.Close()
  2314. }
  2315. return nil, &googleapi.Error{
  2316. Code: res.StatusCode,
  2317. Header: res.Header,
  2318. }
  2319. }
  2320. if err != nil {
  2321. return nil, err
  2322. }
  2323. defer googleapi.CloseBody(res)
  2324. if err := googleapi.CheckResponse(res); err != nil {
  2325. return nil, err
  2326. }
  2327. ret := &CommitResponse{
  2328. ServerResponse: googleapi.ServerResponse{
  2329. Header: res.Header,
  2330. HTTPStatusCode: res.StatusCode,
  2331. },
  2332. }
  2333. target := &ret
  2334. if err := gensupport.DecodeResponse(target, res); err != nil {
  2335. return nil, err
  2336. }
  2337. return ret, nil
  2338. // {
  2339. // "description": "Commits a transaction, optionally creating, deleting or modifying some\nentities.",
  2340. // "flatPath": "v1beta3/projects/{projectId}:commit",
  2341. // "httpMethod": "POST",
  2342. // "id": "datastore.projects.commit",
  2343. // "parameterOrder": [
  2344. // "projectId"
  2345. // ],
  2346. // "parameters": {
  2347. // "projectId": {
  2348. // "description": "The ID of the project against which to make the request.",
  2349. // "location": "path",
  2350. // "required": true,
  2351. // "type": "string"
  2352. // }
  2353. // },
  2354. // "path": "v1beta3/projects/{projectId}:commit",
  2355. // "request": {
  2356. // "$ref": "CommitRequest"
  2357. // },
  2358. // "response": {
  2359. // "$ref": "CommitResponse"
  2360. // },
  2361. // "scopes": [
  2362. // "https://www.googleapis.com/auth/cloud-platform",
  2363. // "https://www.googleapis.com/auth/datastore"
  2364. // ]
  2365. // }
  2366. }
  2367. // method id "datastore.projects.lookup":
  2368. type ProjectsLookupCall struct {
  2369. s *Service
  2370. projectId string
  2371. lookuprequest *LookupRequest
  2372. urlParams_ gensupport.URLParams
  2373. ctx_ context.Context
  2374. header_ http.Header
  2375. }
  2376. // Lookup: Looks up entities by key.
  2377. func (r *ProjectsService) Lookup(projectId string, lookuprequest *LookupRequest) *ProjectsLookupCall {
  2378. c := &ProjectsLookupCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2379. c.projectId = projectId
  2380. c.lookuprequest = lookuprequest
  2381. return c
  2382. }
  2383. // Fields allows partial responses to be retrieved. See
  2384. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2385. // for more information.
  2386. func (c *ProjectsLookupCall) Fields(s ...googleapi.Field) *ProjectsLookupCall {
  2387. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2388. return c
  2389. }
  2390. // Context sets the context to be used in this call's Do method. Any
  2391. // pending HTTP request will be aborted if the provided context is
  2392. // canceled.
  2393. func (c *ProjectsLookupCall) Context(ctx context.Context) *ProjectsLookupCall {
  2394. c.ctx_ = ctx
  2395. return c
  2396. }
  2397. // Header returns an http.Header that can be modified by the caller to
  2398. // add HTTP headers to the request.
  2399. func (c *ProjectsLookupCall) Header() http.Header {
  2400. if c.header_ == nil {
  2401. c.header_ = make(http.Header)
  2402. }
  2403. return c.header_
  2404. }
  2405. func (c *ProjectsLookupCall) doRequest(alt string) (*http.Response, error) {
  2406. reqHeaders := make(http.Header)
  2407. for k, v := range c.header_ {
  2408. reqHeaders[k] = v
  2409. }
  2410. reqHeaders.Set("User-Agent", c.s.userAgent())
  2411. var body io.Reader = nil
  2412. body, err := googleapi.WithoutDataWrapper.JSONReader(c.lookuprequest)
  2413. if err != nil {
  2414. return nil, err
  2415. }
  2416. reqHeaders.Set("Content-Type", "application/json")
  2417. c.urlParams_.Set("alt", alt)
  2418. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectId}:lookup")
  2419. urls += "?" + c.urlParams_.Encode()
  2420. req, _ := http.NewRequest("POST", urls, body)
  2421. req.Header = reqHeaders
  2422. googleapi.Expand(req.URL, map[string]string{
  2423. "projectId": c.projectId,
  2424. })
  2425. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2426. }
  2427. // Do executes the "datastore.projects.lookup" call.
  2428. // Exactly one of *LookupResponse or error will be non-nil. Any non-2xx
  2429. // status code is an error. Response headers are in either
  2430. // *LookupResponse.ServerResponse.Header or (if a response was returned
  2431. // at all) in error.(*googleapi.Error).Header. Use
  2432. // googleapi.IsNotModified to check whether the returned error was
  2433. // because http.StatusNotModified was returned.
  2434. func (c *ProjectsLookupCall) Do(opts ...googleapi.CallOption) (*LookupResponse, error) {
  2435. gensupport.SetOptions(c.urlParams_, opts...)
  2436. res, err := c.doRequest("json")
  2437. if res != nil && res.StatusCode == http.StatusNotModified {
  2438. if res.Body != nil {
  2439. res.Body.Close()
  2440. }
  2441. return nil, &googleapi.Error{
  2442. Code: res.StatusCode,
  2443. Header: res.Header,
  2444. }
  2445. }
  2446. if err != nil {
  2447. return nil, err
  2448. }
  2449. defer googleapi.CloseBody(res)
  2450. if err := googleapi.CheckResponse(res); err != nil {
  2451. return nil, err
  2452. }
  2453. ret := &LookupResponse{
  2454. ServerResponse: googleapi.ServerResponse{
  2455. Header: res.Header,
  2456. HTTPStatusCode: res.StatusCode,
  2457. },
  2458. }
  2459. target := &ret
  2460. if err := gensupport.DecodeResponse(target, res); err != nil {
  2461. return nil, err
  2462. }
  2463. return ret, nil
  2464. // {
  2465. // "description": "Looks up entities by key.",
  2466. // "flatPath": "v1beta3/projects/{projectId}:lookup",
  2467. // "httpMethod": "POST",
  2468. // "id": "datastore.projects.lookup",
  2469. // "parameterOrder": [
  2470. // "projectId"
  2471. // ],
  2472. // "parameters": {
  2473. // "projectId": {
  2474. // "description": "The ID of the project against which to make the request.",
  2475. // "location": "path",
  2476. // "required": true,
  2477. // "type": "string"
  2478. // }
  2479. // },
  2480. // "path": "v1beta3/projects/{projectId}:lookup",
  2481. // "request": {
  2482. // "$ref": "LookupRequest"
  2483. // },
  2484. // "response": {
  2485. // "$ref": "LookupResponse"
  2486. // },
  2487. // "scopes": [
  2488. // "https://www.googleapis.com/auth/cloud-platform",
  2489. // "https://www.googleapis.com/auth/datastore"
  2490. // ]
  2491. // }
  2492. }
  2493. // method id "datastore.projects.reserveIds":
  2494. type ProjectsReserveIdsCall struct {
  2495. s *Service
  2496. projectId string
  2497. reserveidsrequest *ReserveIdsRequest
  2498. urlParams_ gensupport.URLParams
  2499. ctx_ context.Context
  2500. header_ http.Header
  2501. }
  2502. // ReserveIds: Prevents the supplied keys' IDs from being auto-allocated
  2503. // by Cloud
  2504. // Datastore.
  2505. func (r *ProjectsService) ReserveIds(projectId string, reserveidsrequest *ReserveIdsRequest) *ProjectsReserveIdsCall {
  2506. c := &ProjectsReserveIdsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2507. c.projectId = projectId
  2508. c.reserveidsrequest = reserveidsrequest
  2509. return c
  2510. }
  2511. // Fields allows partial responses to be retrieved. See
  2512. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2513. // for more information.
  2514. func (c *ProjectsReserveIdsCall) Fields(s ...googleapi.Field) *ProjectsReserveIdsCall {
  2515. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2516. return c
  2517. }
  2518. // Context sets the context to be used in this call's Do method. Any
  2519. // pending HTTP request will be aborted if the provided context is
  2520. // canceled.
  2521. func (c *ProjectsReserveIdsCall) Context(ctx context.Context) *ProjectsReserveIdsCall {
  2522. c.ctx_ = ctx
  2523. return c
  2524. }
  2525. // Header returns an http.Header that can be modified by the caller to
  2526. // add HTTP headers to the request.
  2527. func (c *ProjectsReserveIdsCall) Header() http.Header {
  2528. if c.header_ == nil {
  2529. c.header_ = make(http.Header)
  2530. }
  2531. return c.header_
  2532. }
  2533. func (c *ProjectsReserveIdsCall) doRequest(alt string) (*http.Response, error) {
  2534. reqHeaders := make(http.Header)
  2535. for k, v := range c.header_ {
  2536. reqHeaders[k] = v
  2537. }
  2538. reqHeaders.Set("User-Agent", c.s.userAgent())
  2539. var body io.Reader = nil
  2540. body, err := googleapi.WithoutDataWrapper.JSONReader(c.reserveidsrequest)
  2541. if err != nil {
  2542. return nil, err
  2543. }
  2544. reqHeaders.Set("Content-Type", "application/json")
  2545. c.urlParams_.Set("alt", alt)
  2546. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectId}:reserveIds")
  2547. urls += "?" + c.urlParams_.Encode()
  2548. req, _ := http.NewRequest("POST", urls, body)
  2549. req.Header = reqHeaders
  2550. googleapi.Expand(req.URL, map[string]string{
  2551. "projectId": c.projectId,
  2552. })
  2553. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2554. }
  2555. // Do executes the "datastore.projects.reserveIds" call.
  2556. // Exactly one of *ReserveIdsResponse or error will be non-nil. Any
  2557. // non-2xx status code is an error. Response headers are in either
  2558. // *ReserveIdsResponse.ServerResponse.Header or (if a response was
  2559. // returned at all) in error.(*googleapi.Error).Header. Use
  2560. // googleapi.IsNotModified to check whether the returned error was
  2561. // because http.StatusNotModified was returned.
  2562. func (c *ProjectsReserveIdsCall) Do(opts ...googleapi.CallOption) (*ReserveIdsResponse, error) {
  2563. gensupport.SetOptions(c.urlParams_, opts...)
  2564. res, err := c.doRequest("json")
  2565. if res != nil && res.StatusCode == http.StatusNotModified {
  2566. if res.Body != nil {
  2567. res.Body.Close()
  2568. }
  2569. return nil, &googleapi.Error{
  2570. Code: res.StatusCode,
  2571. Header: res.Header,
  2572. }
  2573. }
  2574. if err != nil {
  2575. return nil, err
  2576. }
  2577. defer googleapi.CloseBody(res)
  2578. if err := googleapi.CheckResponse(res); err != nil {
  2579. return nil, err
  2580. }
  2581. ret := &ReserveIdsResponse{
  2582. ServerResponse: googleapi.ServerResponse{
  2583. Header: res.Header,
  2584. HTTPStatusCode: res.StatusCode,
  2585. },
  2586. }
  2587. target := &ret
  2588. if err := gensupport.DecodeResponse(target, res); err != nil {
  2589. return nil, err
  2590. }
  2591. return ret, nil
  2592. // {
  2593. // "description": "Prevents the supplied keys' IDs from being auto-allocated by Cloud\nDatastore.",
  2594. // "flatPath": "v1beta3/projects/{projectId}:reserveIds",
  2595. // "httpMethod": "POST",
  2596. // "id": "datastore.projects.reserveIds",
  2597. // "parameterOrder": [
  2598. // "projectId"
  2599. // ],
  2600. // "parameters": {
  2601. // "projectId": {
  2602. // "description": "The ID of the project against which to make the request.",
  2603. // "location": "path",
  2604. // "required": true,
  2605. // "type": "string"
  2606. // }
  2607. // },
  2608. // "path": "v1beta3/projects/{projectId}:reserveIds",
  2609. // "request": {
  2610. // "$ref": "ReserveIdsRequest"
  2611. // },
  2612. // "response": {
  2613. // "$ref": "ReserveIdsResponse"
  2614. // },
  2615. // "scopes": [
  2616. // "https://www.googleapis.com/auth/cloud-platform",
  2617. // "https://www.googleapis.com/auth/datastore"
  2618. // ]
  2619. // }
  2620. }
  2621. // method id "datastore.projects.rollback":
  2622. type ProjectsRollbackCall struct {
  2623. s *Service
  2624. projectId string
  2625. rollbackrequest *RollbackRequest
  2626. urlParams_ gensupport.URLParams
  2627. ctx_ context.Context
  2628. header_ http.Header
  2629. }
  2630. // Rollback: Rolls back a transaction.
  2631. func (r *ProjectsService) Rollback(projectId string, rollbackrequest *RollbackRequest) *ProjectsRollbackCall {
  2632. c := &ProjectsRollbackCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2633. c.projectId = projectId
  2634. c.rollbackrequest = rollbackrequest
  2635. return c
  2636. }
  2637. // Fields allows partial responses to be retrieved. See
  2638. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2639. // for more information.
  2640. func (c *ProjectsRollbackCall) Fields(s ...googleapi.Field) *ProjectsRollbackCall {
  2641. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2642. return c
  2643. }
  2644. // Context sets the context to be used in this call's Do method. Any
  2645. // pending HTTP request will be aborted if the provided context is
  2646. // canceled.
  2647. func (c *ProjectsRollbackCall) Context(ctx context.Context) *ProjectsRollbackCall {
  2648. c.ctx_ = ctx
  2649. return c
  2650. }
  2651. // Header returns an http.Header that can be modified by the caller to
  2652. // add HTTP headers to the request.
  2653. func (c *ProjectsRollbackCall) Header() http.Header {
  2654. if c.header_ == nil {
  2655. c.header_ = make(http.Header)
  2656. }
  2657. return c.header_
  2658. }
  2659. func (c *ProjectsRollbackCall) doRequest(alt string) (*http.Response, error) {
  2660. reqHeaders := make(http.Header)
  2661. for k, v := range c.header_ {
  2662. reqHeaders[k] = v
  2663. }
  2664. reqHeaders.Set("User-Agent", c.s.userAgent())
  2665. var body io.Reader = nil
  2666. body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackrequest)
  2667. if err != nil {
  2668. return nil, err
  2669. }
  2670. reqHeaders.Set("Content-Type", "application/json")
  2671. c.urlParams_.Set("alt", alt)
  2672. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectId}:rollback")
  2673. urls += "?" + c.urlParams_.Encode()
  2674. req, _ := http.NewRequest("POST", urls, body)
  2675. req.Header = reqHeaders
  2676. googleapi.Expand(req.URL, map[string]string{
  2677. "projectId": c.projectId,
  2678. })
  2679. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2680. }
  2681. // Do executes the "datastore.projects.rollback" call.
  2682. // Exactly one of *RollbackResponse or error will be non-nil. Any
  2683. // non-2xx status code is an error. Response headers are in either
  2684. // *RollbackResponse.ServerResponse.Header or (if a response was
  2685. // returned at all) in error.(*googleapi.Error).Header. Use
  2686. // googleapi.IsNotModified to check whether the returned error was
  2687. // because http.StatusNotModified was returned.
  2688. func (c *ProjectsRollbackCall) Do(opts ...googleapi.CallOption) (*RollbackResponse, error) {
  2689. gensupport.SetOptions(c.urlParams_, opts...)
  2690. res, err := c.doRequest("json")
  2691. if res != nil && res.StatusCode == http.StatusNotModified {
  2692. if res.Body != nil {
  2693. res.Body.Close()
  2694. }
  2695. return nil, &googleapi.Error{
  2696. Code: res.StatusCode,
  2697. Header: res.Header,
  2698. }
  2699. }
  2700. if err != nil {
  2701. return nil, err
  2702. }
  2703. defer googleapi.CloseBody(res)
  2704. if err := googleapi.CheckResponse(res); err != nil {
  2705. return nil, err
  2706. }
  2707. ret := &RollbackResponse{
  2708. ServerResponse: googleapi.ServerResponse{
  2709. Header: res.Header,
  2710. HTTPStatusCode: res.StatusCode,
  2711. },
  2712. }
  2713. target := &ret
  2714. if err := gensupport.DecodeResponse(target, res); err != nil {
  2715. return nil, err
  2716. }
  2717. return ret, nil
  2718. // {
  2719. // "description": "Rolls back a transaction.",
  2720. // "flatPath": "v1beta3/projects/{projectId}:rollback",
  2721. // "httpMethod": "POST",
  2722. // "id": "datastore.projects.rollback",
  2723. // "parameterOrder": [
  2724. // "projectId"
  2725. // ],
  2726. // "parameters": {
  2727. // "projectId": {
  2728. // "description": "The ID of the project against which to make the request.",
  2729. // "location": "path",
  2730. // "required": true,
  2731. // "type": "string"
  2732. // }
  2733. // },
  2734. // "path": "v1beta3/projects/{projectId}:rollback",
  2735. // "request": {
  2736. // "$ref": "RollbackRequest"
  2737. // },
  2738. // "response": {
  2739. // "$ref": "RollbackResponse"
  2740. // },
  2741. // "scopes": [
  2742. // "https://www.googleapis.com/auth/cloud-platform",
  2743. // "https://www.googleapis.com/auth/datastore"
  2744. // ]
  2745. // }
  2746. }
  2747. // method id "datastore.projects.runQuery":
  2748. type ProjectsRunQueryCall struct {
  2749. s *Service
  2750. projectId string
  2751. runqueryrequest *RunQueryRequest
  2752. urlParams_ gensupport.URLParams
  2753. ctx_ context.Context
  2754. header_ http.Header
  2755. }
  2756. // RunQuery: Queries for entities.
  2757. func (r *ProjectsService) RunQuery(projectId string, runqueryrequest *RunQueryRequest) *ProjectsRunQueryCall {
  2758. c := &ProjectsRunQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2759. c.projectId = projectId
  2760. c.runqueryrequest = runqueryrequest
  2761. return c
  2762. }
  2763. // Fields allows partial responses to be retrieved. See
  2764. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2765. // for more information.
  2766. func (c *ProjectsRunQueryCall) Fields(s ...googleapi.Field) *ProjectsRunQueryCall {
  2767. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2768. return c
  2769. }
  2770. // Context sets the context to be used in this call's Do method. Any
  2771. // pending HTTP request will be aborted if the provided context is
  2772. // canceled.
  2773. func (c *ProjectsRunQueryCall) Context(ctx context.Context) *ProjectsRunQueryCall {
  2774. c.ctx_ = ctx
  2775. return c
  2776. }
  2777. // Header returns an http.Header that can be modified by the caller to
  2778. // add HTTP headers to the request.
  2779. func (c *ProjectsRunQueryCall) Header() http.Header {
  2780. if c.header_ == nil {
  2781. c.header_ = make(http.Header)
  2782. }
  2783. return c.header_
  2784. }
  2785. func (c *ProjectsRunQueryCall) doRequest(alt string) (*http.Response, error) {
  2786. reqHeaders := make(http.Header)
  2787. for k, v := range c.header_ {
  2788. reqHeaders[k] = v
  2789. }
  2790. reqHeaders.Set("User-Agent", c.s.userAgent())
  2791. var body io.Reader = nil
  2792. body, err := googleapi.WithoutDataWrapper.JSONReader(c.runqueryrequest)
  2793. if err != nil {
  2794. return nil, err
  2795. }
  2796. reqHeaders.Set("Content-Type", "application/json")
  2797. c.urlParams_.Set("alt", alt)
  2798. urls := googleapi.ResolveRelative(c.s.BasePath, "v1beta3/projects/{projectId}:runQuery")
  2799. urls += "?" + c.urlParams_.Encode()
  2800. req, _ := http.NewRequest("POST", urls, body)
  2801. req.Header = reqHeaders
  2802. googleapi.Expand(req.URL, map[string]string{
  2803. "projectId": c.projectId,
  2804. })
  2805. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2806. }
  2807. // Do executes the "datastore.projects.runQuery" call.
  2808. // Exactly one of *RunQueryResponse or error will be non-nil. Any
  2809. // non-2xx status code is an error. Response headers are in either
  2810. // *RunQueryResponse.ServerResponse.Header or (if a response was
  2811. // returned at all) in error.(*googleapi.Error).Header. Use
  2812. // googleapi.IsNotModified to check whether the returned error was
  2813. // because http.StatusNotModified was returned.
  2814. func (c *ProjectsRunQueryCall) Do(opts ...googleapi.CallOption) (*RunQueryResponse, error) {
  2815. gensupport.SetOptions(c.urlParams_, opts...)
  2816. res, err := c.doRequest("json")
  2817. if res != nil && res.StatusCode == http.StatusNotModified {
  2818. if res.Body != nil {
  2819. res.Body.Close()
  2820. }
  2821. return nil, &googleapi.Error{
  2822. Code: res.StatusCode,
  2823. Header: res.Header,
  2824. }
  2825. }
  2826. if err != nil {
  2827. return nil, err
  2828. }
  2829. defer googleapi.CloseBody(res)
  2830. if err := googleapi.CheckResponse(res); err != nil {
  2831. return nil, err
  2832. }
  2833. ret := &RunQueryResponse{
  2834. ServerResponse: googleapi.ServerResponse{
  2835. Header: res.Header,
  2836. HTTPStatusCode: res.StatusCode,
  2837. },
  2838. }
  2839. target := &ret
  2840. if err := gensupport.DecodeResponse(target, res); err != nil {
  2841. return nil, err
  2842. }
  2843. return ret, nil
  2844. // {
  2845. // "description": "Queries for entities.",
  2846. // "flatPath": "v1beta3/projects/{projectId}:runQuery",
  2847. // "httpMethod": "POST",
  2848. // "id": "datastore.projects.runQuery",
  2849. // "parameterOrder": [
  2850. // "projectId"
  2851. // ],
  2852. // "parameters": {
  2853. // "projectId": {
  2854. // "description": "The ID of the project against which to make the request.",
  2855. // "location": "path",
  2856. // "required": true,
  2857. // "type": "string"
  2858. // }
  2859. // },
  2860. // "path": "v1beta3/projects/{projectId}:runQuery",
  2861. // "request": {
  2862. // "$ref": "RunQueryRequest"
  2863. // },
  2864. // "response": {
  2865. // "$ref": "RunQueryResponse"
  2866. // },
  2867. // "scopes": [
  2868. // "https://www.googleapis.com/auth/cloud-platform",
  2869. // "https://www.googleapis.com/auth/datastore"
  2870. // ]
  2871. // }
  2872. }