Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

3366 linhas
125 KiB

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