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

5240 lines
190 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/v1"
  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/v1"
  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:v1"
  73. const apiName = "datastore"
  74. const apiVersion = "v1"
  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. rs.Indexes = NewProjectsIndexesService(s)
  132. rs.Operations = NewProjectsOperationsService(s)
  133. return rs
  134. }
  135. type ProjectsService struct {
  136. s *Service
  137. Indexes *ProjectsIndexesService
  138. Operations *ProjectsOperationsService
  139. }
  140. func NewProjectsIndexesService(s *Service) *ProjectsIndexesService {
  141. rs := &ProjectsIndexesService{s: s}
  142. return rs
  143. }
  144. type ProjectsIndexesService struct {
  145. s *Service
  146. }
  147. func NewProjectsOperationsService(s *Service) *ProjectsOperationsService {
  148. rs := &ProjectsOperationsService{s: s}
  149. return rs
  150. }
  151. type ProjectsOperationsService struct {
  152. s *Service
  153. }
  154. // AllocateIdsRequest: The request for Datastore.AllocateIds.
  155. type AllocateIdsRequest struct {
  156. // Keys: A list of keys with incomplete key paths for which to allocate
  157. // IDs.
  158. // No key may be reserved/read-only.
  159. Keys []*Key `json:"keys,omitempty"`
  160. // ForceSendFields is a list of field names (e.g. "Keys") to
  161. // unconditionally include in API requests. By default, fields with
  162. // empty values are omitted from API requests. However, any non-pointer,
  163. // non-interface field appearing in ForceSendFields will be sent to the
  164. // server regardless of whether the field is empty or not. This may be
  165. // used to include empty fields in Patch requests.
  166. ForceSendFields []string `json:"-"`
  167. // NullFields is a list of field names (e.g. "Keys") to include in API
  168. // requests with the JSON null value. By default, fields with empty
  169. // values are omitted from API requests. However, any field with an
  170. // empty value appearing in NullFields will be sent to the server as
  171. // null. It is an error if a field in this list has a non-empty value.
  172. // This may be used to include null fields in Patch requests.
  173. NullFields []string `json:"-"`
  174. }
  175. func (s *AllocateIdsRequest) MarshalJSON() ([]byte, error) {
  176. type NoMethod AllocateIdsRequest
  177. raw := NoMethod(*s)
  178. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  179. }
  180. // AllocateIdsResponse: The response for Datastore.AllocateIds.
  181. type AllocateIdsResponse struct {
  182. // Keys: The keys specified in the request (in the same order), each
  183. // with
  184. // its key path completed with a newly allocated ID.
  185. Keys []*Key `json:"keys,omitempty"`
  186. // ServerResponse contains the HTTP response code and headers from the
  187. // server.
  188. googleapi.ServerResponse `json:"-"`
  189. // ForceSendFields is a list of field names (e.g. "Keys") to
  190. // unconditionally include in API requests. By default, fields with
  191. // empty values are omitted from API requests. However, any non-pointer,
  192. // non-interface field appearing in ForceSendFields will be sent to the
  193. // server regardless of whether the field is empty or not. This may be
  194. // used to include empty fields in Patch requests.
  195. ForceSendFields []string `json:"-"`
  196. // NullFields is a list of field names (e.g. "Keys") to include in API
  197. // requests with the JSON null value. By default, fields with empty
  198. // values are omitted from API requests. However, any field with an
  199. // empty value appearing in NullFields will be sent to the server as
  200. // null. It is an error if a field in this list has a non-empty value.
  201. // This may be used to include null fields in Patch requests.
  202. NullFields []string `json:"-"`
  203. }
  204. func (s *AllocateIdsResponse) MarshalJSON() ([]byte, error) {
  205. type NoMethod AllocateIdsResponse
  206. raw := NoMethod(*s)
  207. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  208. }
  209. // ArrayValue: An array value.
  210. type ArrayValue struct {
  211. // Values: Values in the array.
  212. // The order of values in an array is preserved as long as all values
  213. // have
  214. // identical settings for 'exclude_from_indexes'.
  215. Values []*Value `json:"values,omitempty"`
  216. // ForceSendFields is a list of field names (e.g. "Values") to
  217. // unconditionally include in API requests. By default, fields with
  218. // empty values are omitted from API requests. However, any non-pointer,
  219. // non-interface field appearing in ForceSendFields will be sent to the
  220. // server regardless of whether the field is empty or not. This may be
  221. // used to include empty fields in Patch requests.
  222. ForceSendFields []string `json:"-"`
  223. // NullFields is a list of field names (e.g. "Values") to include in API
  224. // requests with the JSON null value. By default, fields with empty
  225. // values are omitted from API requests. However, any field with an
  226. // empty value appearing in NullFields will be sent to the server as
  227. // null. It is an error if a field in this list has a non-empty value.
  228. // This may be used to include null fields in Patch requests.
  229. NullFields []string `json:"-"`
  230. }
  231. func (s *ArrayValue) MarshalJSON() ([]byte, error) {
  232. type NoMethod ArrayValue
  233. raw := NoMethod(*s)
  234. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  235. }
  236. // BeginTransactionRequest: The request for Datastore.BeginTransaction.
  237. type BeginTransactionRequest struct {
  238. // TransactionOptions: Options for a new transaction.
  239. TransactionOptions *TransactionOptions `json:"transactionOptions,omitempty"`
  240. // ForceSendFields is a list of field names (e.g. "TransactionOptions")
  241. // to unconditionally include in API requests. By default, fields with
  242. // empty values are omitted from API requests. However, any non-pointer,
  243. // non-interface field appearing in ForceSendFields will be sent to the
  244. // server regardless of whether the field is empty or not. This may be
  245. // used to include empty fields in Patch requests.
  246. ForceSendFields []string `json:"-"`
  247. // NullFields is a list of field names (e.g. "TransactionOptions") to
  248. // include in API requests with the JSON null value. By default, fields
  249. // with empty values are omitted from API requests. However, any field
  250. // with an empty value appearing in NullFields will be sent to the
  251. // server as null. It is an error if a field in this list has a
  252. // non-empty value. This may be used to include null fields in Patch
  253. // requests.
  254. NullFields []string `json:"-"`
  255. }
  256. func (s *BeginTransactionRequest) MarshalJSON() ([]byte, error) {
  257. type NoMethod BeginTransactionRequest
  258. raw := NoMethod(*s)
  259. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  260. }
  261. // BeginTransactionResponse: The response for
  262. // Datastore.BeginTransaction.
  263. type BeginTransactionResponse struct {
  264. // Transaction: The transaction identifier (always present).
  265. Transaction string `json:"transaction,omitempty"`
  266. // ServerResponse contains the HTTP response code and headers from the
  267. // server.
  268. googleapi.ServerResponse `json:"-"`
  269. // ForceSendFields is a list of field names (e.g. "Transaction") to
  270. // unconditionally include in API requests. By default, fields with
  271. // empty values are omitted from API requests. However, any non-pointer,
  272. // non-interface field appearing in ForceSendFields will be sent to the
  273. // server regardless of whether the field is empty or not. This may be
  274. // used to include empty fields in Patch requests.
  275. ForceSendFields []string `json:"-"`
  276. // NullFields is a list of field names (e.g. "Transaction") to include
  277. // in API requests with the JSON null value. By default, fields with
  278. // empty values are omitted from API requests. However, any field with
  279. // an empty value appearing in NullFields will be sent to the server as
  280. // null. It is an error if a field in this list has a non-empty value.
  281. // This may be used to include null fields in Patch requests.
  282. NullFields []string `json:"-"`
  283. }
  284. func (s *BeginTransactionResponse) MarshalJSON() ([]byte, error) {
  285. type NoMethod BeginTransactionResponse
  286. raw := NoMethod(*s)
  287. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  288. }
  289. // CommitRequest: The request for Datastore.Commit.
  290. type CommitRequest struct {
  291. // Mode: The type of commit to perform. Defaults to `TRANSACTIONAL`.
  292. //
  293. // Possible values:
  294. // "MODE_UNSPECIFIED" - Unspecified. This value must not be used.
  295. // "TRANSACTIONAL" - Transactional: The mutations are either all
  296. // applied, or none are applied.
  297. // Learn about transactions
  298. // [here](https://cloud.google.com/datastore/docs/concepts/transactions).
  299. // "NON_TRANSACTIONAL" - Non-transactional: The mutations may not
  300. // apply as all or none.
  301. Mode string `json:"mode,omitempty"`
  302. // Mutations: The mutations to perform.
  303. //
  304. // When mode is `TRANSACTIONAL`, mutations affecting a single entity
  305. // are
  306. // applied in order. The following sequences of mutations affecting a
  307. // single
  308. // entity are not permitted in a single `Commit` request:
  309. //
  310. // - `insert` followed by `insert`
  311. // - `update` followed by `insert`
  312. // - `upsert` followed by `insert`
  313. // - `delete` followed by `update`
  314. //
  315. // When mode is `NON_TRANSACTIONAL`, no two mutations may affect a
  316. // single
  317. // entity.
  318. Mutations []*Mutation `json:"mutations,omitempty"`
  319. // Transaction: The identifier of the transaction associated with the
  320. // commit. A
  321. // transaction identifier is returned by a call
  322. // to
  323. // Datastore.BeginTransaction.
  324. Transaction string `json:"transaction,omitempty"`
  325. // ForceSendFields is a list of field names (e.g. "Mode") to
  326. // unconditionally include in API requests. By default, fields with
  327. // empty values are omitted from API requests. However, any non-pointer,
  328. // non-interface field appearing in ForceSendFields will be sent to the
  329. // server regardless of whether the field is empty or not. This may be
  330. // used to include empty fields in Patch requests.
  331. ForceSendFields []string `json:"-"`
  332. // NullFields is a list of field names (e.g. "Mode") to include in API
  333. // requests with the JSON null value. By default, fields with empty
  334. // values are omitted from API requests. However, any field with an
  335. // empty value appearing in NullFields will be sent to the server as
  336. // null. It is an error if a field in this list has a non-empty value.
  337. // This may be used to include null fields in Patch requests.
  338. NullFields []string `json:"-"`
  339. }
  340. func (s *CommitRequest) MarshalJSON() ([]byte, error) {
  341. type NoMethod CommitRequest
  342. raw := NoMethod(*s)
  343. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  344. }
  345. // CommitResponse: The response for Datastore.Commit.
  346. type CommitResponse struct {
  347. // IndexUpdates: The number of index entries updated during the commit,
  348. // or zero if none were
  349. // updated.
  350. IndexUpdates int64 `json:"indexUpdates,omitempty"`
  351. // MutationResults: The result of performing the mutations.
  352. // The i-th mutation result corresponds to the i-th mutation in the
  353. // request.
  354. MutationResults []*MutationResult `json:"mutationResults,omitempty"`
  355. // ServerResponse contains the HTTP response code and headers from the
  356. // server.
  357. googleapi.ServerResponse `json:"-"`
  358. // ForceSendFields is a list of field names (e.g. "IndexUpdates") to
  359. // unconditionally include in API requests. By default, fields with
  360. // empty values are omitted from API requests. However, any non-pointer,
  361. // non-interface field appearing in ForceSendFields will be sent to the
  362. // server regardless of whether the field is empty or not. This may be
  363. // used to include empty fields in Patch requests.
  364. ForceSendFields []string `json:"-"`
  365. // NullFields is a list of field names (e.g. "IndexUpdates") to include
  366. // in API requests with the JSON null value. By default, fields with
  367. // empty values are omitted from API requests. However, any field with
  368. // an empty value appearing in NullFields will be sent to the server as
  369. // null. It is an error if a field in this list has a non-empty value.
  370. // This may be used to include null fields in Patch requests.
  371. NullFields []string `json:"-"`
  372. }
  373. func (s *CommitResponse) MarshalJSON() ([]byte, error) {
  374. type NoMethod CommitResponse
  375. raw := NoMethod(*s)
  376. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  377. }
  378. // CompositeFilter: A filter that merges multiple other filters using
  379. // the given operator.
  380. type CompositeFilter struct {
  381. // Filters: The list of filters to combine.
  382. // Must contain at least one filter.
  383. Filters []*Filter `json:"filters,omitempty"`
  384. // Op: The operator for combining multiple filters.
  385. //
  386. // Possible values:
  387. // "OPERATOR_UNSPECIFIED" - Unspecified. This value must not be used.
  388. // "AND" - The results are required to satisfy each of the combined
  389. // filters.
  390. Op string `json:"op,omitempty"`
  391. // ForceSendFields is a list of field names (e.g. "Filters") to
  392. // unconditionally include in API requests. By default, fields with
  393. // empty values are omitted from API requests. However, any non-pointer,
  394. // non-interface field appearing in ForceSendFields will be sent to the
  395. // server regardless of whether the field is empty or not. This may be
  396. // used to include empty fields in Patch requests.
  397. ForceSendFields []string `json:"-"`
  398. // NullFields is a list of field names (e.g. "Filters") to include in
  399. // API requests with the JSON null value. By default, fields with empty
  400. // values are omitted from API requests. However, any field with an
  401. // empty value appearing in NullFields will be sent to the server as
  402. // null. It is an error if a field in this list has a non-empty value.
  403. // This may be used to include null fields in Patch requests.
  404. NullFields []string `json:"-"`
  405. }
  406. func (s *CompositeFilter) MarshalJSON() ([]byte, error) {
  407. type NoMethod CompositeFilter
  408. raw := NoMethod(*s)
  409. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  410. }
  411. // Empty: A generic empty message that you can re-use to avoid defining
  412. // duplicated
  413. // empty messages in your APIs. A typical example is to use it as the
  414. // request
  415. // or the response type of an API method. For instance:
  416. //
  417. // service Foo {
  418. // rpc Bar(google.protobuf.Empty) returns
  419. // (google.protobuf.Empty);
  420. // }
  421. //
  422. // The JSON representation for `Empty` is empty JSON object `{}`.
  423. type Empty struct {
  424. // ServerResponse contains the HTTP response code and headers from the
  425. // server.
  426. googleapi.ServerResponse `json:"-"`
  427. }
  428. // Entity: A Datastore data object.
  429. //
  430. // An entity is limited to 1 megabyte when stored. That
  431. // _roughly_
  432. // corresponds to a limit of 1 megabyte for the serialized form of
  433. // this
  434. // message.
  435. type Entity struct {
  436. // Key: The entity's key.
  437. //
  438. // An entity must have a key, unless otherwise documented (for
  439. // example,
  440. // an entity in `Value.entity_value` may have no key).
  441. // An entity's kind is its key path's last element's kind,
  442. // or null if it has no key.
  443. Key *Key `json:"key,omitempty"`
  444. // Properties: The entity's properties.
  445. // The map's keys are property names.
  446. // A property name matching regex `__.*__` is reserved.
  447. // A reserved property name is forbidden in certain documented
  448. // contexts.
  449. // The name must not contain more than 500 characters.
  450. // The name cannot be "".
  451. Properties map[string]Value `json:"properties,omitempty"`
  452. // ForceSendFields is a list of field names (e.g. "Key") to
  453. // unconditionally include in API requests. By default, fields with
  454. // empty values are omitted from API requests. However, any non-pointer,
  455. // non-interface field appearing in ForceSendFields will be sent to the
  456. // server regardless of whether the field is empty or not. This may be
  457. // used to include empty fields in Patch requests.
  458. ForceSendFields []string `json:"-"`
  459. // NullFields is a list of field names (e.g. "Key") to include in API
  460. // requests with the JSON null value. By default, fields with empty
  461. // values are omitted from API requests. However, any field with an
  462. // empty value appearing in NullFields will be sent to the server as
  463. // null. It is an error if a field in this list has a non-empty value.
  464. // This may be used to include null fields in Patch requests.
  465. NullFields []string `json:"-"`
  466. }
  467. func (s *Entity) MarshalJSON() ([]byte, error) {
  468. type NoMethod Entity
  469. raw := NoMethod(*s)
  470. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  471. }
  472. // EntityResult: The result of fetching an entity from Datastore.
  473. type EntityResult struct {
  474. // Cursor: A cursor that points to the position after the result
  475. // entity.
  476. // Set only when the `EntityResult` is part of a `QueryResultBatch`
  477. // message.
  478. Cursor string `json:"cursor,omitempty"`
  479. // Entity: The resulting entity.
  480. Entity *Entity `json:"entity,omitempty"`
  481. // Version: The version of the entity, a strictly positive number that
  482. // monotonically
  483. // increases with changes to the entity.
  484. //
  485. // This field is set for `FULL` entity
  486. // results.
  487. //
  488. // For missing entities in `LookupResponse`, this
  489. // is the version of the snapshot that was used to look up the entity,
  490. // and it
  491. // is always set except for eventually consistent reads.
  492. Version int64 `json:"version,omitempty,string"`
  493. // ForceSendFields is a list of field names (e.g. "Cursor") to
  494. // unconditionally include in API requests. By default, fields with
  495. // empty values are omitted from API requests. However, any non-pointer,
  496. // non-interface field appearing in ForceSendFields will be sent to the
  497. // server regardless of whether the field is empty or not. This may be
  498. // used to include empty fields in Patch requests.
  499. ForceSendFields []string `json:"-"`
  500. // NullFields is a list of field names (e.g. "Cursor") to include in API
  501. // requests with the JSON null value. By default, fields with empty
  502. // values are omitted from API requests. However, any field with an
  503. // empty value appearing in NullFields will be sent to the server as
  504. // null. It is an error if a field in this list has a non-empty value.
  505. // This may be used to include null fields in Patch requests.
  506. NullFields []string `json:"-"`
  507. }
  508. func (s *EntityResult) MarshalJSON() ([]byte, error) {
  509. type NoMethod EntityResult
  510. raw := NoMethod(*s)
  511. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  512. }
  513. // Filter: A holder for any type of filter.
  514. type Filter struct {
  515. // CompositeFilter: A composite filter.
  516. CompositeFilter *CompositeFilter `json:"compositeFilter,omitempty"`
  517. // PropertyFilter: A filter on a property.
  518. PropertyFilter *PropertyFilter `json:"propertyFilter,omitempty"`
  519. // ForceSendFields is a list of field names (e.g. "CompositeFilter") to
  520. // unconditionally include in API requests. By default, fields with
  521. // empty values are omitted from API requests. However, any non-pointer,
  522. // non-interface field appearing in ForceSendFields will be sent to the
  523. // server regardless of whether the field is empty or not. This may be
  524. // used to include empty fields in Patch requests.
  525. ForceSendFields []string `json:"-"`
  526. // NullFields is a list of field names (e.g. "CompositeFilter") to
  527. // include in API requests with the JSON null value. By default, fields
  528. // with empty values are omitted from API requests. However, any field
  529. // with an empty value appearing in NullFields will be sent to the
  530. // server as null. It is an error if a field in this list has a
  531. // non-empty value. This may be used to include null fields in Patch
  532. // requests.
  533. NullFields []string `json:"-"`
  534. }
  535. func (s *Filter) MarshalJSON() ([]byte, error) {
  536. type NoMethod Filter
  537. raw := NoMethod(*s)
  538. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  539. }
  540. // GoogleDatastoreAdminV1CommonMetadata: Metadata common to all
  541. // Datastore Admin operations.
  542. type GoogleDatastoreAdminV1CommonMetadata struct {
  543. // EndTime: The time the operation ended, either successfully or
  544. // otherwise.
  545. EndTime string `json:"endTime,omitempty"`
  546. // Labels: The client-assigned labels which were provided when the
  547. // operation was
  548. // created. May also include additional labels.
  549. Labels map[string]string `json:"labels,omitempty"`
  550. // OperationType: The type of the operation. Can be used as a filter
  551. // in
  552. // ListOperationsRequest.
  553. //
  554. // Possible values:
  555. // "OPERATION_TYPE_UNSPECIFIED" - Unspecified.
  556. // "EXPORT_ENTITIES" - ExportEntities.
  557. // "IMPORT_ENTITIES" - ImportEntities.
  558. // "CREATE_INDEX" - CreateIndex.
  559. // "DELETE_INDEX" - DeleteIndex.
  560. OperationType string `json:"operationType,omitempty"`
  561. // StartTime: The time that work began on the operation.
  562. StartTime string `json:"startTime,omitempty"`
  563. // State: The current state of the Operation.
  564. //
  565. // Possible values:
  566. // "STATE_UNSPECIFIED" - Unspecified.
  567. // "INITIALIZING" - Request is being prepared for processing.
  568. // "PROCESSING" - Request is actively being processed.
  569. // "CANCELLING" - Request is in the process of being cancelled after
  570. // user called
  571. // google.longrunning.Operations.CancelOperation on the operation.
  572. // "FINALIZING" - Request has been processed and is in its
  573. // finalization stage.
  574. // "SUCCESSFUL" - Request has completed successfully.
  575. // "FAILED" - Request has finished being processed, but encountered an
  576. // error.
  577. // "CANCELLED" - Request has finished being cancelled after user
  578. // called
  579. // google.longrunning.Operations.CancelOperation.
  580. State string `json:"state,omitempty"`
  581. // ForceSendFields is a list of field names (e.g. "EndTime") to
  582. // unconditionally include in API requests. By default, fields with
  583. // empty values are omitted from API requests. However, any non-pointer,
  584. // non-interface field appearing in ForceSendFields will be sent to the
  585. // server regardless of whether the field is empty or not. This may be
  586. // used to include empty fields in Patch requests.
  587. ForceSendFields []string `json:"-"`
  588. // NullFields is a list of field names (e.g. "EndTime") to include in
  589. // API requests with the JSON null value. By default, fields with empty
  590. // values are omitted from API requests. However, any field with an
  591. // empty value appearing in NullFields will be sent to the server as
  592. // null. It is an error if a field in this list has a non-empty value.
  593. // This may be used to include null fields in Patch requests.
  594. NullFields []string `json:"-"`
  595. }
  596. func (s *GoogleDatastoreAdminV1CommonMetadata) MarshalJSON() ([]byte, error) {
  597. type NoMethod GoogleDatastoreAdminV1CommonMetadata
  598. raw := NoMethod(*s)
  599. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  600. }
  601. // GoogleDatastoreAdminV1EntityFilter: Identifies a subset of entities
  602. // in a project. This is specified as
  603. // combinations of kinds and namespaces (either or both of which may be
  604. // all, as
  605. // described in the following examples).
  606. // Example usage:
  607. //
  608. // Entire project:
  609. // kinds=[], namespace_ids=[]
  610. //
  611. // Kinds Foo and Bar in all namespaces:
  612. // kinds=['Foo', 'Bar'], namespace_ids=[]
  613. //
  614. // Kinds Foo and Bar only in the default namespace:
  615. // kinds=['Foo', 'Bar'], namespace_ids=['']
  616. //
  617. // Kinds Foo and Bar in both the default and Baz namespaces:
  618. // kinds=['Foo', 'Bar'], namespace_ids=['', 'Baz']
  619. //
  620. // The entire Baz namespace:
  621. // kinds=[], namespace_ids=['Baz']
  622. type GoogleDatastoreAdminV1EntityFilter struct {
  623. // Kinds: If empty, then this represents all kinds.
  624. Kinds []string `json:"kinds,omitempty"`
  625. // NamespaceIds: An empty list represents all namespaces. This is the
  626. // preferred
  627. // usage for projects that don't use namespaces.
  628. //
  629. // An empty string element represents the default namespace. This should
  630. // be
  631. // used if the project has data in non-default namespaces, but doesn't
  632. // want to
  633. // include them.
  634. // Each namespace in this list must be unique.
  635. NamespaceIds []string `json:"namespaceIds,omitempty"`
  636. // ForceSendFields is a list of field names (e.g. "Kinds") to
  637. // unconditionally include in API requests. By default, fields with
  638. // empty values are omitted from API requests. However, any non-pointer,
  639. // non-interface field appearing in ForceSendFields will be sent to the
  640. // server regardless of whether the field is empty or not. This may be
  641. // used to include empty fields in Patch requests.
  642. ForceSendFields []string `json:"-"`
  643. // NullFields is a list of field names (e.g. "Kinds") to include in API
  644. // requests with the JSON null value. By default, fields with empty
  645. // values are omitted from API requests. However, any field with an
  646. // empty value appearing in NullFields will be sent to the server as
  647. // null. It is an error if a field in this list has a non-empty value.
  648. // This may be used to include null fields in Patch requests.
  649. NullFields []string `json:"-"`
  650. }
  651. func (s *GoogleDatastoreAdminV1EntityFilter) MarshalJSON() ([]byte, error) {
  652. type NoMethod GoogleDatastoreAdminV1EntityFilter
  653. raw := NoMethod(*s)
  654. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  655. }
  656. // GoogleDatastoreAdminV1ExportEntitiesMetadata: Metadata for
  657. // ExportEntities operations.
  658. type GoogleDatastoreAdminV1ExportEntitiesMetadata struct {
  659. // Common: Metadata common to all Datastore Admin operations.
  660. Common *GoogleDatastoreAdminV1CommonMetadata `json:"common,omitempty"`
  661. // EntityFilter: Description of which entities are being exported.
  662. EntityFilter *GoogleDatastoreAdminV1EntityFilter `json:"entityFilter,omitempty"`
  663. // OutputUrlPrefix: Location for the export metadata and data files.
  664. // This will be the same
  665. // value as
  666. // the
  667. // google.datastore.admin.v1.ExportEntitiesRequest.output_url_prefix
  668. //
  669. // field. The final output location is provided
  670. // in
  671. // google.datastore.admin.v1.ExportEntitiesResponse.output_url.
  672. OutputUrlPrefix string `json:"outputUrlPrefix,omitempty"`
  673. // ProgressBytes: An estimate of the number of bytes processed.
  674. ProgressBytes *GoogleDatastoreAdminV1Progress `json:"progressBytes,omitempty"`
  675. // ProgressEntities: An estimate of the number of entities processed.
  676. ProgressEntities *GoogleDatastoreAdminV1Progress `json:"progressEntities,omitempty"`
  677. // ForceSendFields is a list of field names (e.g. "Common") to
  678. // unconditionally include in API requests. By default, fields with
  679. // empty values are omitted from API requests. However, any non-pointer,
  680. // non-interface field appearing in ForceSendFields will be sent to the
  681. // server regardless of whether the field is empty or not. This may be
  682. // used to include empty fields in Patch requests.
  683. ForceSendFields []string `json:"-"`
  684. // NullFields is a list of field names (e.g. "Common") to include in API
  685. // requests with the JSON null value. By default, fields with empty
  686. // values are omitted from API requests. However, any field with an
  687. // empty value appearing in NullFields will be sent to the server as
  688. // null. It is an error if a field in this list has a non-empty value.
  689. // This may be used to include null fields in Patch requests.
  690. NullFields []string `json:"-"`
  691. }
  692. func (s *GoogleDatastoreAdminV1ExportEntitiesMetadata) MarshalJSON() ([]byte, error) {
  693. type NoMethod GoogleDatastoreAdminV1ExportEntitiesMetadata
  694. raw := NoMethod(*s)
  695. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  696. }
  697. // GoogleDatastoreAdminV1ExportEntitiesRequest: The request
  698. // for
  699. // google.datastore.admin.v1.DatastoreAdmin.ExportEntities.
  700. type GoogleDatastoreAdminV1ExportEntitiesRequest struct {
  701. // EntityFilter: Description of what data from the project is included
  702. // in the export.
  703. EntityFilter *GoogleDatastoreAdminV1EntityFilter `json:"entityFilter,omitempty"`
  704. // Labels: Client-assigned labels.
  705. Labels map[string]string `json:"labels,omitempty"`
  706. // OutputUrlPrefix: Location for the export metadata and data
  707. // files.
  708. //
  709. // The full resource URL of the external storage location. Currently,
  710. // only
  711. // Google Cloud Storage is supported. So output_url_prefix should be of
  712. // the
  713. // form: `gs://BUCKET_NAME[/NAMESPACE_PATH]`, where `BUCKET_NAME` is
  714. // the
  715. // name of the Cloud Storage bucket and `NAMESPACE_PATH` is an optional
  716. // Cloud
  717. // Storage namespace path (this is not a Cloud Datastore namespace). For
  718. // more
  719. // information about Cloud Storage namespace paths, see
  720. // [Object
  721. // name
  722. // considerations](https://cloud.google.com/storage/docs/naming#obje
  723. // ct-considerations).
  724. //
  725. // The resulting files will be nested deeper than the specified URL
  726. // prefix.
  727. // The final output URL will be provided in
  728. // the
  729. // google.datastore.admin.v1.ExportEntitiesResponse.output_url field.
  730. // That
  731. // value should be used for subsequent ImportEntities operations.
  732. //
  733. // By nesting the data files deeper, the same Cloud Storage bucket can
  734. // be used
  735. // in multiple ExportEntities operations without conflict.
  736. OutputUrlPrefix string `json:"outputUrlPrefix,omitempty"`
  737. // ForceSendFields is a list of field names (e.g. "EntityFilter") to
  738. // unconditionally include in API requests. By default, fields with
  739. // empty values are omitted from API requests. However, any non-pointer,
  740. // non-interface field appearing in ForceSendFields will be sent to the
  741. // server regardless of whether the field is empty or not. This may be
  742. // used to include empty fields in Patch requests.
  743. ForceSendFields []string `json:"-"`
  744. // NullFields is a list of field names (e.g. "EntityFilter") to include
  745. // in API requests with the JSON null value. By default, fields with
  746. // empty values are omitted from API requests. However, any field with
  747. // an empty value appearing in NullFields will be sent to the server as
  748. // null. It is an error if a field in this list has a non-empty value.
  749. // This may be used to include null fields in Patch requests.
  750. NullFields []string `json:"-"`
  751. }
  752. func (s *GoogleDatastoreAdminV1ExportEntitiesRequest) MarshalJSON() ([]byte, error) {
  753. type NoMethod GoogleDatastoreAdminV1ExportEntitiesRequest
  754. raw := NoMethod(*s)
  755. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  756. }
  757. // GoogleDatastoreAdminV1ExportEntitiesResponse: The response
  758. // for
  759. // google.datastore.admin.v1.DatastoreAdmin.ExportEntities.
  760. type GoogleDatastoreAdminV1ExportEntitiesResponse struct {
  761. // OutputUrl: Location of the output metadata file. This can be used to
  762. // begin an import
  763. // into Cloud Datastore (this project or another project).
  764. // See
  765. // google.datastore.admin.v1.ImportEntitiesRequest.input_url.
  766. // Only present if the operation completed successfully.
  767. OutputUrl string `json:"outputUrl,omitempty"`
  768. // ForceSendFields is a list of field names (e.g. "OutputUrl") to
  769. // unconditionally include in API requests. By default, fields with
  770. // empty values are omitted from API requests. However, any non-pointer,
  771. // non-interface field appearing in ForceSendFields will be sent to the
  772. // server regardless of whether the field is empty or not. This may be
  773. // used to include empty fields in Patch requests.
  774. ForceSendFields []string `json:"-"`
  775. // NullFields is a list of field names (e.g. "OutputUrl") to include in
  776. // API requests with the JSON null value. By default, fields with empty
  777. // values are omitted from API requests. However, any field with an
  778. // empty value appearing in NullFields will be sent to the server as
  779. // null. It is an error if a field in this list has a non-empty value.
  780. // This may be used to include null fields in Patch requests.
  781. NullFields []string `json:"-"`
  782. }
  783. func (s *GoogleDatastoreAdminV1ExportEntitiesResponse) MarshalJSON() ([]byte, error) {
  784. type NoMethod GoogleDatastoreAdminV1ExportEntitiesResponse
  785. raw := NoMethod(*s)
  786. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  787. }
  788. // GoogleDatastoreAdminV1ImportEntitiesMetadata: Metadata for
  789. // ImportEntities operations.
  790. type GoogleDatastoreAdminV1ImportEntitiesMetadata struct {
  791. // Common: Metadata common to all Datastore Admin operations.
  792. Common *GoogleDatastoreAdminV1CommonMetadata `json:"common,omitempty"`
  793. // EntityFilter: Description of which entities are being imported.
  794. EntityFilter *GoogleDatastoreAdminV1EntityFilter `json:"entityFilter,omitempty"`
  795. // InputUrl: The location of the import metadata file. This will be the
  796. // same value as
  797. // the google.datastore.admin.v1.ExportEntitiesResponse.output_url
  798. // field.
  799. InputUrl string `json:"inputUrl,omitempty"`
  800. // ProgressBytes: An estimate of the number of bytes processed.
  801. ProgressBytes *GoogleDatastoreAdminV1Progress `json:"progressBytes,omitempty"`
  802. // ProgressEntities: An estimate of the number of entities processed.
  803. ProgressEntities *GoogleDatastoreAdminV1Progress `json:"progressEntities,omitempty"`
  804. // ForceSendFields is a list of field names (e.g. "Common") to
  805. // unconditionally include in API requests. By default, fields with
  806. // empty values are omitted from API requests. However, any non-pointer,
  807. // non-interface field appearing in ForceSendFields will be sent to the
  808. // server regardless of whether the field is empty or not. This may be
  809. // used to include empty fields in Patch requests.
  810. ForceSendFields []string `json:"-"`
  811. // NullFields is a list of field names (e.g. "Common") to include in API
  812. // requests with the JSON null value. By default, fields with empty
  813. // values are omitted from API requests. However, any field with an
  814. // empty value appearing in NullFields will be sent to the server as
  815. // null. It is an error if a field in this list has a non-empty value.
  816. // This may be used to include null fields in Patch requests.
  817. NullFields []string `json:"-"`
  818. }
  819. func (s *GoogleDatastoreAdminV1ImportEntitiesMetadata) MarshalJSON() ([]byte, error) {
  820. type NoMethod GoogleDatastoreAdminV1ImportEntitiesMetadata
  821. raw := NoMethod(*s)
  822. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  823. }
  824. // GoogleDatastoreAdminV1ImportEntitiesRequest: The request
  825. // for
  826. // google.datastore.admin.v1.DatastoreAdmin.ImportEntities.
  827. type GoogleDatastoreAdminV1ImportEntitiesRequest struct {
  828. // EntityFilter: Optionally specify which kinds/namespaces are to be
  829. // imported. If provided,
  830. // the list must be a subset of the EntityFilter used in creating the
  831. // export,
  832. // otherwise a FAILED_PRECONDITION error will be returned. If no filter
  833. // is
  834. // specified then all entities from the export are imported.
  835. EntityFilter *GoogleDatastoreAdminV1EntityFilter `json:"entityFilter,omitempty"`
  836. // InputUrl: The full resource URL of the external storage location.
  837. // Currently, only
  838. // Google Cloud Storage is supported. So input_url should be of the
  839. // form:
  840. // `gs://BUCKET_NAME[/NAMESPACE_PATH]/OVERALL_EXPORT_METADATA_FILE`
  841. // , where
  842. // `BUCKET_NAME` is the name of the Cloud Storage bucket,
  843. // `NAMESPACE_PATH` is
  844. // an optional Cloud Storage namespace path (this is not a Cloud
  845. // Datastore
  846. // namespace), and `OVERALL_EXPORT_METADATA_FILE` is the metadata file
  847. // written
  848. // by the ExportEntities operation. For more information about Cloud
  849. // Storage
  850. // namespace paths, see
  851. // [Object
  852. // name
  853. // considerations](https://cloud.google.com/storage/docs/naming#obje
  854. // ct-considerations).
  855. //
  856. // For more information,
  857. // see
  858. // google.datastore.admin.v1.ExportEntitiesResponse.output_url.
  859. InputUrl string `json:"inputUrl,omitempty"`
  860. // Labels: Client-assigned labels.
  861. Labels map[string]string `json:"labels,omitempty"`
  862. // ForceSendFields is a list of field names (e.g. "EntityFilter") to
  863. // unconditionally include in API requests. By default, fields with
  864. // empty values are omitted from API requests. However, any non-pointer,
  865. // non-interface field appearing in ForceSendFields will be sent to the
  866. // server regardless of whether the field is empty or not. This may be
  867. // used to include empty fields in Patch requests.
  868. ForceSendFields []string `json:"-"`
  869. // NullFields is a list of field names (e.g. "EntityFilter") to include
  870. // in API requests with the JSON null value. By default, fields with
  871. // empty values are omitted from API requests. However, any field with
  872. // an empty value appearing in NullFields will be sent to the server as
  873. // null. It is an error if a field in this list has a non-empty value.
  874. // This may be used to include null fields in Patch requests.
  875. NullFields []string `json:"-"`
  876. }
  877. func (s *GoogleDatastoreAdminV1ImportEntitiesRequest) MarshalJSON() ([]byte, error) {
  878. type NoMethod GoogleDatastoreAdminV1ImportEntitiesRequest
  879. raw := NoMethod(*s)
  880. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  881. }
  882. // GoogleDatastoreAdminV1Index: A minimal index definition.
  883. type GoogleDatastoreAdminV1Index struct {
  884. // Ancestor: The index's ancestor mode. Must not be
  885. // ANCESTOR_MODE_UNSPECIFIED.
  886. // Required.
  887. //
  888. // Possible values:
  889. // "ANCESTOR_MODE_UNSPECIFIED" - The ancestor mode is unspecified.
  890. // "NONE" - Do not include the entity's ancestors in the index.
  891. // "ALL_ANCESTORS" - Include all the entity's ancestors in the index.
  892. Ancestor string `json:"ancestor,omitempty"`
  893. // IndexId: The resource ID of the index.
  894. // Output only.
  895. IndexId string `json:"indexId,omitempty"`
  896. // Kind: The entity kind to which this index applies.
  897. // Required.
  898. Kind string `json:"kind,omitempty"`
  899. // ProjectId: Project ID.
  900. // Output only.
  901. ProjectId string `json:"projectId,omitempty"`
  902. // Properties: An ordered sequence of property names and their index
  903. // attributes.
  904. // Required.
  905. Properties []*GoogleDatastoreAdminV1IndexedProperty `json:"properties,omitempty"`
  906. // State: The state of the index.
  907. // Output only.
  908. //
  909. // Possible values:
  910. // "STATE_UNSPECIFIED" - The state is unspecified.
  911. // "CREATING" - The index is being created, and cannot be used by
  912. // queries.
  913. // There is an active long-running operation for the index.
  914. // The index is updated when writing an entity.
  915. // Some index data may exist.
  916. // "READY" - The index is ready to be used.
  917. // The index is updated when writing an entity.
  918. // The index is fully populated from all stored entities it applies to.
  919. // "DELETING" - The index is being deleted, and cannot be used by
  920. // queries.
  921. // There is an active long-running operation for the index.
  922. // The index is not updated when writing an entity.
  923. // Some index data may exist.
  924. // "ERROR" - The index was being created or deleted, but something
  925. // went wrong.
  926. // The index cannot by used by queries.
  927. // There is no active long-running operation for the index,
  928. // and the most recently finished long-running operation failed.
  929. // The index is not updated when writing an entity.
  930. // Some index data may exist.
  931. State string `json:"state,omitempty"`
  932. // ServerResponse contains the HTTP response code and headers from the
  933. // server.
  934. googleapi.ServerResponse `json:"-"`
  935. // ForceSendFields is a list of field names (e.g. "Ancestor") to
  936. // unconditionally include in API requests. By default, fields with
  937. // empty values are omitted from API requests. However, any non-pointer,
  938. // non-interface field appearing in ForceSendFields will be sent to the
  939. // server regardless of whether the field is empty or not. This may be
  940. // used to include empty fields in Patch requests.
  941. ForceSendFields []string `json:"-"`
  942. // NullFields is a list of field names (e.g. "Ancestor") to include in
  943. // API requests with the JSON null value. By default, fields with empty
  944. // values are omitted from API requests. However, any field with an
  945. // empty value appearing in NullFields will be sent to the server as
  946. // null. It is an error if a field in this list has a non-empty value.
  947. // This may be used to include null fields in Patch requests.
  948. NullFields []string `json:"-"`
  949. }
  950. func (s *GoogleDatastoreAdminV1Index) MarshalJSON() ([]byte, error) {
  951. type NoMethod GoogleDatastoreAdminV1Index
  952. raw := NoMethod(*s)
  953. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  954. }
  955. // GoogleDatastoreAdminV1IndexOperationMetadata: Metadata for Index
  956. // operations.
  957. type GoogleDatastoreAdminV1IndexOperationMetadata struct {
  958. // Common: Metadata common to all Datastore Admin operations.
  959. Common *GoogleDatastoreAdminV1CommonMetadata `json:"common,omitempty"`
  960. // IndexId: The index resource ID that this operation is acting on.
  961. IndexId string `json:"indexId,omitempty"`
  962. // ProgressEntities: An estimate of the number of entities processed.
  963. ProgressEntities *GoogleDatastoreAdminV1Progress `json:"progressEntities,omitempty"`
  964. // ForceSendFields is a list of field names (e.g. "Common") to
  965. // unconditionally include in API requests. By default, fields with
  966. // empty values are omitted from API requests. However, any non-pointer,
  967. // non-interface field appearing in ForceSendFields will be sent to the
  968. // server regardless of whether the field is empty or not. This may be
  969. // used to include empty fields in Patch requests.
  970. ForceSendFields []string `json:"-"`
  971. // NullFields is a list of field names (e.g. "Common") to include in API
  972. // requests with the JSON null value. By default, fields with empty
  973. // values are omitted from API requests. However, any field with an
  974. // empty value appearing in NullFields will be sent to the server as
  975. // null. It is an error if a field in this list has a non-empty value.
  976. // This may be used to include null fields in Patch requests.
  977. NullFields []string `json:"-"`
  978. }
  979. func (s *GoogleDatastoreAdminV1IndexOperationMetadata) MarshalJSON() ([]byte, error) {
  980. type NoMethod GoogleDatastoreAdminV1IndexOperationMetadata
  981. raw := NoMethod(*s)
  982. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  983. }
  984. // GoogleDatastoreAdminV1IndexedProperty: A property of an index.
  985. type GoogleDatastoreAdminV1IndexedProperty struct {
  986. // Direction: The indexed property's direction. Must not be
  987. // DIRECTION_UNSPECIFIED.
  988. // Required.
  989. //
  990. // Possible values:
  991. // "DIRECTION_UNSPECIFIED" - The direction is unspecified.
  992. // "ASCENDING" - The property's values are indexed so as to support
  993. // sequencing in
  994. // ascending order and also query by <, >, <=, >=, and =.
  995. // "DESCENDING" - The property's values are indexed so as to support
  996. // sequencing in
  997. // descending order and also query by <, >, <=, >=, and =.
  998. Direction string `json:"direction,omitempty"`
  999. // Name: The property name to index.
  1000. // Required.
  1001. Name string `json:"name,omitempty"`
  1002. // ForceSendFields is a list of field names (e.g. "Direction") to
  1003. // unconditionally include in API requests. By default, fields with
  1004. // empty values are omitted from API requests. However, any non-pointer,
  1005. // non-interface field appearing in ForceSendFields will be sent to the
  1006. // server regardless of whether the field is empty or not. This may be
  1007. // used to include empty fields in Patch requests.
  1008. ForceSendFields []string `json:"-"`
  1009. // NullFields is a list of field names (e.g. "Direction") to include in
  1010. // API requests with the JSON null value. By default, fields with empty
  1011. // values are omitted from API requests. However, any field with an
  1012. // empty value appearing in NullFields will be sent to the server as
  1013. // null. It is an error if a field in this list has a non-empty value.
  1014. // This may be used to include null fields in Patch requests.
  1015. NullFields []string `json:"-"`
  1016. }
  1017. func (s *GoogleDatastoreAdminV1IndexedProperty) MarshalJSON() ([]byte, error) {
  1018. type NoMethod GoogleDatastoreAdminV1IndexedProperty
  1019. raw := NoMethod(*s)
  1020. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1021. }
  1022. // GoogleDatastoreAdminV1ListIndexesResponse: The response
  1023. // for
  1024. // google.datastore.admin.v1.DatastoreAdmin.ListIndexes.
  1025. type GoogleDatastoreAdminV1ListIndexesResponse struct {
  1026. // Indexes: The indexes.
  1027. Indexes []*GoogleDatastoreAdminV1Index `json:"indexes,omitempty"`
  1028. // NextPageToken: The standard List next-page token.
  1029. NextPageToken string `json:"nextPageToken,omitempty"`
  1030. // ServerResponse contains the HTTP response code and headers from the
  1031. // server.
  1032. googleapi.ServerResponse `json:"-"`
  1033. // ForceSendFields is a list of field names (e.g. "Indexes") to
  1034. // unconditionally include in API requests. By default, fields with
  1035. // empty values are omitted from API requests. However, any non-pointer,
  1036. // non-interface field appearing in ForceSendFields will be sent to the
  1037. // server regardless of whether the field is empty or not. This may be
  1038. // used to include empty fields in Patch requests.
  1039. ForceSendFields []string `json:"-"`
  1040. // NullFields is a list of field names (e.g. "Indexes") to include in
  1041. // API requests with the JSON null value. By default, fields with empty
  1042. // values are omitted from API requests. However, any field with an
  1043. // empty value appearing in NullFields will be sent to the server as
  1044. // null. It is an error if a field in this list has a non-empty value.
  1045. // This may be used to include null fields in Patch requests.
  1046. NullFields []string `json:"-"`
  1047. }
  1048. func (s *GoogleDatastoreAdminV1ListIndexesResponse) MarshalJSON() ([]byte, error) {
  1049. type NoMethod GoogleDatastoreAdminV1ListIndexesResponse
  1050. raw := NoMethod(*s)
  1051. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1052. }
  1053. // GoogleDatastoreAdminV1Progress: Measures the progress of a particular
  1054. // metric.
  1055. type GoogleDatastoreAdminV1Progress struct {
  1056. // WorkCompleted: The amount of work that has been completed. Note that
  1057. // this may be greater
  1058. // than work_estimated.
  1059. WorkCompleted int64 `json:"workCompleted,omitempty,string"`
  1060. // WorkEstimated: An estimate of how much work needs to be performed.
  1061. // May be zero if the
  1062. // work estimate is unavailable.
  1063. WorkEstimated int64 `json:"workEstimated,omitempty,string"`
  1064. // ForceSendFields is a list of field names (e.g. "WorkCompleted") to
  1065. // unconditionally include in API requests. By default, fields with
  1066. // empty values are omitted from API requests. However, any non-pointer,
  1067. // non-interface field appearing in ForceSendFields will be sent to the
  1068. // server regardless of whether the field is empty or not. This may be
  1069. // used to include empty fields in Patch requests.
  1070. ForceSendFields []string `json:"-"`
  1071. // NullFields is a list of field names (e.g. "WorkCompleted") to include
  1072. // in API requests with the JSON null value. By default, fields with
  1073. // empty values are omitted from API requests. However, any field with
  1074. // an empty value appearing in NullFields will be sent to the server as
  1075. // null. It is an error if a field in this list has a non-empty value.
  1076. // This may be used to include null fields in Patch requests.
  1077. NullFields []string `json:"-"`
  1078. }
  1079. func (s *GoogleDatastoreAdminV1Progress) MarshalJSON() ([]byte, error) {
  1080. type NoMethod GoogleDatastoreAdminV1Progress
  1081. raw := NoMethod(*s)
  1082. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1083. }
  1084. // GoogleDatastoreAdminV1beta1CommonMetadata: Metadata common to all
  1085. // Datastore Admin operations.
  1086. type GoogleDatastoreAdminV1beta1CommonMetadata struct {
  1087. // EndTime: The time the operation ended, either successfully or
  1088. // otherwise.
  1089. EndTime string `json:"endTime,omitempty"`
  1090. // Labels: The client-assigned labels which were provided when the
  1091. // operation was
  1092. // created. May also include additional labels.
  1093. Labels map[string]string `json:"labels,omitempty"`
  1094. // OperationType: The type of the operation. Can be used as a filter
  1095. // in
  1096. // ListOperationsRequest.
  1097. //
  1098. // Possible values:
  1099. // "OPERATION_TYPE_UNSPECIFIED" - Unspecified.
  1100. // "EXPORT_ENTITIES" - ExportEntities.
  1101. // "IMPORT_ENTITIES" - ImportEntities.
  1102. OperationType string `json:"operationType,omitempty"`
  1103. // StartTime: The time that work began on the operation.
  1104. StartTime string `json:"startTime,omitempty"`
  1105. // State: The current state of the Operation.
  1106. //
  1107. // Possible values:
  1108. // "STATE_UNSPECIFIED" - Unspecified.
  1109. // "INITIALIZING" - Request is being prepared for processing.
  1110. // "PROCESSING" - Request is actively being processed.
  1111. // "CANCELLING" - Request is in the process of being cancelled after
  1112. // user called
  1113. // google.longrunning.Operations.CancelOperation on the operation.
  1114. // "FINALIZING" - Request has been processed and is in its
  1115. // finalization stage.
  1116. // "SUCCESSFUL" - Request has completed successfully.
  1117. // "FAILED" - Request has finished being processed, but encountered an
  1118. // error.
  1119. // "CANCELLED" - Request has finished being cancelled after user
  1120. // called
  1121. // google.longrunning.Operations.CancelOperation.
  1122. State string `json:"state,omitempty"`
  1123. // ForceSendFields is a list of field names (e.g. "EndTime") to
  1124. // unconditionally include in API requests. By default, fields with
  1125. // empty values are omitted from API requests. However, any non-pointer,
  1126. // non-interface field appearing in ForceSendFields will be sent to the
  1127. // server regardless of whether the field is empty or not. This may be
  1128. // used to include empty fields in Patch requests.
  1129. ForceSendFields []string `json:"-"`
  1130. // NullFields is a list of field names (e.g. "EndTime") to include in
  1131. // API requests with the JSON null value. By default, fields with empty
  1132. // values are omitted from API requests. However, any field with an
  1133. // empty value appearing in NullFields will be sent to the server as
  1134. // null. It is an error if a field in this list has a non-empty value.
  1135. // This may be used to include null fields in Patch requests.
  1136. NullFields []string `json:"-"`
  1137. }
  1138. func (s *GoogleDatastoreAdminV1beta1CommonMetadata) MarshalJSON() ([]byte, error) {
  1139. type NoMethod GoogleDatastoreAdminV1beta1CommonMetadata
  1140. raw := NoMethod(*s)
  1141. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1142. }
  1143. // GoogleDatastoreAdminV1beta1EntityFilter: Identifies a subset of
  1144. // entities in a project. This is specified as
  1145. // combinations of kinds and namespaces (either or both of which may be
  1146. // all, as
  1147. // described in the following examples).
  1148. // Example usage:
  1149. //
  1150. // Entire project:
  1151. // kinds=[], namespace_ids=[]
  1152. //
  1153. // Kinds Foo and Bar in all namespaces:
  1154. // kinds=['Foo', 'Bar'], namespace_ids=[]
  1155. //
  1156. // Kinds Foo and Bar only in the default namespace:
  1157. // kinds=['Foo', 'Bar'], namespace_ids=['']
  1158. //
  1159. // Kinds Foo and Bar in both the default and Baz namespaces:
  1160. // kinds=['Foo', 'Bar'], namespace_ids=['', 'Baz']
  1161. //
  1162. // The entire Baz namespace:
  1163. // kinds=[], namespace_ids=['Baz']
  1164. type GoogleDatastoreAdminV1beta1EntityFilter struct {
  1165. // Kinds: If empty, then this represents all kinds.
  1166. Kinds []string `json:"kinds,omitempty"`
  1167. // NamespaceIds: An empty list represents all namespaces. This is the
  1168. // preferred
  1169. // usage for projects that don't use namespaces.
  1170. //
  1171. // An empty string element represents the default namespace. This should
  1172. // be
  1173. // used if the project has data in non-default namespaces, but doesn't
  1174. // want to
  1175. // include them.
  1176. // Each namespace in this list must be unique.
  1177. NamespaceIds []string `json:"namespaceIds,omitempty"`
  1178. // ForceSendFields is a list of field names (e.g. "Kinds") to
  1179. // unconditionally include in API requests. By default, fields with
  1180. // empty values are omitted from API requests. However, any non-pointer,
  1181. // non-interface field appearing in ForceSendFields will be sent to the
  1182. // server regardless of whether the field is empty or not. This may be
  1183. // used to include empty fields in Patch requests.
  1184. ForceSendFields []string `json:"-"`
  1185. // NullFields is a list of field names (e.g. "Kinds") to include in API
  1186. // requests with the JSON null value. By default, fields with empty
  1187. // values are omitted from API requests. However, any field with an
  1188. // empty value appearing in NullFields will be sent to the server as
  1189. // null. It is an error if a field in this list has a non-empty value.
  1190. // This may be used to include null fields in Patch requests.
  1191. NullFields []string `json:"-"`
  1192. }
  1193. func (s *GoogleDatastoreAdminV1beta1EntityFilter) MarshalJSON() ([]byte, error) {
  1194. type NoMethod GoogleDatastoreAdminV1beta1EntityFilter
  1195. raw := NoMethod(*s)
  1196. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1197. }
  1198. // GoogleDatastoreAdminV1beta1ExportEntitiesMetadata: Metadata for
  1199. // ExportEntities operations.
  1200. type GoogleDatastoreAdminV1beta1ExportEntitiesMetadata struct {
  1201. // Common: Metadata common to all Datastore Admin operations.
  1202. Common *GoogleDatastoreAdminV1beta1CommonMetadata `json:"common,omitempty"`
  1203. // EntityFilter: Description of which entities are being exported.
  1204. EntityFilter *GoogleDatastoreAdminV1beta1EntityFilter `json:"entityFilter,omitempty"`
  1205. // OutputUrlPrefix: Location for the export metadata and data files.
  1206. // This will be the same
  1207. // value as
  1208. // the
  1209. // google.datastore.admin.v1beta1.ExportEntitiesRequest.output_url_pr
  1210. // efix
  1211. // field. The final output location is provided
  1212. // in
  1213. // google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url.
  1214. OutputUrlPrefix string `json:"outputUrlPrefix,omitempty"`
  1215. // ProgressBytes: An estimate of the number of bytes processed.
  1216. ProgressBytes *GoogleDatastoreAdminV1beta1Progress `json:"progressBytes,omitempty"`
  1217. // ProgressEntities: An estimate of the number of entities processed.
  1218. ProgressEntities *GoogleDatastoreAdminV1beta1Progress `json:"progressEntities,omitempty"`
  1219. // ForceSendFields is a list of field names (e.g. "Common") to
  1220. // unconditionally include in API requests. By default, fields with
  1221. // empty values are omitted from API requests. However, any non-pointer,
  1222. // non-interface field appearing in ForceSendFields will be sent to the
  1223. // server regardless of whether the field is empty or not. This may be
  1224. // used to include empty fields in Patch requests.
  1225. ForceSendFields []string `json:"-"`
  1226. // NullFields is a list of field names (e.g. "Common") to include in API
  1227. // requests with the JSON null value. By default, fields with empty
  1228. // values are omitted from API requests. However, any field with an
  1229. // empty value appearing in NullFields will be sent to the server as
  1230. // null. It is an error if a field in this list has a non-empty value.
  1231. // This may be used to include null fields in Patch requests.
  1232. NullFields []string `json:"-"`
  1233. }
  1234. func (s *GoogleDatastoreAdminV1beta1ExportEntitiesMetadata) MarshalJSON() ([]byte, error) {
  1235. type NoMethod GoogleDatastoreAdminV1beta1ExportEntitiesMetadata
  1236. raw := NoMethod(*s)
  1237. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1238. }
  1239. // GoogleDatastoreAdminV1beta1ExportEntitiesResponse: The response
  1240. // for
  1241. // google.datastore.admin.v1beta1.DatastoreAdmin.ExportEntities.
  1242. type GoogleDatastoreAdminV1beta1ExportEntitiesResponse struct {
  1243. // OutputUrl: Location of the output metadata file. This can be used to
  1244. // begin an import
  1245. // into Cloud Datastore (this project or another project).
  1246. // See
  1247. // google.datastore.admin.v1beta1.ImportEntitiesRequest.input_url.
  1248. // On
  1249. // ly present if the operation completed successfully.
  1250. OutputUrl string `json:"outputUrl,omitempty"`
  1251. // ForceSendFields is a list of field names (e.g. "OutputUrl") to
  1252. // unconditionally include in API requests. By default, fields with
  1253. // empty values are omitted from API requests. However, any non-pointer,
  1254. // non-interface field appearing in ForceSendFields will be sent to the
  1255. // server regardless of whether the field is empty or not. This may be
  1256. // used to include empty fields in Patch requests.
  1257. ForceSendFields []string `json:"-"`
  1258. // NullFields is a list of field names (e.g. "OutputUrl") to include in
  1259. // API requests with the JSON null value. By default, fields with empty
  1260. // values are omitted from API requests. However, any field with an
  1261. // empty value appearing in NullFields will be sent to the server as
  1262. // null. It is an error if a field in this list has a non-empty value.
  1263. // This may be used to include null fields in Patch requests.
  1264. NullFields []string `json:"-"`
  1265. }
  1266. func (s *GoogleDatastoreAdminV1beta1ExportEntitiesResponse) MarshalJSON() ([]byte, error) {
  1267. type NoMethod GoogleDatastoreAdminV1beta1ExportEntitiesResponse
  1268. raw := NoMethod(*s)
  1269. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1270. }
  1271. // GoogleDatastoreAdminV1beta1ImportEntitiesMetadata: Metadata for
  1272. // ImportEntities operations.
  1273. type GoogleDatastoreAdminV1beta1ImportEntitiesMetadata struct {
  1274. // Common: Metadata common to all Datastore Admin operations.
  1275. Common *GoogleDatastoreAdminV1beta1CommonMetadata `json:"common,omitempty"`
  1276. // EntityFilter: Description of which entities are being imported.
  1277. EntityFilter *GoogleDatastoreAdminV1beta1EntityFilter `json:"entityFilter,omitempty"`
  1278. // InputUrl: The location of the import metadata file. This will be the
  1279. // same value as
  1280. // the
  1281. // google.datastore.admin.v1beta1.ExportEntitiesResponse.output_url
  1282. // field
  1283. // .
  1284. InputUrl string `json:"inputUrl,omitempty"`
  1285. // ProgressBytes: An estimate of the number of bytes processed.
  1286. ProgressBytes *GoogleDatastoreAdminV1beta1Progress `json:"progressBytes,omitempty"`
  1287. // ProgressEntities: An estimate of the number of entities processed.
  1288. ProgressEntities *GoogleDatastoreAdminV1beta1Progress `json:"progressEntities,omitempty"`
  1289. // ForceSendFields is a list of field names (e.g. "Common") to
  1290. // unconditionally include in API requests. By default, fields with
  1291. // empty values are omitted from API requests. However, any non-pointer,
  1292. // non-interface field appearing in ForceSendFields will be sent to the
  1293. // server regardless of whether the field is empty or not. This may be
  1294. // used to include empty fields in Patch requests.
  1295. ForceSendFields []string `json:"-"`
  1296. // NullFields is a list of field names (e.g. "Common") to include in API
  1297. // requests with the JSON null value. By default, fields with empty
  1298. // values are omitted from API requests. However, any field with an
  1299. // empty value appearing in NullFields will be sent to the server as
  1300. // null. It is an error if a field in this list has a non-empty value.
  1301. // This may be used to include null fields in Patch requests.
  1302. NullFields []string `json:"-"`
  1303. }
  1304. func (s *GoogleDatastoreAdminV1beta1ImportEntitiesMetadata) MarshalJSON() ([]byte, error) {
  1305. type NoMethod GoogleDatastoreAdminV1beta1ImportEntitiesMetadata
  1306. raw := NoMethod(*s)
  1307. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1308. }
  1309. // GoogleDatastoreAdminV1beta1Progress: Measures the progress of a
  1310. // particular metric.
  1311. type GoogleDatastoreAdminV1beta1Progress struct {
  1312. // WorkCompleted: The amount of work that has been completed. Note that
  1313. // this may be greater
  1314. // than work_estimated.
  1315. WorkCompleted int64 `json:"workCompleted,omitempty,string"`
  1316. // WorkEstimated: An estimate of how much work needs to be performed.
  1317. // May be zero if the
  1318. // work estimate is unavailable.
  1319. WorkEstimated int64 `json:"workEstimated,omitempty,string"`
  1320. // ForceSendFields is a list of field names (e.g. "WorkCompleted") to
  1321. // unconditionally include in API requests. By default, fields with
  1322. // empty values are omitted from API requests. However, any non-pointer,
  1323. // non-interface field appearing in ForceSendFields will be sent to the
  1324. // server regardless of whether the field is empty or not. This may be
  1325. // used to include empty fields in Patch requests.
  1326. ForceSendFields []string `json:"-"`
  1327. // NullFields is a list of field names (e.g. "WorkCompleted") to include
  1328. // in API requests with the JSON null value. By default, fields with
  1329. // empty values are omitted from API requests. However, any field with
  1330. // an empty value appearing in NullFields will be sent to the server as
  1331. // null. It is an error if a field in this list has a non-empty value.
  1332. // This may be used to include null fields in Patch requests.
  1333. NullFields []string `json:"-"`
  1334. }
  1335. func (s *GoogleDatastoreAdminV1beta1Progress) MarshalJSON() ([]byte, error) {
  1336. type NoMethod GoogleDatastoreAdminV1beta1Progress
  1337. raw := NoMethod(*s)
  1338. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1339. }
  1340. // GoogleLongrunningListOperationsResponse: The response message for
  1341. // Operations.ListOperations.
  1342. type GoogleLongrunningListOperationsResponse struct {
  1343. // NextPageToken: The standard List next-page token.
  1344. NextPageToken string `json:"nextPageToken,omitempty"`
  1345. // Operations: A list of operations that matches the specified filter in
  1346. // the request.
  1347. Operations []*GoogleLongrunningOperation `json:"operations,omitempty"`
  1348. // ServerResponse contains the HTTP response code and headers from the
  1349. // server.
  1350. googleapi.ServerResponse `json:"-"`
  1351. // ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1352. // unconditionally include in API requests. By default, fields with
  1353. // empty values are omitted from API requests. However, any non-pointer,
  1354. // non-interface field appearing in ForceSendFields will be sent to the
  1355. // server regardless of whether the field is empty or not. This may be
  1356. // used to include empty fields in Patch requests.
  1357. ForceSendFields []string `json:"-"`
  1358. // NullFields is a list of field names (e.g. "NextPageToken") to include
  1359. // in API requests with the JSON null value. By default, fields with
  1360. // empty values are omitted from API requests. However, any field with
  1361. // an empty value appearing in NullFields will be sent to the server as
  1362. // null. It is an error if a field in this list has a non-empty value.
  1363. // This may be used to include null fields in Patch requests.
  1364. NullFields []string `json:"-"`
  1365. }
  1366. func (s *GoogleLongrunningListOperationsResponse) MarshalJSON() ([]byte, error) {
  1367. type NoMethod GoogleLongrunningListOperationsResponse
  1368. raw := NoMethod(*s)
  1369. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1370. }
  1371. // GoogleLongrunningOperation: This resource represents a long-running
  1372. // operation that is the result of a
  1373. // network API call.
  1374. type GoogleLongrunningOperation struct {
  1375. // Done: If the value is `false`, it means the operation is still in
  1376. // progress.
  1377. // If `true`, the operation is completed, and either `error` or
  1378. // `response` is
  1379. // available.
  1380. Done bool `json:"done,omitempty"`
  1381. // Error: The error result of the operation in case of failure or
  1382. // cancellation.
  1383. Error *Status `json:"error,omitempty"`
  1384. // Metadata: Service-specific metadata associated with the operation.
  1385. // It typically
  1386. // contains progress information and common metadata such as create
  1387. // time.
  1388. // Some services might not provide such metadata. Any method that
  1389. // returns a
  1390. // long-running operation should document the metadata type, if any.
  1391. Metadata googleapi.RawMessage `json:"metadata,omitempty"`
  1392. // Name: The server-assigned name, which is only unique within the same
  1393. // service that
  1394. // originally returns it. If you use the default HTTP mapping,
  1395. // the
  1396. // `name` should have the format of `operations/some/unique/name`.
  1397. Name string `json:"name,omitempty"`
  1398. // Response: The normal response of the operation in case of success.
  1399. // If the original
  1400. // method returns no data on success, such as `Delete`, the response
  1401. // is
  1402. // `google.protobuf.Empty`. If the original method is
  1403. // standard
  1404. // `Get`/`Create`/`Update`, the response should be the resource. For
  1405. // other
  1406. // methods, the response should have the type `XxxResponse`, where
  1407. // `Xxx`
  1408. // is the original method name. For example, if the original method
  1409. // name
  1410. // is `TakeSnapshot()`, the inferred response type
  1411. // is
  1412. // `TakeSnapshotResponse`.
  1413. Response googleapi.RawMessage `json:"response,omitempty"`
  1414. // ServerResponse contains the HTTP response code and headers from the
  1415. // server.
  1416. googleapi.ServerResponse `json:"-"`
  1417. // ForceSendFields is a list of field names (e.g. "Done") to
  1418. // unconditionally include in API requests. By default, fields with
  1419. // empty values are omitted from API requests. However, any non-pointer,
  1420. // non-interface field appearing in ForceSendFields will be sent to the
  1421. // server regardless of whether the field is empty or not. This may be
  1422. // used to include empty fields in Patch requests.
  1423. ForceSendFields []string `json:"-"`
  1424. // NullFields is a list of field names (e.g. "Done") to include in API
  1425. // requests with the JSON null value. By default, fields with empty
  1426. // values are omitted from API requests. However, any field with an
  1427. // empty value appearing in NullFields will be sent to the server as
  1428. // null. It is an error if a field in this list has a non-empty value.
  1429. // This may be used to include null fields in Patch requests.
  1430. NullFields []string `json:"-"`
  1431. }
  1432. func (s *GoogleLongrunningOperation) MarshalJSON() ([]byte, error) {
  1433. type NoMethod GoogleLongrunningOperation
  1434. raw := NoMethod(*s)
  1435. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1436. }
  1437. // GqlQuery: A [GQL
  1438. // query](https://cloud.google.com/datastore/docs/apis/gql/gql_reference)
  1439. // .
  1440. type GqlQuery struct {
  1441. // AllowLiterals: When false, the query string must not contain any
  1442. // literals and instead must
  1443. // bind all values. For example,
  1444. // `SELECT * FROM Kind WHERE a = 'string literal'` is not allowed,
  1445. // while
  1446. // `SELECT * FROM Kind WHERE a = @value` is.
  1447. AllowLiterals bool `json:"allowLiterals,omitempty"`
  1448. // NamedBindings: For each non-reserved named binding site in the query
  1449. // string, there must be
  1450. // a named parameter with that name, but not necessarily the
  1451. // inverse.
  1452. //
  1453. // Key must match regex `A-Za-z_$*`, must not match regex
  1454. // `__.*__`, and must not be "".
  1455. NamedBindings map[string]GqlQueryParameter `json:"namedBindings,omitempty"`
  1456. // PositionalBindings: Numbered binding site @1 references the first
  1457. // numbered parameter,
  1458. // effectively using 1-based indexing, rather than the usual 0.
  1459. //
  1460. // For each binding site numbered i in `query_string`, there must be an
  1461. // i-th
  1462. // numbered parameter. The inverse must also be true.
  1463. PositionalBindings []*GqlQueryParameter `json:"positionalBindings,omitempty"`
  1464. // QueryString: A string of the format
  1465. // described
  1466. // [here](https://cloud.google.com/datastore/docs/apis/gql/gql_
  1467. // reference).
  1468. QueryString string `json:"queryString,omitempty"`
  1469. // ForceSendFields is a list of field names (e.g. "AllowLiterals") to
  1470. // unconditionally include in API requests. By default, fields with
  1471. // empty values are omitted from API requests. However, any non-pointer,
  1472. // non-interface field appearing in ForceSendFields will be sent to the
  1473. // server regardless of whether the field is empty or not. This may be
  1474. // used to include empty fields in Patch requests.
  1475. ForceSendFields []string `json:"-"`
  1476. // NullFields is a list of field names (e.g. "AllowLiterals") to include
  1477. // in API requests with the JSON null value. By default, fields with
  1478. // empty values are omitted from API requests. However, any field with
  1479. // an empty value appearing in NullFields will be sent to the server as
  1480. // null. It is an error if a field in this list has a non-empty value.
  1481. // This may be used to include null fields in Patch requests.
  1482. NullFields []string `json:"-"`
  1483. }
  1484. func (s *GqlQuery) MarshalJSON() ([]byte, error) {
  1485. type NoMethod GqlQuery
  1486. raw := NoMethod(*s)
  1487. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1488. }
  1489. // GqlQueryParameter: A binding parameter for a GQL query.
  1490. type GqlQueryParameter struct {
  1491. // Cursor: A query cursor. Query cursors are returned in query
  1492. // result batches.
  1493. Cursor string `json:"cursor,omitempty"`
  1494. // Value: A value parameter.
  1495. Value *Value `json:"value,omitempty"`
  1496. // ForceSendFields is a list of field names (e.g. "Cursor") to
  1497. // unconditionally include in API requests. By default, fields with
  1498. // empty values are omitted from API requests. However, any non-pointer,
  1499. // non-interface field appearing in ForceSendFields will be sent to the
  1500. // server regardless of whether the field is empty or not. This may be
  1501. // used to include empty fields in Patch requests.
  1502. ForceSendFields []string `json:"-"`
  1503. // NullFields is a list of field names (e.g. "Cursor") to include in API
  1504. // requests with the JSON null value. By default, fields with empty
  1505. // values are omitted from API requests. However, any field with an
  1506. // empty value appearing in NullFields will be sent to the server as
  1507. // null. It is an error if a field in this list has a non-empty value.
  1508. // This may be used to include null fields in Patch requests.
  1509. NullFields []string `json:"-"`
  1510. }
  1511. func (s *GqlQueryParameter) MarshalJSON() ([]byte, error) {
  1512. type NoMethod GqlQueryParameter
  1513. raw := NoMethod(*s)
  1514. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1515. }
  1516. // Key: A unique identifier for an entity.
  1517. // If a key's partition ID or any of its path kinds or names
  1518. // are
  1519. // reserved/read-only, the key is reserved/read-only.
  1520. // A reserved/read-only key is forbidden in certain documented contexts.
  1521. type Key struct {
  1522. // PartitionId: Entities are partitioned into subsets, currently
  1523. // identified by a project
  1524. // ID and namespace ID.
  1525. // Queries are scoped to a single partition.
  1526. PartitionId *PartitionId `json:"partitionId,omitempty"`
  1527. // Path: The entity path.
  1528. // An entity path consists of one or more elements composed of a kind
  1529. // and a
  1530. // string or numerical identifier, which identify entities. The
  1531. // first
  1532. // element identifies a _root entity_, the second element identifies
  1533. // a _child_ of the root entity, the third element identifies a child of
  1534. // the
  1535. // second entity, and so forth. The entities identified by all prefixes
  1536. // of
  1537. // the path are called the element's _ancestors_.
  1538. //
  1539. // An entity path is always fully complete: *all* of the entity's
  1540. // ancestors
  1541. // are required to be in the path along with the entity identifier
  1542. // itself.
  1543. // The only exception is that in some documented cases, the identifier
  1544. // in the
  1545. // last path element (for the entity) itself may be omitted. For
  1546. // example,
  1547. // the last path element of the key of `Mutation.insert` may have
  1548. // no
  1549. // identifier.
  1550. //
  1551. // A path can never be empty, and a path can have at most 100 elements.
  1552. Path []*PathElement `json:"path,omitempty"`
  1553. // ForceSendFields is a list of field names (e.g. "PartitionId") to
  1554. // unconditionally include in API requests. By default, fields with
  1555. // empty values are omitted from API requests. However, any non-pointer,
  1556. // non-interface field appearing in ForceSendFields will be sent to the
  1557. // server regardless of whether the field is empty or not. This may be
  1558. // used to include empty fields in Patch requests.
  1559. ForceSendFields []string `json:"-"`
  1560. // NullFields is a list of field names (e.g. "PartitionId") to include
  1561. // in API requests with the JSON null value. By default, fields with
  1562. // empty values are omitted from API requests. However, any field with
  1563. // an empty value appearing in NullFields will be sent to the server as
  1564. // null. It is an error if a field in this list has a non-empty value.
  1565. // This may be used to include null fields in Patch requests.
  1566. NullFields []string `json:"-"`
  1567. }
  1568. func (s *Key) MarshalJSON() ([]byte, error) {
  1569. type NoMethod Key
  1570. raw := NoMethod(*s)
  1571. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1572. }
  1573. // KindExpression: A representation of a kind.
  1574. type KindExpression struct {
  1575. // Name: The name of the kind.
  1576. Name string `json:"name,omitempty"`
  1577. // ForceSendFields is a list of field names (e.g. "Name") to
  1578. // unconditionally include in API requests. By default, fields with
  1579. // empty values are omitted from API requests. However, any non-pointer,
  1580. // non-interface field appearing in ForceSendFields will be sent to the
  1581. // server regardless of whether the field is empty or not. This may be
  1582. // used to include empty fields in Patch requests.
  1583. ForceSendFields []string `json:"-"`
  1584. // NullFields is a list of field names (e.g. "Name") to include in API
  1585. // requests with the JSON null value. By default, fields with empty
  1586. // values are omitted from API requests. However, any field with an
  1587. // empty value appearing in NullFields will be sent to the server as
  1588. // null. It is an error if a field in this list has a non-empty value.
  1589. // This may be used to include null fields in Patch requests.
  1590. NullFields []string `json:"-"`
  1591. }
  1592. func (s *KindExpression) MarshalJSON() ([]byte, error) {
  1593. type NoMethod KindExpression
  1594. raw := NoMethod(*s)
  1595. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1596. }
  1597. // LatLng: An object representing a latitude/longitude pair. This is
  1598. // expressed as a pair
  1599. // of doubles representing degrees latitude and degrees longitude.
  1600. // Unless
  1601. // specified otherwise, this must conform to the
  1602. // <a
  1603. // href="http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf">WGS84
  1604. // st
  1605. // andard</a>. Values must be within normalized ranges.
  1606. type LatLng struct {
  1607. // Latitude: The latitude in degrees. It must be in the range [-90.0,
  1608. // +90.0].
  1609. Latitude float64 `json:"latitude,omitempty"`
  1610. // Longitude: The longitude in degrees. It must be in the range [-180.0,
  1611. // +180.0].
  1612. Longitude float64 `json:"longitude,omitempty"`
  1613. // ForceSendFields is a list of field names (e.g. "Latitude") to
  1614. // unconditionally include in API requests. By default, fields with
  1615. // empty values are omitted from API requests. However, any non-pointer,
  1616. // non-interface field appearing in ForceSendFields will be sent to the
  1617. // server regardless of whether the field is empty or not. This may be
  1618. // used to include empty fields in Patch requests.
  1619. ForceSendFields []string `json:"-"`
  1620. // NullFields is a list of field names (e.g. "Latitude") to include in
  1621. // API requests with the JSON null value. By default, fields with empty
  1622. // values are omitted from API requests. However, any field with an
  1623. // empty value appearing in NullFields will be sent to the server as
  1624. // null. It is an error if a field in this list has a non-empty value.
  1625. // This may be used to include null fields in Patch requests.
  1626. NullFields []string `json:"-"`
  1627. }
  1628. func (s *LatLng) MarshalJSON() ([]byte, error) {
  1629. type NoMethod LatLng
  1630. raw := NoMethod(*s)
  1631. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1632. }
  1633. func (s *LatLng) UnmarshalJSON(data []byte) error {
  1634. type NoMethod LatLng
  1635. var s1 struct {
  1636. Latitude gensupport.JSONFloat64 `json:"latitude"`
  1637. Longitude gensupport.JSONFloat64 `json:"longitude"`
  1638. *NoMethod
  1639. }
  1640. s1.NoMethod = (*NoMethod)(s)
  1641. if err := json.Unmarshal(data, &s1); err != nil {
  1642. return err
  1643. }
  1644. s.Latitude = float64(s1.Latitude)
  1645. s.Longitude = float64(s1.Longitude)
  1646. return nil
  1647. }
  1648. // LookupRequest: The request for Datastore.Lookup.
  1649. type LookupRequest struct {
  1650. // Keys: Keys of entities to look up.
  1651. Keys []*Key `json:"keys,omitempty"`
  1652. // ReadOptions: The options for this lookup request.
  1653. ReadOptions *ReadOptions `json:"readOptions,omitempty"`
  1654. // ForceSendFields is a list of field names (e.g. "Keys") to
  1655. // unconditionally include in API requests. By default, fields with
  1656. // empty values are omitted from API requests. However, any non-pointer,
  1657. // non-interface field appearing in ForceSendFields will be sent to the
  1658. // server regardless of whether the field is empty or not. This may be
  1659. // used to include empty fields in Patch requests.
  1660. ForceSendFields []string `json:"-"`
  1661. // NullFields is a list of field names (e.g. "Keys") to include in API
  1662. // requests with the JSON null value. By default, fields with empty
  1663. // values are omitted from API requests. However, any field with an
  1664. // empty value appearing in NullFields will be sent to the server as
  1665. // null. It is an error if a field in this list has a non-empty value.
  1666. // This may be used to include null fields in Patch requests.
  1667. NullFields []string `json:"-"`
  1668. }
  1669. func (s *LookupRequest) MarshalJSON() ([]byte, error) {
  1670. type NoMethod LookupRequest
  1671. raw := NoMethod(*s)
  1672. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1673. }
  1674. // LookupResponse: The response for Datastore.Lookup.
  1675. type LookupResponse struct {
  1676. // Deferred: A list of keys that were not looked up due to resource
  1677. // constraints. The
  1678. // order of results in this field is undefined and has no relation to
  1679. // the
  1680. // order of the keys in the input.
  1681. Deferred []*Key `json:"deferred,omitempty"`
  1682. // Found: Entities found as `ResultType.FULL` entities. The order of
  1683. // results in this
  1684. // field is undefined and has no relation to the order of the keys in
  1685. // the
  1686. // input.
  1687. Found []*EntityResult `json:"found,omitempty"`
  1688. // Missing: Entities not found as `ResultType.KEY_ONLY` entities. The
  1689. // order of results
  1690. // in this field is undefined and has no relation to the order of the
  1691. // keys
  1692. // in the input.
  1693. Missing []*EntityResult `json:"missing,omitempty"`
  1694. // ServerResponse contains the HTTP response code and headers from the
  1695. // server.
  1696. googleapi.ServerResponse `json:"-"`
  1697. // ForceSendFields is a list of field names (e.g. "Deferred") to
  1698. // unconditionally include in API requests. By default, fields with
  1699. // empty values are omitted from API requests. However, any non-pointer,
  1700. // non-interface field appearing in ForceSendFields will be sent to the
  1701. // server regardless of whether the field is empty or not. This may be
  1702. // used to include empty fields in Patch requests.
  1703. ForceSendFields []string `json:"-"`
  1704. // NullFields is a list of field names (e.g. "Deferred") to include in
  1705. // API requests with the JSON null value. By default, fields with empty
  1706. // values are omitted from API requests. However, any field with an
  1707. // empty value appearing in NullFields will be sent to the server as
  1708. // null. It is an error if a field in this list has a non-empty value.
  1709. // This may be used to include null fields in Patch requests.
  1710. NullFields []string `json:"-"`
  1711. }
  1712. func (s *LookupResponse) MarshalJSON() ([]byte, error) {
  1713. type NoMethod LookupResponse
  1714. raw := NoMethod(*s)
  1715. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1716. }
  1717. // Mutation: A mutation to apply to an entity.
  1718. type Mutation struct {
  1719. // BaseVersion: The version of the entity that this mutation is being
  1720. // applied to. If this
  1721. // does not match the current version on the server, the mutation
  1722. // conflicts.
  1723. BaseVersion int64 `json:"baseVersion,omitempty,string"`
  1724. // Delete: The key of the entity to delete. The entity may or may not
  1725. // already exist.
  1726. // Must have a complete key path and must not be reserved/read-only.
  1727. Delete *Key `json:"delete,omitempty"`
  1728. // Insert: The entity to insert. The entity must not already exist.
  1729. // The entity key's final path element may be incomplete.
  1730. Insert *Entity `json:"insert,omitempty"`
  1731. // Update: The entity to update. The entity must already exist.
  1732. // Must have a complete key path.
  1733. Update *Entity `json:"update,omitempty"`
  1734. // Upsert: The entity to upsert. The entity may or may not already
  1735. // exist.
  1736. // The entity key's final path element may be incomplete.
  1737. Upsert *Entity `json:"upsert,omitempty"`
  1738. // ForceSendFields is a list of field names (e.g. "BaseVersion") to
  1739. // unconditionally include in API requests. By default, fields with
  1740. // empty values are omitted from API requests. However, any non-pointer,
  1741. // non-interface field appearing in ForceSendFields will be sent to the
  1742. // server regardless of whether the field is empty or not. This may be
  1743. // used to include empty fields in Patch requests.
  1744. ForceSendFields []string `json:"-"`
  1745. // NullFields is a list of field names (e.g. "BaseVersion") to include
  1746. // in API requests with the JSON null value. By default, fields with
  1747. // empty values are omitted from API requests. However, any field with
  1748. // an empty value appearing in NullFields will be sent to the server as
  1749. // null. It is an error if a field in this list has a non-empty value.
  1750. // This may be used to include null fields in Patch requests.
  1751. NullFields []string `json:"-"`
  1752. }
  1753. func (s *Mutation) MarshalJSON() ([]byte, error) {
  1754. type NoMethod Mutation
  1755. raw := NoMethod(*s)
  1756. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1757. }
  1758. // MutationResult: The result of applying a mutation.
  1759. type MutationResult struct {
  1760. // ConflictDetected: Whether a conflict was detected for this mutation.
  1761. // Always false when a
  1762. // conflict detection strategy field is not set in the mutation.
  1763. ConflictDetected bool `json:"conflictDetected,omitempty"`
  1764. // Key: The automatically allocated key.
  1765. // Set only when the mutation allocated a key.
  1766. Key *Key `json:"key,omitempty"`
  1767. // Version: The version of the entity on the server after processing the
  1768. // mutation. If
  1769. // the mutation doesn't change anything on the server, then the version
  1770. // will
  1771. // be the version of the current entity or, if no entity is present, a
  1772. // version
  1773. // that is strictly greater than the version of any previous entity and
  1774. // less
  1775. // than the version of any possible future entity.
  1776. Version int64 `json:"version,omitempty,string"`
  1777. // ForceSendFields is a list of field names (e.g. "ConflictDetected") to
  1778. // unconditionally include in API requests. By default, fields with
  1779. // empty values are omitted from API requests. However, any non-pointer,
  1780. // non-interface field appearing in ForceSendFields will be sent to the
  1781. // server regardless of whether the field is empty or not. This may be
  1782. // used to include empty fields in Patch requests.
  1783. ForceSendFields []string `json:"-"`
  1784. // NullFields is a list of field names (e.g. "ConflictDetected") to
  1785. // include in API requests with the JSON null value. By default, fields
  1786. // with empty values are omitted from API requests. However, any field
  1787. // with an empty value appearing in NullFields will be sent to the
  1788. // server as null. It is an error if a field in this list has a
  1789. // non-empty value. This may be used to include null fields in Patch
  1790. // requests.
  1791. NullFields []string `json:"-"`
  1792. }
  1793. func (s *MutationResult) MarshalJSON() ([]byte, error) {
  1794. type NoMethod MutationResult
  1795. raw := NoMethod(*s)
  1796. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1797. }
  1798. // PartitionId: A partition ID identifies a grouping of entities. The
  1799. // grouping is always
  1800. // by project and namespace, however the namespace ID may be empty.
  1801. //
  1802. // A partition ID contains several dimensions:
  1803. // project ID and namespace ID.
  1804. //
  1805. // Partition dimensions:
  1806. //
  1807. // - May be "".
  1808. // - Must be valid UTF-8 bytes.
  1809. // - Must have values that match regex `[A-Za-z\d\.\-_]{1,100}`
  1810. // If the value of any dimension matches regex `__.*__`, the partition
  1811. // is
  1812. // reserved/read-only.
  1813. // A reserved/read-only partition ID is forbidden in certain
  1814. // documented
  1815. // contexts.
  1816. //
  1817. // Foreign partition IDs (in which the project ID does
  1818. // not match the context project ID ) are discouraged.
  1819. // Reads and writes of foreign partition IDs may fail if the project is
  1820. // not in an active state.
  1821. type PartitionId struct {
  1822. // NamespaceId: If not empty, the ID of the namespace to which the
  1823. // entities belong.
  1824. NamespaceId string `json:"namespaceId,omitempty"`
  1825. // ProjectId: The ID of the project to which the entities belong.
  1826. ProjectId string `json:"projectId,omitempty"`
  1827. // ForceSendFields is a list of field names (e.g. "NamespaceId") to
  1828. // unconditionally include in API requests. By default, fields with
  1829. // empty values are omitted from API requests. However, any non-pointer,
  1830. // non-interface field appearing in ForceSendFields will be sent to the
  1831. // server regardless of whether the field is empty or not. This may be
  1832. // used to include empty fields in Patch requests.
  1833. ForceSendFields []string `json:"-"`
  1834. // NullFields is a list of field names (e.g. "NamespaceId") to include
  1835. // in API requests with the JSON null value. By default, fields with
  1836. // empty values are omitted from API requests. However, any field with
  1837. // an empty value appearing in NullFields will be sent to the server as
  1838. // null. It is an error if a field in this list has a non-empty value.
  1839. // This may be used to include null fields in Patch requests.
  1840. NullFields []string `json:"-"`
  1841. }
  1842. func (s *PartitionId) MarshalJSON() ([]byte, error) {
  1843. type NoMethod PartitionId
  1844. raw := NoMethod(*s)
  1845. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1846. }
  1847. // PathElement: A (kind, ID/name) pair used to construct a key path.
  1848. //
  1849. // If either name or ID is set, the element is complete.
  1850. // If neither is set, the element is incomplete.
  1851. type PathElement struct {
  1852. // Id: The auto-allocated ID of the entity.
  1853. // Never equal to zero. Values less than zero are discouraged and may
  1854. // not
  1855. // be supported in the future.
  1856. Id int64 `json:"id,omitempty,string"`
  1857. // Kind: The kind of the entity.
  1858. // A kind matching regex `__.*__` is reserved/read-only.
  1859. // A kind must not contain more than 1500 bytes when UTF-8
  1860. // encoded.
  1861. // Cannot be "".
  1862. Kind string `json:"kind,omitempty"`
  1863. // Name: The name of the entity.
  1864. // A name matching regex `__.*__` is reserved/read-only.
  1865. // A name must not be more than 1500 bytes when UTF-8 encoded.
  1866. // Cannot be "".
  1867. Name string `json:"name,omitempty"`
  1868. // ForceSendFields is a list of field names (e.g. "Id") to
  1869. // unconditionally include in API requests. By default, fields with
  1870. // empty values are omitted from API requests. However, any non-pointer,
  1871. // non-interface field appearing in ForceSendFields will be sent to the
  1872. // server regardless of whether the field is empty or not. This may be
  1873. // used to include empty fields in Patch requests.
  1874. ForceSendFields []string `json:"-"`
  1875. // NullFields is a list of field names (e.g. "Id") to include in API
  1876. // requests with the JSON null value. By default, fields with empty
  1877. // values are omitted from API requests. However, any field with an
  1878. // empty value appearing in NullFields will be sent to the server as
  1879. // null. It is an error if a field in this list has a non-empty value.
  1880. // This may be used to include null fields in Patch requests.
  1881. NullFields []string `json:"-"`
  1882. }
  1883. func (s *PathElement) MarshalJSON() ([]byte, error) {
  1884. type NoMethod PathElement
  1885. raw := NoMethod(*s)
  1886. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1887. }
  1888. // Projection: A representation of a property in a projection.
  1889. type Projection struct {
  1890. // Property: The property to project.
  1891. Property *PropertyReference `json:"property,omitempty"`
  1892. // ForceSendFields is a list of field names (e.g. "Property") to
  1893. // unconditionally include in API requests. By default, fields with
  1894. // empty values are omitted from API requests. However, any non-pointer,
  1895. // non-interface field appearing in ForceSendFields will be sent to the
  1896. // server regardless of whether the field is empty or not. This may be
  1897. // used to include empty fields in Patch requests.
  1898. ForceSendFields []string `json:"-"`
  1899. // NullFields is a list of field names (e.g. "Property") to include in
  1900. // API requests with the JSON null value. By default, fields with empty
  1901. // values are omitted from API requests. However, any field with an
  1902. // empty value appearing in NullFields will be sent to the server as
  1903. // null. It is an error if a field in this list has a non-empty value.
  1904. // This may be used to include null fields in Patch requests.
  1905. NullFields []string `json:"-"`
  1906. }
  1907. func (s *Projection) MarshalJSON() ([]byte, error) {
  1908. type NoMethod Projection
  1909. raw := NoMethod(*s)
  1910. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1911. }
  1912. // PropertyFilter: A filter on a specific property.
  1913. type PropertyFilter struct {
  1914. // Op: The operator to filter by.
  1915. //
  1916. // Possible values:
  1917. // "OPERATOR_UNSPECIFIED" - Unspecified. This value must not be used.
  1918. // "LESS_THAN" - Less than.
  1919. // "LESS_THAN_OR_EQUAL" - Less than or equal.
  1920. // "GREATER_THAN" - Greater than.
  1921. // "GREATER_THAN_OR_EQUAL" - Greater than or equal.
  1922. // "EQUAL" - Equal.
  1923. // "HAS_ANCESTOR" - Has ancestor.
  1924. Op string `json:"op,omitempty"`
  1925. // Property: The property to filter by.
  1926. Property *PropertyReference `json:"property,omitempty"`
  1927. // Value: The value to compare the property to.
  1928. Value *Value `json:"value,omitempty"`
  1929. // ForceSendFields is a list of field names (e.g. "Op") to
  1930. // unconditionally include in API requests. By default, fields with
  1931. // empty values are omitted from API requests. However, any non-pointer,
  1932. // non-interface field appearing in ForceSendFields will be sent to the
  1933. // server regardless of whether the field is empty or not. This may be
  1934. // used to include empty fields in Patch requests.
  1935. ForceSendFields []string `json:"-"`
  1936. // NullFields is a list of field names (e.g. "Op") to include in API
  1937. // requests with the JSON null value. By default, fields with empty
  1938. // values are omitted from API requests. However, any field with an
  1939. // empty value appearing in NullFields will be sent to the server as
  1940. // null. It is an error if a field in this list has a non-empty value.
  1941. // This may be used to include null fields in Patch requests.
  1942. NullFields []string `json:"-"`
  1943. }
  1944. func (s *PropertyFilter) MarshalJSON() ([]byte, error) {
  1945. type NoMethod PropertyFilter
  1946. raw := NoMethod(*s)
  1947. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1948. }
  1949. // PropertyOrder: The desired order for a specific property.
  1950. type PropertyOrder struct {
  1951. // Direction: The direction to order by. Defaults to `ASCENDING`.
  1952. //
  1953. // Possible values:
  1954. // "DIRECTION_UNSPECIFIED" - Unspecified. This value must not be used.
  1955. // "ASCENDING" - Ascending.
  1956. // "DESCENDING" - Descending.
  1957. Direction string `json:"direction,omitempty"`
  1958. // Property: The property to order by.
  1959. Property *PropertyReference `json:"property,omitempty"`
  1960. // ForceSendFields is a list of field names (e.g. "Direction") to
  1961. // unconditionally include in API requests. By default, fields with
  1962. // empty values are omitted from API requests. However, any non-pointer,
  1963. // non-interface field appearing in ForceSendFields will be sent to the
  1964. // server regardless of whether the field is empty or not. This may be
  1965. // used to include empty fields in Patch requests.
  1966. ForceSendFields []string `json:"-"`
  1967. // NullFields is a list of field names (e.g. "Direction") to include in
  1968. // API requests with the JSON null value. By default, fields with empty
  1969. // values are omitted from API requests. However, any field with an
  1970. // empty value appearing in NullFields will be sent to the server as
  1971. // null. It is an error if a field in this list has a non-empty value.
  1972. // This may be used to include null fields in Patch requests.
  1973. NullFields []string `json:"-"`
  1974. }
  1975. func (s *PropertyOrder) MarshalJSON() ([]byte, error) {
  1976. type NoMethod PropertyOrder
  1977. raw := NoMethod(*s)
  1978. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  1979. }
  1980. // PropertyReference: A reference to a property relative to the kind
  1981. // expressions.
  1982. type PropertyReference struct {
  1983. // Name: The name of the property.
  1984. // If name includes "."s, it may be interpreted as a property name path.
  1985. Name string `json:"name,omitempty"`
  1986. // ForceSendFields is a list of field names (e.g. "Name") to
  1987. // unconditionally include in API requests. By default, fields with
  1988. // empty values are omitted from API requests. However, any non-pointer,
  1989. // non-interface field appearing in ForceSendFields will be sent to the
  1990. // server regardless of whether the field is empty or not. This may be
  1991. // used to include empty fields in Patch requests.
  1992. ForceSendFields []string `json:"-"`
  1993. // NullFields is a list of field names (e.g. "Name") to include in API
  1994. // requests with the JSON null value. By default, fields with empty
  1995. // values are omitted from API requests. However, any field with an
  1996. // empty value appearing in NullFields will be sent to the server as
  1997. // null. It is an error if a field in this list has a non-empty value.
  1998. // This may be used to include null fields in Patch requests.
  1999. NullFields []string `json:"-"`
  2000. }
  2001. func (s *PropertyReference) MarshalJSON() ([]byte, error) {
  2002. type NoMethod PropertyReference
  2003. raw := NoMethod(*s)
  2004. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2005. }
  2006. // Query: A query for entities.
  2007. type Query struct {
  2008. // DistinctOn: The properties to make distinct. The query results will
  2009. // contain the first
  2010. // result for each distinct combination of values for the given
  2011. // properties
  2012. // (if empty, all results are returned).
  2013. DistinctOn []*PropertyReference `json:"distinctOn,omitempty"`
  2014. // EndCursor: An ending point for the query results. Query cursors
  2015. // are
  2016. // returned in query result batches and
  2017. // [can only be used to limit the same
  2018. // query](https://cloud.google.com/datastore/docs/concepts/queries#cursor
  2019. // s_limits_and_offsets).
  2020. EndCursor string `json:"endCursor,omitempty"`
  2021. // Filter: The filter to apply.
  2022. Filter *Filter `json:"filter,omitempty"`
  2023. // Kind: The kinds to query (if empty, returns entities of all
  2024. // kinds).
  2025. // Currently at most 1 kind may be specified.
  2026. Kind []*KindExpression `json:"kind,omitempty"`
  2027. // Limit: The maximum number of results to return. Applies after all
  2028. // other
  2029. // constraints. Optional.
  2030. // Unspecified is interpreted as no limit.
  2031. // Must be >= 0 if specified.
  2032. Limit int64 `json:"limit,omitempty"`
  2033. // Offset: The number of results to skip. Applies before limit, but
  2034. // after all other
  2035. // constraints. Optional. Must be >= 0 if specified.
  2036. Offset int64 `json:"offset,omitempty"`
  2037. // Order: The order to apply to the query results (if empty, order is
  2038. // unspecified).
  2039. Order []*PropertyOrder `json:"order,omitempty"`
  2040. // Projection: The projection to return. Defaults to returning all
  2041. // properties.
  2042. Projection []*Projection `json:"projection,omitempty"`
  2043. // StartCursor: A starting point for the query results. Query cursors
  2044. // are
  2045. // returned in query result batches and
  2046. // [can only be used to continue the same
  2047. // query](https://cloud.google.com/datastore/docs/concepts/queries#cursor
  2048. // s_limits_and_offsets).
  2049. StartCursor string `json:"startCursor,omitempty"`
  2050. // ForceSendFields is a list of field names (e.g. "DistinctOn") to
  2051. // unconditionally include in API requests. By default, fields with
  2052. // empty values are omitted from API requests. However, any non-pointer,
  2053. // non-interface field appearing in ForceSendFields will be sent to the
  2054. // server regardless of whether the field is empty or not. This may be
  2055. // used to include empty fields in Patch requests.
  2056. ForceSendFields []string `json:"-"`
  2057. // NullFields is a list of field names (e.g. "DistinctOn") to include in
  2058. // API requests with the JSON null value. By default, fields with empty
  2059. // values are omitted from API requests. However, any field with an
  2060. // empty value appearing in NullFields will be sent to the server as
  2061. // null. It is an error if a field in this list has a non-empty value.
  2062. // This may be used to include null fields in Patch requests.
  2063. NullFields []string `json:"-"`
  2064. }
  2065. func (s *Query) MarshalJSON() ([]byte, error) {
  2066. type NoMethod Query
  2067. raw := NoMethod(*s)
  2068. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2069. }
  2070. // QueryResultBatch: A batch of results produced by a query.
  2071. type QueryResultBatch struct {
  2072. // EndCursor: A cursor that points to the position after the last result
  2073. // in the batch.
  2074. EndCursor string `json:"endCursor,omitempty"`
  2075. // EntityResultType: The result type for every entity in
  2076. // `entity_results`.
  2077. //
  2078. // Possible values:
  2079. // "RESULT_TYPE_UNSPECIFIED" - Unspecified. This value is never used.
  2080. // "FULL" - The key and properties.
  2081. // "PROJECTION" - A projected subset of properties. The entity may
  2082. // have no key.
  2083. // "KEY_ONLY" - Only the key.
  2084. EntityResultType string `json:"entityResultType,omitempty"`
  2085. // EntityResults: The results for this batch.
  2086. EntityResults []*EntityResult `json:"entityResults,omitempty"`
  2087. // MoreResults: The state of the query after the current batch.
  2088. //
  2089. // Possible values:
  2090. // "MORE_RESULTS_TYPE_UNSPECIFIED" - Unspecified. This value is never
  2091. // used.
  2092. // "NOT_FINISHED" - There may be additional batches to fetch from this
  2093. // query.
  2094. // "MORE_RESULTS_AFTER_LIMIT" - The query is finished, but there may
  2095. // be more results after the limit.
  2096. // "MORE_RESULTS_AFTER_CURSOR" - The query is finished, but there may
  2097. // be more results after the end
  2098. // cursor.
  2099. // "NO_MORE_RESULTS" - The query is finished, and there are no more
  2100. // results.
  2101. MoreResults string `json:"moreResults,omitempty"`
  2102. // SkippedCursor: A cursor that points to the position after the last
  2103. // skipped result.
  2104. // Will be set when `skipped_results` != 0.
  2105. SkippedCursor string `json:"skippedCursor,omitempty"`
  2106. // SkippedResults: The number of results skipped, typically because of
  2107. // an offset.
  2108. SkippedResults int64 `json:"skippedResults,omitempty"`
  2109. // SnapshotVersion: The version number of the snapshot this batch was
  2110. // returned from.
  2111. // This applies to the range of results from the query's `start_cursor`
  2112. // (or
  2113. // the beginning of the query if no cursor was given) to this
  2114. // batch's
  2115. // `end_cursor` (not the query's `end_cursor`).
  2116. //
  2117. // In a single transaction, subsequent query result batches for the same
  2118. // query
  2119. // can have a greater snapshot version number. Each batch's snapshot
  2120. // version
  2121. // is valid for all preceding batches.
  2122. // The value will be zero for eventually consistent queries.
  2123. SnapshotVersion int64 `json:"snapshotVersion,omitempty,string"`
  2124. // ForceSendFields is a list of field names (e.g. "EndCursor") to
  2125. // unconditionally include in API requests. By default, fields with
  2126. // empty values are omitted from API requests. However, any non-pointer,
  2127. // non-interface field appearing in ForceSendFields will be sent to the
  2128. // server regardless of whether the field is empty or not. This may be
  2129. // used to include empty fields in Patch requests.
  2130. ForceSendFields []string `json:"-"`
  2131. // NullFields is a list of field names (e.g. "EndCursor") to include in
  2132. // API requests with the JSON null value. By default, fields with empty
  2133. // values are omitted from API requests. However, any field with an
  2134. // empty value appearing in NullFields will be sent to the server as
  2135. // null. It is an error if a field in this list has a non-empty value.
  2136. // This may be used to include null fields in Patch requests.
  2137. NullFields []string `json:"-"`
  2138. }
  2139. func (s *QueryResultBatch) MarshalJSON() ([]byte, error) {
  2140. type NoMethod QueryResultBatch
  2141. raw := NoMethod(*s)
  2142. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2143. }
  2144. // ReadOnly: Options specific to read-only transactions.
  2145. type ReadOnly struct {
  2146. }
  2147. // ReadOptions: The options shared by read requests.
  2148. type ReadOptions struct {
  2149. // ReadConsistency: The non-transactional read consistency to
  2150. // use.
  2151. // Cannot be set to `STRONG` for global queries.
  2152. //
  2153. // Possible values:
  2154. // "READ_CONSISTENCY_UNSPECIFIED" - Unspecified. This value must not
  2155. // be used.
  2156. // "STRONG" - Strong consistency.
  2157. // "EVENTUAL" - Eventual consistency.
  2158. ReadConsistency string `json:"readConsistency,omitempty"`
  2159. // Transaction: The identifier of the transaction in which to read.
  2160. // A
  2161. // transaction identifier is returned by a call
  2162. // to
  2163. // Datastore.BeginTransaction.
  2164. Transaction string `json:"transaction,omitempty"`
  2165. // ForceSendFields is a list of field names (e.g. "ReadConsistency") to
  2166. // unconditionally include in API requests. By default, fields with
  2167. // empty values are omitted from API requests. However, any non-pointer,
  2168. // non-interface field appearing in ForceSendFields will be sent to the
  2169. // server regardless of whether the field is empty or not. This may be
  2170. // used to include empty fields in Patch requests.
  2171. ForceSendFields []string `json:"-"`
  2172. // NullFields is a list of field names (e.g. "ReadConsistency") to
  2173. // include in API requests with the JSON null value. By default, fields
  2174. // with empty values are omitted from API requests. However, any field
  2175. // with an empty value appearing in NullFields will be sent to the
  2176. // server as null. It is an error if a field in this list has a
  2177. // non-empty value. This may be used to include null fields in Patch
  2178. // requests.
  2179. NullFields []string `json:"-"`
  2180. }
  2181. func (s *ReadOptions) MarshalJSON() ([]byte, error) {
  2182. type NoMethod ReadOptions
  2183. raw := NoMethod(*s)
  2184. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2185. }
  2186. // ReadWrite: Options specific to read / write transactions.
  2187. type ReadWrite struct {
  2188. // PreviousTransaction: The transaction identifier of the transaction
  2189. // being retried.
  2190. PreviousTransaction string `json:"previousTransaction,omitempty"`
  2191. // ForceSendFields is a list of field names (e.g. "PreviousTransaction")
  2192. // to unconditionally include in API requests. By default, fields with
  2193. // empty values are omitted from API requests. However, any non-pointer,
  2194. // non-interface field appearing in ForceSendFields will be sent to the
  2195. // server regardless of whether the field is empty or not. This may be
  2196. // used to include empty fields in Patch requests.
  2197. ForceSendFields []string `json:"-"`
  2198. // NullFields is a list of field names (e.g. "PreviousTransaction") to
  2199. // include in API requests with the JSON null value. By default, fields
  2200. // with empty values are omitted from API requests. However, any field
  2201. // with an empty value appearing in NullFields will be sent to the
  2202. // server as null. It is an error if a field in this list has a
  2203. // non-empty value. This may be used to include null fields in Patch
  2204. // requests.
  2205. NullFields []string `json:"-"`
  2206. }
  2207. func (s *ReadWrite) MarshalJSON() ([]byte, error) {
  2208. type NoMethod ReadWrite
  2209. raw := NoMethod(*s)
  2210. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2211. }
  2212. // ReserveIdsRequest: The request for Datastore.ReserveIds.
  2213. type ReserveIdsRequest struct {
  2214. // DatabaseId: If not empty, the ID of the database against which to
  2215. // make the request.
  2216. DatabaseId string `json:"databaseId,omitempty"`
  2217. // Keys: A list of keys with complete key paths whose numeric IDs should
  2218. // not be
  2219. // auto-allocated.
  2220. Keys []*Key `json:"keys,omitempty"`
  2221. // ForceSendFields is a list of field names (e.g. "DatabaseId") to
  2222. // unconditionally include in API requests. By default, fields with
  2223. // empty values are omitted from API requests. However, any non-pointer,
  2224. // non-interface field appearing in ForceSendFields will be sent to the
  2225. // server regardless of whether the field is empty or not. This may be
  2226. // used to include empty fields in Patch requests.
  2227. ForceSendFields []string `json:"-"`
  2228. // NullFields is a list of field names (e.g. "DatabaseId") to include in
  2229. // API requests with the JSON null value. By default, fields with empty
  2230. // values are omitted from API requests. However, any field with an
  2231. // empty value appearing in NullFields will be sent to the server as
  2232. // null. It is an error if a field in this list has a non-empty value.
  2233. // This may be used to include null fields in Patch requests.
  2234. NullFields []string `json:"-"`
  2235. }
  2236. func (s *ReserveIdsRequest) MarshalJSON() ([]byte, error) {
  2237. type NoMethod ReserveIdsRequest
  2238. raw := NoMethod(*s)
  2239. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2240. }
  2241. // ReserveIdsResponse: The response for Datastore.ReserveIds.
  2242. type ReserveIdsResponse struct {
  2243. // ServerResponse contains the HTTP response code and headers from the
  2244. // server.
  2245. googleapi.ServerResponse `json:"-"`
  2246. }
  2247. // RollbackRequest: The request for Datastore.Rollback.
  2248. type RollbackRequest struct {
  2249. // Transaction: The transaction identifier, returned by a call
  2250. // to
  2251. // Datastore.BeginTransaction.
  2252. Transaction string `json:"transaction,omitempty"`
  2253. // ForceSendFields is a list of field names (e.g. "Transaction") to
  2254. // unconditionally include in API requests. By default, fields with
  2255. // empty values are omitted from API requests. However, any non-pointer,
  2256. // non-interface field appearing in ForceSendFields will be sent to the
  2257. // server regardless of whether the field is empty or not. This may be
  2258. // used to include empty fields in Patch requests.
  2259. ForceSendFields []string `json:"-"`
  2260. // NullFields is a list of field names (e.g. "Transaction") to include
  2261. // in API requests with the JSON null value. By default, fields with
  2262. // empty values are omitted from API requests. However, any field with
  2263. // an empty value appearing in NullFields will be sent to the server as
  2264. // null. It is an error if a field in this list has a non-empty value.
  2265. // This may be used to include null fields in Patch requests.
  2266. NullFields []string `json:"-"`
  2267. }
  2268. func (s *RollbackRequest) MarshalJSON() ([]byte, error) {
  2269. type NoMethod RollbackRequest
  2270. raw := NoMethod(*s)
  2271. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2272. }
  2273. // RollbackResponse: The response for Datastore.Rollback.
  2274. // (an empty message).
  2275. type RollbackResponse struct {
  2276. // ServerResponse contains the HTTP response code and headers from the
  2277. // server.
  2278. googleapi.ServerResponse `json:"-"`
  2279. }
  2280. // RunQueryRequest: The request for Datastore.RunQuery.
  2281. type RunQueryRequest struct {
  2282. // GqlQuery: The GQL query to run.
  2283. GqlQuery *GqlQuery `json:"gqlQuery,omitempty"`
  2284. // PartitionId: Entities are partitioned into subsets, identified by a
  2285. // partition ID.
  2286. // Queries are scoped to a single partition.
  2287. // This partition ID is normalized with the standard default
  2288. // context
  2289. // partition ID.
  2290. PartitionId *PartitionId `json:"partitionId,omitempty"`
  2291. // Query: The query to run.
  2292. Query *Query `json:"query,omitempty"`
  2293. // ReadOptions: The options for this query.
  2294. ReadOptions *ReadOptions `json:"readOptions,omitempty"`
  2295. // ForceSendFields is a list of field names (e.g. "GqlQuery") to
  2296. // unconditionally include in API requests. By default, fields with
  2297. // empty values are omitted from API requests. However, any non-pointer,
  2298. // non-interface field appearing in ForceSendFields will be sent to the
  2299. // server regardless of whether the field is empty or not. This may be
  2300. // used to include empty fields in Patch requests.
  2301. ForceSendFields []string `json:"-"`
  2302. // NullFields is a list of field names (e.g. "GqlQuery") to include in
  2303. // API requests with the JSON null value. By default, fields with empty
  2304. // values are omitted from API requests. However, any field with an
  2305. // empty value appearing in NullFields will be sent to the server as
  2306. // null. It is an error if a field in this list has a non-empty value.
  2307. // This may be used to include null fields in Patch requests.
  2308. NullFields []string `json:"-"`
  2309. }
  2310. func (s *RunQueryRequest) MarshalJSON() ([]byte, error) {
  2311. type NoMethod RunQueryRequest
  2312. raw := NoMethod(*s)
  2313. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2314. }
  2315. // RunQueryResponse: The response for Datastore.RunQuery.
  2316. type RunQueryResponse struct {
  2317. // Batch: A batch of query results (always present).
  2318. Batch *QueryResultBatch `json:"batch,omitempty"`
  2319. // Query: The parsed form of the `GqlQuery` from the request, if it was
  2320. // set.
  2321. Query *Query `json:"query,omitempty"`
  2322. // ServerResponse contains the HTTP response code and headers from the
  2323. // server.
  2324. googleapi.ServerResponse `json:"-"`
  2325. // ForceSendFields is a list of field names (e.g. "Batch") to
  2326. // unconditionally include in API requests. By default, fields with
  2327. // empty values are omitted from API requests. However, any non-pointer,
  2328. // non-interface field appearing in ForceSendFields will be sent to the
  2329. // server regardless of whether the field is empty or not. This may be
  2330. // used to include empty fields in Patch requests.
  2331. ForceSendFields []string `json:"-"`
  2332. // NullFields is a list of field names (e.g. "Batch") to include in API
  2333. // requests with the JSON null value. By default, fields with empty
  2334. // values are omitted from API requests. However, any field with an
  2335. // empty value appearing in NullFields will be sent to the server as
  2336. // null. It is an error if a field in this list has a non-empty value.
  2337. // This may be used to include null fields in Patch requests.
  2338. NullFields []string `json:"-"`
  2339. }
  2340. func (s *RunQueryResponse) MarshalJSON() ([]byte, error) {
  2341. type NoMethod RunQueryResponse
  2342. raw := NoMethod(*s)
  2343. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2344. }
  2345. // Status: The `Status` type defines a logical error model that is
  2346. // suitable for different
  2347. // programming environments, including REST APIs and RPC APIs. It is
  2348. // used by
  2349. // [gRPC](https://github.com/grpc). The error model is designed to
  2350. // be:
  2351. //
  2352. // - Simple to use and understand for most users
  2353. // - Flexible enough to meet unexpected needs
  2354. //
  2355. // # Overview
  2356. //
  2357. // The `Status` message contains three pieces of data: error code, error
  2358. // message,
  2359. // and error details. The error code should be an enum value
  2360. // of
  2361. // google.rpc.Code, but it may accept additional error codes if needed.
  2362. // The
  2363. // error message should be a developer-facing English message that
  2364. // helps
  2365. // developers *understand* and *resolve* the error. If a localized
  2366. // user-facing
  2367. // error message is needed, put the localized message in the error
  2368. // details or
  2369. // localize it in the client. The optional error details may contain
  2370. // arbitrary
  2371. // information about the error. There is a predefined set of error
  2372. // detail types
  2373. // in the package `google.rpc` that can be used for common error
  2374. // conditions.
  2375. //
  2376. // # Language mapping
  2377. //
  2378. // The `Status` message is the logical representation of the error
  2379. // model, but it
  2380. // is not necessarily the actual wire format. When the `Status` message
  2381. // is
  2382. // exposed in different client libraries and different wire protocols,
  2383. // it can be
  2384. // mapped differently. For example, it will likely be mapped to some
  2385. // exceptions
  2386. // in Java, but more likely mapped to some error codes in C.
  2387. //
  2388. // # Other uses
  2389. //
  2390. // The error model and the `Status` message can be used in a variety
  2391. // of
  2392. // environments, either with or without APIs, to provide a
  2393. // consistent developer experience across different
  2394. // environments.
  2395. //
  2396. // Example uses of this error model include:
  2397. //
  2398. // - Partial errors. If a service needs to return partial errors to the
  2399. // client,
  2400. // it may embed the `Status` in the normal response to indicate the
  2401. // partial
  2402. // errors.
  2403. //
  2404. // - Workflow errors. A typical workflow has multiple steps. Each step
  2405. // may
  2406. // have a `Status` message for error reporting.
  2407. //
  2408. // - Batch operations. If a client uses batch request and batch
  2409. // response, the
  2410. // `Status` message should be used directly inside batch response,
  2411. // one for
  2412. // each error sub-response.
  2413. //
  2414. // - Asynchronous operations. If an API call embeds asynchronous
  2415. // operation
  2416. // results in its response, the status of those operations should
  2417. // be
  2418. // represented directly using the `Status` message.
  2419. //
  2420. // - Logging. If some API errors are stored in logs, the message
  2421. // `Status` could
  2422. // be used directly after any stripping needed for security/privacy
  2423. // reasons.
  2424. type Status struct {
  2425. // Code: The status code, which should be an enum value of
  2426. // google.rpc.Code.
  2427. Code int64 `json:"code,omitempty"`
  2428. // Details: A list of messages that carry the error details. There is a
  2429. // common set of
  2430. // message types for APIs to use.
  2431. Details []googleapi.RawMessage `json:"details,omitempty"`
  2432. // Message: A developer-facing error message, which should be in
  2433. // English. Any
  2434. // user-facing error message should be localized and sent in
  2435. // the
  2436. // google.rpc.Status.details field, or localized by the client.
  2437. Message string `json:"message,omitempty"`
  2438. // ForceSendFields is a list of field names (e.g. "Code") to
  2439. // unconditionally include in API requests. By default, fields with
  2440. // empty values are omitted from API requests. However, any non-pointer,
  2441. // non-interface field appearing in ForceSendFields will be sent to the
  2442. // server regardless of whether the field is empty or not. This may be
  2443. // used to include empty fields in Patch requests.
  2444. ForceSendFields []string `json:"-"`
  2445. // NullFields is a list of field names (e.g. "Code") to include in API
  2446. // requests with the JSON null value. By default, fields with empty
  2447. // values are omitted from API requests. However, any field with an
  2448. // empty value appearing in NullFields will be sent to the server as
  2449. // null. It is an error if a field in this list has a non-empty value.
  2450. // This may be used to include null fields in Patch requests.
  2451. NullFields []string `json:"-"`
  2452. }
  2453. func (s *Status) MarshalJSON() ([]byte, error) {
  2454. type NoMethod Status
  2455. raw := NoMethod(*s)
  2456. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2457. }
  2458. // TransactionOptions: Options for beginning a new
  2459. // transaction.
  2460. //
  2461. // Transactions can be created explicitly with calls
  2462. // to
  2463. // Datastore.BeginTransaction or implicitly by
  2464. // setting
  2465. // ReadOptions.new_transaction in read requests.
  2466. type TransactionOptions struct {
  2467. // ReadOnly: The transaction should only allow reads.
  2468. ReadOnly *ReadOnly `json:"readOnly,omitempty"`
  2469. // ReadWrite: The transaction should allow both reads and writes.
  2470. ReadWrite *ReadWrite `json:"readWrite,omitempty"`
  2471. // ForceSendFields is a list of field names (e.g. "ReadOnly") to
  2472. // unconditionally include in API requests. By default, fields with
  2473. // empty values are omitted from API requests. However, any non-pointer,
  2474. // non-interface field appearing in ForceSendFields will be sent to the
  2475. // server regardless of whether the field is empty or not. This may be
  2476. // used to include empty fields in Patch requests.
  2477. ForceSendFields []string `json:"-"`
  2478. // NullFields is a list of field names (e.g. "ReadOnly") to include in
  2479. // API requests with the JSON null value. By default, fields with empty
  2480. // values are omitted from API requests. However, any field with an
  2481. // empty value appearing in NullFields will be sent to the server as
  2482. // null. It is an error if a field in this list has a non-empty value.
  2483. // This may be used to include null fields in Patch requests.
  2484. NullFields []string `json:"-"`
  2485. }
  2486. func (s *TransactionOptions) MarshalJSON() ([]byte, error) {
  2487. type NoMethod TransactionOptions
  2488. raw := NoMethod(*s)
  2489. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2490. }
  2491. // Value: A message that can hold any of the supported value types and
  2492. // associated
  2493. // metadata.
  2494. type Value struct {
  2495. // ArrayValue: An array value.
  2496. // Cannot contain another array value.
  2497. // A `Value` instance that sets field `array_value` must not set
  2498. // fields
  2499. // `meaning` or `exclude_from_indexes`.
  2500. ArrayValue *ArrayValue `json:"arrayValue,omitempty"`
  2501. // BlobValue: A blob value.
  2502. // May have at most 1,000,000 bytes.
  2503. // When `exclude_from_indexes` is false, may have at most 1500 bytes.
  2504. // In JSON requests, must be base64-encoded.
  2505. BlobValue string `json:"blobValue,omitempty"`
  2506. // BooleanValue: A boolean value.
  2507. BooleanValue bool `json:"booleanValue,omitempty"`
  2508. // DoubleValue: A double value.
  2509. DoubleValue float64 `json:"doubleValue,omitempty"`
  2510. // EntityValue: An entity value.
  2511. //
  2512. // - May have no key.
  2513. // - May have a key with an incomplete key path.
  2514. // - May have a reserved/read-only key.
  2515. EntityValue *Entity `json:"entityValue,omitempty"`
  2516. // ExcludeFromIndexes: If the value should be excluded from all indexes
  2517. // including those defined
  2518. // explicitly.
  2519. ExcludeFromIndexes bool `json:"excludeFromIndexes,omitempty"`
  2520. // GeoPointValue: A geo point value representing a point on the surface
  2521. // of Earth.
  2522. GeoPointValue *LatLng `json:"geoPointValue,omitempty"`
  2523. // IntegerValue: An integer value.
  2524. IntegerValue int64 `json:"integerValue,omitempty,string"`
  2525. // KeyValue: A key value.
  2526. KeyValue *Key `json:"keyValue,omitempty"`
  2527. // Meaning: The `meaning` field should only be populated for backwards
  2528. // compatibility.
  2529. Meaning int64 `json:"meaning,omitempty"`
  2530. // NullValue: A null value.
  2531. //
  2532. // Possible values:
  2533. // "NULL_VALUE" - Null value.
  2534. NullValue string `json:"nullValue,omitempty"`
  2535. // StringValue: A UTF-8 encoded string value.
  2536. // When `exclude_from_indexes` is false (it is indexed) , may have at
  2537. // most 1500 bytes.
  2538. // Otherwise, may be set to at least 1,000,000 bytes.
  2539. StringValue string `json:"stringValue,omitempty"`
  2540. // TimestampValue: A timestamp value.
  2541. // When stored in the Datastore, precise only to microseconds;
  2542. // any additional precision is rounded down.
  2543. TimestampValue string `json:"timestampValue,omitempty"`
  2544. // ForceSendFields is a list of field names (e.g. "ArrayValue") to
  2545. // unconditionally include in API requests. By default, fields with
  2546. // empty values are omitted from API requests. However, any non-pointer,
  2547. // non-interface field appearing in ForceSendFields will be sent to the
  2548. // server regardless of whether the field is empty or not. This may be
  2549. // used to include empty fields in Patch requests.
  2550. ForceSendFields []string `json:"-"`
  2551. // NullFields is a list of field names (e.g. "ArrayValue") to include in
  2552. // API requests with the JSON null value. By default, fields with empty
  2553. // values are omitted from API requests. However, any field with an
  2554. // empty value appearing in NullFields will be sent to the server as
  2555. // null. It is an error if a field in this list has a non-empty value.
  2556. // This may be used to include null fields in Patch requests.
  2557. NullFields []string `json:"-"`
  2558. }
  2559. func (s *Value) MarshalJSON() ([]byte, error) {
  2560. type NoMethod Value
  2561. raw := NoMethod(*s)
  2562. return gensupport.MarshalJSON(raw, s.ForceSendFields, s.NullFields)
  2563. }
  2564. func (s *Value) UnmarshalJSON(data []byte) error {
  2565. type NoMethod Value
  2566. var s1 struct {
  2567. DoubleValue gensupport.JSONFloat64 `json:"doubleValue"`
  2568. *NoMethod
  2569. }
  2570. s1.NoMethod = (*NoMethod)(s)
  2571. if err := json.Unmarshal(data, &s1); err != nil {
  2572. return err
  2573. }
  2574. s.DoubleValue = float64(s1.DoubleValue)
  2575. return nil
  2576. }
  2577. // method id "datastore.projects.allocateIds":
  2578. type ProjectsAllocateIdsCall struct {
  2579. s *Service
  2580. projectId string
  2581. allocateidsrequest *AllocateIdsRequest
  2582. urlParams_ gensupport.URLParams
  2583. ctx_ context.Context
  2584. header_ http.Header
  2585. }
  2586. // AllocateIds: Allocates IDs for the given keys, which is useful for
  2587. // referencing an entity
  2588. // before it is inserted.
  2589. func (r *ProjectsService) AllocateIds(projectId string, allocateidsrequest *AllocateIdsRequest) *ProjectsAllocateIdsCall {
  2590. c := &ProjectsAllocateIdsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2591. c.projectId = projectId
  2592. c.allocateidsrequest = allocateidsrequest
  2593. return c
  2594. }
  2595. // Fields allows partial responses to be retrieved. See
  2596. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2597. // for more information.
  2598. func (c *ProjectsAllocateIdsCall) Fields(s ...googleapi.Field) *ProjectsAllocateIdsCall {
  2599. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2600. return c
  2601. }
  2602. // Context sets the context to be used in this call's Do method. Any
  2603. // pending HTTP request will be aborted if the provided context is
  2604. // canceled.
  2605. func (c *ProjectsAllocateIdsCall) Context(ctx context.Context) *ProjectsAllocateIdsCall {
  2606. c.ctx_ = ctx
  2607. return c
  2608. }
  2609. // Header returns an http.Header that can be modified by the caller to
  2610. // add HTTP headers to the request.
  2611. func (c *ProjectsAllocateIdsCall) Header() http.Header {
  2612. if c.header_ == nil {
  2613. c.header_ = make(http.Header)
  2614. }
  2615. return c.header_
  2616. }
  2617. func (c *ProjectsAllocateIdsCall) doRequest(alt string) (*http.Response, error) {
  2618. reqHeaders := make(http.Header)
  2619. for k, v := range c.header_ {
  2620. reqHeaders[k] = v
  2621. }
  2622. reqHeaders.Set("User-Agent", c.s.userAgent())
  2623. var body io.Reader = nil
  2624. body, err := googleapi.WithoutDataWrapper.JSONReader(c.allocateidsrequest)
  2625. if err != nil {
  2626. return nil, err
  2627. }
  2628. reqHeaders.Set("Content-Type", "application/json")
  2629. c.urlParams_.Set("alt", alt)
  2630. c.urlParams_.Set("prettyPrint", "false")
  2631. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}:allocateIds")
  2632. urls += "?" + c.urlParams_.Encode()
  2633. req, err := http.NewRequest("POST", urls, body)
  2634. if err != nil {
  2635. return nil, err
  2636. }
  2637. req.Header = reqHeaders
  2638. googleapi.Expand(req.URL, map[string]string{
  2639. "projectId": c.projectId,
  2640. })
  2641. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2642. }
  2643. // Do executes the "datastore.projects.allocateIds" call.
  2644. // Exactly one of *AllocateIdsResponse or error will be non-nil. Any
  2645. // non-2xx status code is an error. Response headers are in either
  2646. // *AllocateIdsResponse.ServerResponse.Header or (if a response was
  2647. // returned at all) in error.(*googleapi.Error).Header. Use
  2648. // googleapi.IsNotModified to check whether the returned error was
  2649. // because http.StatusNotModified was returned.
  2650. func (c *ProjectsAllocateIdsCall) Do(opts ...googleapi.CallOption) (*AllocateIdsResponse, error) {
  2651. gensupport.SetOptions(c.urlParams_, opts...)
  2652. res, err := c.doRequest("json")
  2653. if res != nil && res.StatusCode == http.StatusNotModified {
  2654. if res.Body != nil {
  2655. res.Body.Close()
  2656. }
  2657. return nil, &googleapi.Error{
  2658. Code: res.StatusCode,
  2659. Header: res.Header,
  2660. }
  2661. }
  2662. if err != nil {
  2663. return nil, err
  2664. }
  2665. defer googleapi.CloseBody(res)
  2666. if err := googleapi.CheckResponse(res); err != nil {
  2667. return nil, err
  2668. }
  2669. ret := &AllocateIdsResponse{
  2670. ServerResponse: googleapi.ServerResponse{
  2671. Header: res.Header,
  2672. HTTPStatusCode: res.StatusCode,
  2673. },
  2674. }
  2675. target := &ret
  2676. if err := gensupport.DecodeResponse(target, res); err != nil {
  2677. return nil, err
  2678. }
  2679. return ret, nil
  2680. // {
  2681. // "description": "Allocates IDs for the given keys, which is useful for referencing an entity\nbefore it is inserted.",
  2682. // "flatPath": "v1/projects/{projectId}:allocateIds",
  2683. // "httpMethod": "POST",
  2684. // "id": "datastore.projects.allocateIds",
  2685. // "parameterOrder": [
  2686. // "projectId"
  2687. // ],
  2688. // "parameters": {
  2689. // "projectId": {
  2690. // "description": "The ID of the project against which to make the request.",
  2691. // "location": "path",
  2692. // "required": true,
  2693. // "type": "string"
  2694. // }
  2695. // },
  2696. // "path": "v1/projects/{projectId}:allocateIds",
  2697. // "request": {
  2698. // "$ref": "AllocateIdsRequest"
  2699. // },
  2700. // "response": {
  2701. // "$ref": "AllocateIdsResponse"
  2702. // },
  2703. // "scopes": [
  2704. // "https://www.googleapis.com/auth/cloud-platform",
  2705. // "https://www.googleapis.com/auth/datastore"
  2706. // ]
  2707. // }
  2708. }
  2709. // method id "datastore.projects.beginTransaction":
  2710. type ProjectsBeginTransactionCall struct {
  2711. s *Service
  2712. projectId string
  2713. begintransactionrequest *BeginTransactionRequest
  2714. urlParams_ gensupport.URLParams
  2715. ctx_ context.Context
  2716. header_ http.Header
  2717. }
  2718. // BeginTransaction: Begins a new transaction.
  2719. func (r *ProjectsService) BeginTransaction(projectId string, begintransactionrequest *BeginTransactionRequest) *ProjectsBeginTransactionCall {
  2720. c := &ProjectsBeginTransactionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2721. c.projectId = projectId
  2722. c.begintransactionrequest = begintransactionrequest
  2723. return c
  2724. }
  2725. // Fields allows partial responses to be retrieved. See
  2726. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2727. // for more information.
  2728. func (c *ProjectsBeginTransactionCall) Fields(s ...googleapi.Field) *ProjectsBeginTransactionCall {
  2729. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2730. return c
  2731. }
  2732. // Context sets the context to be used in this call's Do method. Any
  2733. // pending HTTP request will be aborted if the provided context is
  2734. // canceled.
  2735. func (c *ProjectsBeginTransactionCall) Context(ctx context.Context) *ProjectsBeginTransactionCall {
  2736. c.ctx_ = ctx
  2737. return c
  2738. }
  2739. // Header returns an http.Header that can be modified by the caller to
  2740. // add HTTP headers to the request.
  2741. func (c *ProjectsBeginTransactionCall) Header() http.Header {
  2742. if c.header_ == nil {
  2743. c.header_ = make(http.Header)
  2744. }
  2745. return c.header_
  2746. }
  2747. func (c *ProjectsBeginTransactionCall) doRequest(alt string) (*http.Response, error) {
  2748. reqHeaders := make(http.Header)
  2749. for k, v := range c.header_ {
  2750. reqHeaders[k] = v
  2751. }
  2752. reqHeaders.Set("User-Agent", c.s.userAgent())
  2753. var body io.Reader = nil
  2754. body, err := googleapi.WithoutDataWrapper.JSONReader(c.begintransactionrequest)
  2755. if err != nil {
  2756. return nil, err
  2757. }
  2758. reqHeaders.Set("Content-Type", "application/json")
  2759. c.urlParams_.Set("alt", alt)
  2760. c.urlParams_.Set("prettyPrint", "false")
  2761. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}:beginTransaction")
  2762. urls += "?" + c.urlParams_.Encode()
  2763. req, err := http.NewRequest("POST", urls, body)
  2764. if err != nil {
  2765. return nil, err
  2766. }
  2767. req.Header = reqHeaders
  2768. googleapi.Expand(req.URL, map[string]string{
  2769. "projectId": c.projectId,
  2770. })
  2771. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2772. }
  2773. // Do executes the "datastore.projects.beginTransaction" call.
  2774. // Exactly one of *BeginTransactionResponse or error will be non-nil.
  2775. // Any non-2xx status code is an error. Response headers are in either
  2776. // *BeginTransactionResponse.ServerResponse.Header or (if a response was
  2777. // returned at all) in error.(*googleapi.Error).Header. Use
  2778. // googleapi.IsNotModified to check whether the returned error was
  2779. // because http.StatusNotModified was returned.
  2780. func (c *ProjectsBeginTransactionCall) Do(opts ...googleapi.CallOption) (*BeginTransactionResponse, error) {
  2781. gensupport.SetOptions(c.urlParams_, opts...)
  2782. res, err := c.doRequest("json")
  2783. if res != nil && res.StatusCode == http.StatusNotModified {
  2784. if res.Body != nil {
  2785. res.Body.Close()
  2786. }
  2787. return nil, &googleapi.Error{
  2788. Code: res.StatusCode,
  2789. Header: res.Header,
  2790. }
  2791. }
  2792. if err != nil {
  2793. return nil, err
  2794. }
  2795. defer googleapi.CloseBody(res)
  2796. if err := googleapi.CheckResponse(res); err != nil {
  2797. return nil, err
  2798. }
  2799. ret := &BeginTransactionResponse{
  2800. ServerResponse: googleapi.ServerResponse{
  2801. Header: res.Header,
  2802. HTTPStatusCode: res.StatusCode,
  2803. },
  2804. }
  2805. target := &ret
  2806. if err := gensupport.DecodeResponse(target, res); err != nil {
  2807. return nil, err
  2808. }
  2809. return ret, nil
  2810. // {
  2811. // "description": "Begins a new transaction.",
  2812. // "flatPath": "v1/projects/{projectId}:beginTransaction",
  2813. // "httpMethod": "POST",
  2814. // "id": "datastore.projects.beginTransaction",
  2815. // "parameterOrder": [
  2816. // "projectId"
  2817. // ],
  2818. // "parameters": {
  2819. // "projectId": {
  2820. // "description": "The ID of the project against which to make the request.",
  2821. // "location": "path",
  2822. // "required": true,
  2823. // "type": "string"
  2824. // }
  2825. // },
  2826. // "path": "v1/projects/{projectId}:beginTransaction",
  2827. // "request": {
  2828. // "$ref": "BeginTransactionRequest"
  2829. // },
  2830. // "response": {
  2831. // "$ref": "BeginTransactionResponse"
  2832. // },
  2833. // "scopes": [
  2834. // "https://www.googleapis.com/auth/cloud-platform",
  2835. // "https://www.googleapis.com/auth/datastore"
  2836. // ]
  2837. // }
  2838. }
  2839. // method id "datastore.projects.commit":
  2840. type ProjectsCommitCall struct {
  2841. s *Service
  2842. projectId string
  2843. commitrequest *CommitRequest
  2844. urlParams_ gensupport.URLParams
  2845. ctx_ context.Context
  2846. header_ http.Header
  2847. }
  2848. // Commit: Commits a transaction, optionally creating, deleting or
  2849. // modifying some
  2850. // entities.
  2851. func (r *ProjectsService) Commit(projectId string, commitrequest *CommitRequest) *ProjectsCommitCall {
  2852. c := &ProjectsCommitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2853. c.projectId = projectId
  2854. c.commitrequest = commitrequest
  2855. return c
  2856. }
  2857. // Fields allows partial responses to be retrieved. See
  2858. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  2859. // for more information.
  2860. func (c *ProjectsCommitCall) Fields(s ...googleapi.Field) *ProjectsCommitCall {
  2861. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2862. return c
  2863. }
  2864. // Context sets the context to be used in this call's Do method. Any
  2865. // pending HTTP request will be aborted if the provided context is
  2866. // canceled.
  2867. func (c *ProjectsCommitCall) Context(ctx context.Context) *ProjectsCommitCall {
  2868. c.ctx_ = ctx
  2869. return c
  2870. }
  2871. // Header returns an http.Header that can be modified by the caller to
  2872. // add HTTP headers to the request.
  2873. func (c *ProjectsCommitCall) Header() http.Header {
  2874. if c.header_ == nil {
  2875. c.header_ = make(http.Header)
  2876. }
  2877. return c.header_
  2878. }
  2879. func (c *ProjectsCommitCall) doRequest(alt string) (*http.Response, error) {
  2880. reqHeaders := make(http.Header)
  2881. for k, v := range c.header_ {
  2882. reqHeaders[k] = v
  2883. }
  2884. reqHeaders.Set("User-Agent", c.s.userAgent())
  2885. var body io.Reader = nil
  2886. body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitrequest)
  2887. if err != nil {
  2888. return nil, err
  2889. }
  2890. reqHeaders.Set("Content-Type", "application/json")
  2891. c.urlParams_.Set("alt", alt)
  2892. c.urlParams_.Set("prettyPrint", "false")
  2893. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}:commit")
  2894. urls += "?" + c.urlParams_.Encode()
  2895. req, err := http.NewRequest("POST", urls, body)
  2896. if err != nil {
  2897. return nil, err
  2898. }
  2899. req.Header = reqHeaders
  2900. googleapi.Expand(req.URL, map[string]string{
  2901. "projectId": c.projectId,
  2902. })
  2903. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2904. }
  2905. // Do executes the "datastore.projects.commit" call.
  2906. // Exactly one of *CommitResponse or error will be non-nil. Any non-2xx
  2907. // status code is an error. Response headers are in either
  2908. // *CommitResponse.ServerResponse.Header or (if a response was returned
  2909. // at all) in error.(*googleapi.Error).Header. Use
  2910. // googleapi.IsNotModified to check whether the returned error was
  2911. // because http.StatusNotModified was returned.
  2912. func (c *ProjectsCommitCall) Do(opts ...googleapi.CallOption) (*CommitResponse, error) {
  2913. gensupport.SetOptions(c.urlParams_, opts...)
  2914. res, err := c.doRequest("json")
  2915. if res != nil && res.StatusCode == http.StatusNotModified {
  2916. if res.Body != nil {
  2917. res.Body.Close()
  2918. }
  2919. return nil, &googleapi.Error{
  2920. Code: res.StatusCode,
  2921. Header: res.Header,
  2922. }
  2923. }
  2924. if err != nil {
  2925. return nil, err
  2926. }
  2927. defer googleapi.CloseBody(res)
  2928. if err := googleapi.CheckResponse(res); err != nil {
  2929. return nil, err
  2930. }
  2931. ret := &CommitResponse{
  2932. ServerResponse: googleapi.ServerResponse{
  2933. Header: res.Header,
  2934. HTTPStatusCode: res.StatusCode,
  2935. },
  2936. }
  2937. target := &ret
  2938. if err := gensupport.DecodeResponse(target, res); err != nil {
  2939. return nil, err
  2940. }
  2941. return ret, nil
  2942. // {
  2943. // "description": "Commits a transaction, optionally creating, deleting or modifying some\nentities.",
  2944. // "flatPath": "v1/projects/{projectId}:commit",
  2945. // "httpMethod": "POST",
  2946. // "id": "datastore.projects.commit",
  2947. // "parameterOrder": [
  2948. // "projectId"
  2949. // ],
  2950. // "parameters": {
  2951. // "projectId": {
  2952. // "description": "The ID of the project against which to make the request.",
  2953. // "location": "path",
  2954. // "required": true,
  2955. // "type": "string"
  2956. // }
  2957. // },
  2958. // "path": "v1/projects/{projectId}:commit",
  2959. // "request": {
  2960. // "$ref": "CommitRequest"
  2961. // },
  2962. // "response": {
  2963. // "$ref": "CommitResponse"
  2964. // },
  2965. // "scopes": [
  2966. // "https://www.googleapis.com/auth/cloud-platform",
  2967. // "https://www.googleapis.com/auth/datastore"
  2968. // ]
  2969. // }
  2970. }
  2971. // method id "datastore.projects.export":
  2972. type ProjectsExportCall struct {
  2973. s *Service
  2974. projectId string
  2975. googledatastoreadminv1exportentitiesrequest *GoogleDatastoreAdminV1ExportEntitiesRequest
  2976. urlParams_ gensupport.URLParams
  2977. ctx_ context.Context
  2978. header_ http.Header
  2979. }
  2980. // Export: Exports a copy of all or a subset of entities from Google
  2981. // Cloud Datastore
  2982. // to another storage system, such as Google Cloud Storage. Recent
  2983. // updates to
  2984. // entities may not be reflected in the export. The export occurs in
  2985. // the
  2986. // background and its progress can be monitored and managed via
  2987. // the
  2988. // Operation resource that is created. The output of an export may only
  2989. // be
  2990. // used once the associated operation is done. If an export operation
  2991. // is
  2992. // cancelled before completion it may leave partial data behind in
  2993. // Google
  2994. // Cloud Storage.
  2995. func (r *ProjectsService) Export(projectId string, googledatastoreadminv1exportentitiesrequest *GoogleDatastoreAdminV1ExportEntitiesRequest) *ProjectsExportCall {
  2996. c := &ProjectsExportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2997. c.projectId = projectId
  2998. c.googledatastoreadminv1exportentitiesrequest = googledatastoreadminv1exportentitiesrequest
  2999. return c
  3000. }
  3001. // Fields allows partial responses to be retrieved. See
  3002. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3003. // for more information.
  3004. func (c *ProjectsExportCall) Fields(s ...googleapi.Field) *ProjectsExportCall {
  3005. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3006. return c
  3007. }
  3008. // Context sets the context to be used in this call's Do method. Any
  3009. // pending HTTP request will be aborted if the provided context is
  3010. // canceled.
  3011. func (c *ProjectsExportCall) Context(ctx context.Context) *ProjectsExportCall {
  3012. c.ctx_ = ctx
  3013. return c
  3014. }
  3015. // Header returns an http.Header that can be modified by the caller to
  3016. // add HTTP headers to the request.
  3017. func (c *ProjectsExportCall) Header() http.Header {
  3018. if c.header_ == nil {
  3019. c.header_ = make(http.Header)
  3020. }
  3021. return c.header_
  3022. }
  3023. func (c *ProjectsExportCall) doRequest(alt string) (*http.Response, error) {
  3024. reqHeaders := make(http.Header)
  3025. for k, v := range c.header_ {
  3026. reqHeaders[k] = v
  3027. }
  3028. reqHeaders.Set("User-Agent", c.s.userAgent())
  3029. var body io.Reader = nil
  3030. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googledatastoreadminv1exportentitiesrequest)
  3031. if err != nil {
  3032. return nil, err
  3033. }
  3034. reqHeaders.Set("Content-Type", "application/json")
  3035. c.urlParams_.Set("alt", alt)
  3036. c.urlParams_.Set("prettyPrint", "false")
  3037. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}:export")
  3038. urls += "?" + c.urlParams_.Encode()
  3039. req, err := http.NewRequest("POST", urls, body)
  3040. if err != nil {
  3041. return nil, err
  3042. }
  3043. req.Header = reqHeaders
  3044. googleapi.Expand(req.URL, map[string]string{
  3045. "projectId": c.projectId,
  3046. })
  3047. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3048. }
  3049. // Do executes the "datastore.projects.export" call.
  3050. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  3051. // Any non-2xx status code is an error. Response headers are in either
  3052. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  3053. // was returned at all) in error.(*googleapi.Error).Header. Use
  3054. // googleapi.IsNotModified to check whether the returned error was
  3055. // because http.StatusNotModified was returned.
  3056. func (c *ProjectsExportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  3057. gensupport.SetOptions(c.urlParams_, opts...)
  3058. res, err := c.doRequest("json")
  3059. if res != nil && res.StatusCode == http.StatusNotModified {
  3060. if res.Body != nil {
  3061. res.Body.Close()
  3062. }
  3063. return nil, &googleapi.Error{
  3064. Code: res.StatusCode,
  3065. Header: res.Header,
  3066. }
  3067. }
  3068. if err != nil {
  3069. return nil, err
  3070. }
  3071. defer googleapi.CloseBody(res)
  3072. if err := googleapi.CheckResponse(res); err != nil {
  3073. return nil, err
  3074. }
  3075. ret := &GoogleLongrunningOperation{
  3076. ServerResponse: googleapi.ServerResponse{
  3077. Header: res.Header,
  3078. HTTPStatusCode: res.StatusCode,
  3079. },
  3080. }
  3081. target := &ret
  3082. if err := gensupport.DecodeResponse(target, res); err != nil {
  3083. return nil, err
  3084. }
  3085. return ret, nil
  3086. // {
  3087. // "description": "Exports a copy of all or a subset of entities from Google Cloud Datastore\nto another storage system, such as Google Cloud Storage. Recent updates to\nentities may not be reflected in the export. The export occurs in the\nbackground and its progress can be monitored and managed via the\nOperation resource that is created. The output of an export may only be\nused once the associated operation is done. If an export operation is\ncancelled before completion it may leave partial data behind in Google\nCloud Storage.",
  3088. // "flatPath": "v1/projects/{projectId}:export",
  3089. // "httpMethod": "POST",
  3090. // "id": "datastore.projects.export",
  3091. // "parameterOrder": [
  3092. // "projectId"
  3093. // ],
  3094. // "parameters": {
  3095. // "projectId": {
  3096. // "description": "Project ID against which to make the request.",
  3097. // "location": "path",
  3098. // "required": true,
  3099. // "type": "string"
  3100. // }
  3101. // },
  3102. // "path": "v1/projects/{projectId}:export",
  3103. // "request": {
  3104. // "$ref": "GoogleDatastoreAdminV1ExportEntitiesRequest"
  3105. // },
  3106. // "response": {
  3107. // "$ref": "GoogleLongrunningOperation"
  3108. // },
  3109. // "scopes": [
  3110. // "https://www.googleapis.com/auth/cloud-platform",
  3111. // "https://www.googleapis.com/auth/datastore"
  3112. // ]
  3113. // }
  3114. }
  3115. // method id "datastore.projects.import":
  3116. type ProjectsImportCall struct {
  3117. s *Service
  3118. projectId string
  3119. googledatastoreadminv1importentitiesrequest *GoogleDatastoreAdminV1ImportEntitiesRequest
  3120. urlParams_ gensupport.URLParams
  3121. ctx_ context.Context
  3122. header_ http.Header
  3123. }
  3124. // Import: Imports entities into Google Cloud Datastore. Existing
  3125. // entities with the
  3126. // same key are overwritten. The import occurs in the background and
  3127. // its
  3128. // progress can be monitored and managed via the Operation resource that
  3129. // is
  3130. // created. If an ImportEntities operation is cancelled, it is
  3131. // possible
  3132. // that a subset of the data has already been imported to Cloud
  3133. // Datastore.
  3134. func (r *ProjectsService) Import(projectId string, googledatastoreadminv1importentitiesrequest *GoogleDatastoreAdminV1ImportEntitiesRequest) *ProjectsImportCall {
  3135. c := &ProjectsImportCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3136. c.projectId = projectId
  3137. c.googledatastoreadminv1importentitiesrequest = googledatastoreadminv1importentitiesrequest
  3138. return c
  3139. }
  3140. // Fields allows partial responses to be retrieved. See
  3141. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3142. // for more information.
  3143. func (c *ProjectsImportCall) Fields(s ...googleapi.Field) *ProjectsImportCall {
  3144. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3145. return c
  3146. }
  3147. // Context sets the context to be used in this call's Do method. Any
  3148. // pending HTTP request will be aborted if the provided context is
  3149. // canceled.
  3150. func (c *ProjectsImportCall) Context(ctx context.Context) *ProjectsImportCall {
  3151. c.ctx_ = ctx
  3152. return c
  3153. }
  3154. // Header returns an http.Header that can be modified by the caller to
  3155. // add HTTP headers to the request.
  3156. func (c *ProjectsImportCall) Header() http.Header {
  3157. if c.header_ == nil {
  3158. c.header_ = make(http.Header)
  3159. }
  3160. return c.header_
  3161. }
  3162. func (c *ProjectsImportCall) doRequest(alt string) (*http.Response, error) {
  3163. reqHeaders := make(http.Header)
  3164. for k, v := range c.header_ {
  3165. reqHeaders[k] = v
  3166. }
  3167. reqHeaders.Set("User-Agent", c.s.userAgent())
  3168. var body io.Reader = nil
  3169. body, err := googleapi.WithoutDataWrapper.JSONReader(c.googledatastoreadminv1importentitiesrequest)
  3170. if err != nil {
  3171. return nil, err
  3172. }
  3173. reqHeaders.Set("Content-Type", "application/json")
  3174. c.urlParams_.Set("alt", alt)
  3175. c.urlParams_.Set("prettyPrint", "false")
  3176. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}:import")
  3177. urls += "?" + c.urlParams_.Encode()
  3178. req, err := http.NewRequest("POST", urls, body)
  3179. if err != nil {
  3180. return nil, err
  3181. }
  3182. req.Header = reqHeaders
  3183. googleapi.Expand(req.URL, map[string]string{
  3184. "projectId": c.projectId,
  3185. })
  3186. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3187. }
  3188. // Do executes the "datastore.projects.import" call.
  3189. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  3190. // Any non-2xx status code is an error. Response headers are in either
  3191. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  3192. // was returned at all) in error.(*googleapi.Error).Header. Use
  3193. // googleapi.IsNotModified to check whether the returned error was
  3194. // because http.StatusNotModified was returned.
  3195. func (c *ProjectsImportCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  3196. gensupport.SetOptions(c.urlParams_, opts...)
  3197. res, err := c.doRequest("json")
  3198. if res != nil && res.StatusCode == http.StatusNotModified {
  3199. if res.Body != nil {
  3200. res.Body.Close()
  3201. }
  3202. return nil, &googleapi.Error{
  3203. Code: res.StatusCode,
  3204. Header: res.Header,
  3205. }
  3206. }
  3207. if err != nil {
  3208. return nil, err
  3209. }
  3210. defer googleapi.CloseBody(res)
  3211. if err := googleapi.CheckResponse(res); err != nil {
  3212. return nil, err
  3213. }
  3214. ret := &GoogleLongrunningOperation{
  3215. ServerResponse: googleapi.ServerResponse{
  3216. Header: res.Header,
  3217. HTTPStatusCode: res.StatusCode,
  3218. },
  3219. }
  3220. target := &ret
  3221. if err := gensupport.DecodeResponse(target, res); err != nil {
  3222. return nil, err
  3223. }
  3224. return ret, nil
  3225. // {
  3226. // "description": "Imports entities into Google Cloud Datastore. Existing entities with the\nsame key are overwritten. The import occurs in the background and its\nprogress can be monitored and managed via the Operation resource that is\ncreated. If an ImportEntities operation is cancelled, it is possible\nthat a subset of the data has already been imported to Cloud Datastore.",
  3227. // "flatPath": "v1/projects/{projectId}:import",
  3228. // "httpMethod": "POST",
  3229. // "id": "datastore.projects.import",
  3230. // "parameterOrder": [
  3231. // "projectId"
  3232. // ],
  3233. // "parameters": {
  3234. // "projectId": {
  3235. // "description": "Project ID against which to make the request.",
  3236. // "location": "path",
  3237. // "required": true,
  3238. // "type": "string"
  3239. // }
  3240. // },
  3241. // "path": "v1/projects/{projectId}:import",
  3242. // "request": {
  3243. // "$ref": "GoogleDatastoreAdminV1ImportEntitiesRequest"
  3244. // },
  3245. // "response": {
  3246. // "$ref": "GoogleLongrunningOperation"
  3247. // },
  3248. // "scopes": [
  3249. // "https://www.googleapis.com/auth/cloud-platform",
  3250. // "https://www.googleapis.com/auth/datastore"
  3251. // ]
  3252. // }
  3253. }
  3254. // method id "datastore.projects.lookup":
  3255. type ProjectsLookupCall struct {
  3256. s *Service
  3257. projectId string
  3258. lookuprequest *LookupRequest
  3259. urlParams_ gensupport.URLParams
  3260. ctx_ context.Context
  3261. header_ http.Header
  3262. }
  3263. // Lookup: Looks up entities by key.
  3264. func (r *ProjectsService) Lookup(projectId string, lookuprequest *LookupRequest) *ProjectsLookupCall {
  3265. c := &ProjectsLookupCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3266. c.projectId = projectId
  3267. c.lookuprequest = lookuprequest
  3268. return c
  3269. }
  3270. // Fields allows partial responses to be retrieved. See
  3271. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3272. // for more information.
  3273. func (c *ProjectsLookupCall) Fields(s ...googleapi.Field) *ProjectsLookupCall {
  3274. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3275. return c
  3276. }
  3277. // Context sets the context to be used in this call's Do method. Any
  3278. // pending HTTP request will be aborted if the provided context is
  3279. // canceled.
  3280. func (c *ProjectsLookupCall) Context(ctx context.Context) *ProjectsLookupCall {
  3281. c.ctx_ = ctx
  3282. return c
  3283. }
  3284. // Header returns an http.Header that can be modified by the caller to
  3285. // add HTTP headers to the request.
  3286. func (c *ProjectsLookupCall) Header() http.Header {
  3287. if c.header_ == nil {
  3288. c.header_ = make(http.Header)
  3289. }
  3290. return c.header_
  3291. }
  3292. func (c *ProjectsLookupCall) doRequest(alt string) (*http.Response, error) {
  3293. reqHeaders := make(http.Header)
  3294. for k, v := range c.header_ {
  3295. reqHeaders[k] = v
  3296. }
  3297. reqHeaders.Set("User-Agent", c.s.userAgent())
  3298. var body io.Reader = nil
  3299. body, err := googleapi.WithoutDataWrapper.JSONReader(c.lookuprequest)
  3300. if err != nil {
  3301. return nil, err
  3302. }
  3303. reqHeaders.Set("Content-Type", "application/json")
  3304. c.urlParams_.Set("alt", alt)
  3305. c.urlParams_.Set("prettyPrint", "false")
  3306. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}:lookup")
  3307. urls += "?" + c.urlParams_.Encode()
  3308. req, err := http.NewRequest("POST", urls, body)
  3309. if err != nil {
  3310. return nil, err
  3311. }
  3312. req.Header = reqHeaders
  3313. googleapi.Expand(req.URL, map[string]string{
  3314. "projectId": c.projectId,
  3315. })
  3316. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3317. }
  3318. // Do executes the "datastore.projects.lookup" call.
  3319. // Exactly one of *LookupResponse or error will be non-nil. Any non-2xx
  3320. // status code is an error. Response headers are in either
  3321. // *LookupResponse.ServerResponse.Header or (if a response was returned
  3322. // at all) in error.(*googleapi.Error).Header. Use
  3323. // googleapi.IsNotModified to check whether the returned error was
  3324. // because http.StatusNotModified was returned.
  3325. func (c *ProjectsLookupCall) Do(opts ...googleapi.CallOption) (*LookupResponse, error) {
  3326. gensupport.SetOptions(c.urlParams_, opts...)
  3327. res, err := c.doRequest("json")
  3328. if res != nil && res.StatusCode == http.StatusNotModified {
  3329. if res.Body != nil {
  3330. res.Body.Close()
  3331. }
  3332. return nil, &googleapi.Error{
  3333. Code: res.StatusCode,
  3334. Header: res.Header,
  3335. }
  3336. }
  3337. if err != nil {
  3338. return nil, err
  3339. }
  3340. defer googleapi.CloseBody(res)
  3341. if err := googleapi.CheckResponse(res); err != nil {
  3342. return nil, err
  3343. }
  3344. ret := &LookupResponse{
  3345. ServerResponse: googleapi.ServerResponse{
  3346. Header: res.Header,
  3347. HTTPStatusCode: res.StatusCode,
  3348. },
  3349. }
  3350. target := &ret
  3351. if err := gensupport.DecodeResponse(target, res); err != nil {
  3352. return nil, err
  3353. }
  3354. return ret, nil
  3355. // {
  3356. // "description": "Looks up entities by key.",
  3357. // "flatPath": "v1/projects/{projectId}:lookup",
  3358. // "httpMethod": "POST",
  3359. // "id": "datastore.projects.lookup",
  3360. // "parameterOrder": [
  3361. // "projectId"
  3362. // ],
  3363. // "parameters": {
  3364. // "projectId": {
  3365. // "description": "The ID of the project against which to make the request.",
  3366. // "location": "path",
  3367. // "required": true,
  3368. // "type": "string"
  3369. // }
  3370. // },
  3371. // "path": "v1/projects/{projectId}:lookup",
  3372. // "request": {
  3373. // "$ref": "LookupRequest"
  3374. // },
  3375. // "response": {
  3376. // "$ref": "LookupResponse"
  3377. // },
  3378. // "scopes": [
  3379. // "https://www.googleapis.com/auth/cloud-platform",
  3380. // "https://www.googleapis.com/auth/datastore"
  3381. // ]
  3382. // }
  3383. }
  3384. // method id "datastore.projects.reserveIds":
  3385. type ProjectsReserveIdsCall struct {
  3386. s *Service
  3387. projectId string
  3388. reserveidsrequest *ReserveIdsRequest
  3389. urlParams_ gensupport.URLParams
  3390. ctx_ context.Context
  3391. header_ http.Header
  3392. }
  3393. // ReserveIds: Prevents the supplied keys' IDs from being auto-allocated
  3394. // by Cloud
  3395. // Datastore.
  3396. func (r *ProjectsService) ReserveIds(projectId string, reserveidsrequest *ReserveIdsRequest) *ProjectsReserveIdsCall {
  3397. c := &ProjectsReserveIdsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3398. c.projectId = projectId
  3399. c.reserveidsrequest = reserveidsrequest
  3400. return c
  3401. }
  3402. // Fields allows partial responses to be retrieved. See
  3403. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3404. // for more information.
  3405. func (c *ProjectsReserveIdsCall) Fields(s ...googleapi.Field) *ProjectsReserveIdsCall {
  3406. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3407. return c
  3408. }
  3409. // Context sets the context to be used in this call's Do method. Any
  3410. // pending HTTP request will be aborted if the provided context is
  3411. // canceled.
  3412. func (c *ProjectsReserveIdsCall) Context(ctx context.Context) *ProjectsReserveIdsCall {
  3413. c.ctx_ = ctx
  3414. return c
  3415. }
  3416. // Header returns an http.Header that can be modified by the caller to
  3417. // add HTTP headers to the request.
  3418. func (c *ProjectsReserveIdsCall) Header() http.Header {
  3419. if c.header_ == nil {
  3420. c.header_ = make(http.Header)
  3421. }
  3422. return c.header_
  3423. }
  3424. func (c *ProjectsReserveIdsCall) doRequest(alt string) (*http.Response, error) {
  3425. reqHeaders := make(http.Header)
  3426. for k, v := range c.header_ {
  3427. reqHeaders[k] = v
  3428. }
  3429. reqHeaders.Set("User-Agent", c.s.userAgent())
  3430. var body io.Reader = nil
  3431. body, err := googleapi.WithoutDataWrapper.JSONReader(c.reserveidsrequest)
  3432. if err != nil {
  3433. return nil, err
  3434. }
  3435. reqHeaders.Set("Content-Type", "application/json")
  3436. c.urlParams_.Set("alt", alt)
  3437. c.urlParams_.Set("prettyPrint", "false")
  3438. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}:reserveIds")
  3439. urls += "?" + c.urlParams_.Encode()
  3440. req, err := http.NewRequest("POST", urls, body)
  3441. if err != nil {
  3442. return nil, err
  3443. }
  3444. req.Header = reqHeaders
  3445. googleapi.Expand(req.URL, map[string]string{
  3446. "projectId": c.projectId,
  3447. })
  3448. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3449. }
  3450. // Do executes the "datastore.projects.reserveIds" call.
  3451. // Exactly one of *ReserveIdsResponse or error will be non-nil. Any
  3452. // non-2xx status code is an error. Response headers are in either
  3453. // *ReserveIdsResponse.ServerResponse.Header or (if a response was
  3454. // returned at all) in error.(*googleapi.Error).Header. Use
  3455. // googleapi.IsNotModified to check whether the returned error was
  3456. // because http.StatusNotModified was returned.
  3457. func (c *ProjectsReserveIdsCall) Do(opts ...googleapi.CallOption) (*ReserveIdsResponse, error) {
  3458. gensupport.SetOptions(c.urlParams_, opts...)
  3459. res, err := c.doRequest("json")
  3460. if res != nil && res.StatusCode == http.StatusNotModified {
  3461. if res.Body != nil {
  3462. res.Body.Close()
  3463. }
  3464. return nil, &googleapi.Error{
  3465. Code: res.StatusCode,
  3466. Header: res.Header,
  3467. }
  3468. }
  3469. if err != nil {
  3470. return nil, err
  3471. }
  3472. defer googleapi.CloseBody(res)
  3473. if err := googleapi.CheckResponse(res); err != nil {
  3474. return nil, err
  3475. }
  3476. ret := &ReserveIdsResponse{
  3477. ServerResponse: googleapi.ServerResponse{
  3478. Header: res.Header,
  3479. HTTPStatusCode: res.StatusCode,
  3480. },
  3481. }
  3482. target := &ret
  3483. if err := gensupport.DecodeResponse(target, res); err != nil {
  3484. return nil, err
  3485. }
  3486. return ret, nil
  3487. // {
  3488. // "description": "Prevents the supplied keys' IDs from being auto-allocated by Cloud\nDatastore.",
  3489. // "flatPath": "v1/projects/{projectId}:reserveIds",
  3490. // "httpMethod": "POST",
  3491. // "id": "datastore.projects.reserveIds",
  3492. // "parameterOrder": [
  3493. // "projectId"
  3494. // ],
  3495. // "parameters": {
  3496. // "projectId": {
  3497. // "description": "The ID of the project against which to make the request.",
  3498. // "location": "path",
  3499. // "required": true,
  3500. // "type": "string"
  3501. // }
  3502. // },
  3503. // "path": "v1/projects/{projectId}:reserveIds",
  3504. // "request": {
  3505. // "$ref": "ReserveIdsRequest"
  3506. // },
  3507. // "response": {
  3508. // "$ref": "ReserveIdsResponse"
  3509. // },
  3510. // "scopes": [
  3511. // "https://www.googleapis.com/auth/cloud-platform",
  3512. // "https://www.googleapis.com/auth/datastore"
  3513. // ]
  3514. // }
  3515. }
  3516. // method id "datastore.projects.rollback":
  3517. type ProjectsRollbackCall struct {
  3518. s *Service
  3519. projectId string
  3520. rollbackrequest *RollbackRequest
  3521. urlParams_ gensupport.URLParams
  3522. ctx_ context.Context
  3523. header_ http.Header
  3524. }
  3525. // Rollback: Rolls back a transaction.
  3526. func (r *ProjectsService) Rollback(projectId string, rollbackrequest *RollbackRequest) *ProjectsRollbackCall {
  3527. c := &ProjectsRollbackCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3528. c.projectId = projectId
  3529. c.rollbackrequest = rollbackrequest
  3530. return c
  3531. }
  3532. // Fields allows partial responses to be retrieved. See
  3533. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3534. // for more information.
  3535. func (c *ProjectsRollbackCall) Fields(s ...googleapi.Field) *ProjectsRollbackCall {
  3536. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3537. return c
  3538. }
  3539. // Context sets the context to be used in this call's Do method. Any
  3540. // pending HTTP request will be aborted if the provided context is
  3541. // canceled.
  3542. func (c *ProjectsRollbackCall) Context(ctx context.Context) *ProjectsRollbackCall {
  3543. c.ctx_ = ctx
  3544. return c
  3545. }
  3546. // Header returns an http.Header that can be modified by the caller to
  3547. // add HTTP headers to the request.
  3548. func (c *ProjectsRollbackCall) Header() http.Header {
  3549. if c.header_ == nil {
  3550. c.header_ = make(http.Header)
  3551. }
  3552. return c.header_
  3553. }
  3554. func (c *ProjectsRollbackCall) doRequest(alt string) (*http.Response, error) {
  3555. reqHeaders := make(http.Header)
  3556. for k, v := range c.header_ {
  3557. reqHeaders[k] = v
  3558. }
  3559. reqHeaders.Set("User-Agent", c.s.userAgent())
  3560. var body io.Reader = nil
  3561. body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackrequest)
  3562. if err != nil {
  3563. return nil, err
  3564. }
  3565. reqHeaders.Set("Content-Type", "application/json")
  3566. c.urlParams_.Set("alt", alt)
  3567. c.urlParams_.Set("prettyPrint", "false")
  3568. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}:rollback")
  3569. urls += "?" + c.urlParams_.Encode()
  3570. req, err := http.NewRequest("POST", urls, body)
  3571. if err != nil {
  3572. return nil, err
  3573. }
  3574. req.Header = reqHeaders
  3575. googleapi.Expand(req.URL, map[string]string{
  3576. "projectId": c.projectId,
  3577. })
  3578. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3579. }
  3580. // Do executes the "datastore.projects.rollback" call.
  3581. // Exactly one of *RollbackResponse or error will be non-nil. Any
  3582. // non-2xx status code is an error. Response headers are in either
  3583. // *RollbackResponse.ServerResponse.Header or (if a response was
  3584. // returned at all) in error.(*googleapi.Error).Header. Use
  3585. // googleapi.IsNotModified to check whether the returned error was
  3586. // because http.StatusNotModified was returned.
  3587. func (c *ProjectsRollbackCall) Do(opts ...googleapi.CallOption) (*RollbackResponse, error) {
  3588. gensupport.SetOptions(c.urlParams_, opts...)
  3589. res, err := c.doRequest("json")
  3590. if res != nil && res.StatusCode == http.StatusNotModified {
  3591. if res.Body != nil {
  3592. res.Body.Close()
  3593. }
  3594. return nil, &googleapi.Error{
  3595. Code: res.StatusCode,
  3596. Header: res.Header,
  3597. }
  3598. }
  3599. if err != nil {
  3600. return nil, err
  3601. }
  3602. defer googleapi.CloseBody(res)
  3603. if err := googleapi.CheckResponse(res); err != nil {
  3604. return nil, err
  3605. }
  3606. ret := &RollbackResponse{
  3607. ServerResponse: googleapi.ServerResponse{
  3608. Header: res.Header,
  3609. HTTPStatusCode: res.StatusCode,
  3610. },
  3611. }
  3612. target := &ret
  3613. if err := gensupport.DecodeResponse(target, res); err != nil {
  3614. return nil, err
  3615. }
  3616. return ret, nil
  3617. // {
  3618. // "description": "Rolls back a transaction.",
  3619. // "flatPath": "v1/projects/{projectId}:rollback",
  3620. // "httpMethod": "POST",
  3621. // "id": "datastore.projects.rollback",
  3622. // "parameterOrder": [
  3623. // "projectId"
  3624. // ],
  3625. // "parameters": {
  3626. // "projectId": {
  3627. // "description": "The ID of the project against which to make the request.",
  3628. // "location": "path",
  3629. // "required": true,
  3630. // "type": "string"
  3631. // }
  3632. // },
  3633. // "path": "v1/projects/{projectId}:rollback",
  3634. // "request": {
  3635. // "$ref": "RollbackRequest"
  3636. // },
  3637. // "response": {
  3638. // "$ref": "RollbackResponse"
  3639. // },
  3640. // "scopes": [
  3641. // "https://www.googleapis.com/auth/cloud-platform",
  3642. // "https://www.googleapis.com/auth/datastore"
  3643. // ]
  3644. // }
  3645. }
  3646. // method id "datastore.projects.runQuery":
  3647. type ProjectsRunQueryCall struct {
  3648. s *Service
  3649. projectId string
  3650. runqueryrequest *RunQueryRequest
  3651. urlParams_ gensupport.URLParams
  3652. ctx_ context.Context
  3653. header_ http.Header
  3654. }
  3655. // RunQuery: Queries for entities.
  3656. func (r *ProjectsService) RunQuery(projectId string, runqueryrequest *RunQueryRequest) *ProjectsRunQueryCall {
  3657. c := &ProjectsRunQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3658. c.projectId = projectId
  3659. c.runqueryrequest = runqueryrequest
  3660. return c
  3661. }
  3662. // Fields allows partial responses to be retrieved. See
  3663. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3664. // for more information.
  3665. func (c *ProjectsRunQueryCall) Fields(s ...googleapi.Field) *ProjectsRunQueryCall {
  3666. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3667. return c
  3668. }
  3669. // Context sets the context to be used in this call's Do method. Any
  3670. // pending HTTP request will be aborted if the provided context is
  3671. // canceled.
  3672. func (c *ProjectsRunQueryCall) Context(ctx context.Context) *ProjectsRunQueryCall {
  3673. c.ctx_ = ctx
  3674. return c
  3675. }
  3676. // Header returns an http.Header that can be modified by the caller to
  3677. // add HTTP headers to the request.
  3678. func (c *ProjectsRunQueryCall) Header() http.Header {
  3679. if c.header_ == nil {
  3680. c.header_ = make(http.Header)
  3681. }
  3682. return c.header_
  3683. }
  3684. func (c *ProjectsRunQueryCall) doRequest(alt string) (*http.Response, error) {
  3685. reqHeaders := make(http.Header)
  3686. for k, v := range c.header_ {
  3687. reqHeaders[k] = v
  3688. }
  3689. reqHeaders.Set("User-Agent", c.s.userAgent())
  3690. var body io.Reader = nil
  3691. body, err := googleapi.WithoutDataWrapper.JSONReader(c.runqueryrequest)
  3692. if err != nil {
  3693. return nil, err
  3694. }
  3695. reqHeaders.Set("Content-Type", "application/json")
  3696. c.urlParams_.Set("alt", alt)
  3697. c.urlParams_.Set("prettyPrint", "false")
  3698. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}:runQuery")
  3699. urls += "?" + c.urlParams_.Encode()
  3700. req, err := http.NewRequest("POST", urls, body)
  3701. if err != nil {
  3702. return nil, err
  3703. }
  3704. req.Header = reqHeaders
  3705. googleapi.Expand(req.URL, map[string]string{
  3706. "projectId": c.projectId,
  3707. })
  3708. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3709. }
  3710. // Do executes the "datastore.projects.runQuery" call.
  3711. // Exactly one of *RunQueryResponse or error will be non-nil. Any
  3712. // non-2xx status code is an error. Response headers are in either
  3713. // *RunQueryResponse.ServerResponse.Header or (if a response was
  3714. // returned at all) in error.(*googleapi.Error).Header. Use
  3715. // googleapi.IsNotModified to check whether the returned error was
  3716. // because http.StatusNotModified was returned.
  3717. func (c *ProjectsRunQueryCall) Do(opts ...googleapi.CallOption) (*RunQueryResponse, error) {
  3718. gensupport.SetOptions(c.urlParams_, opts...)
  3719. res, err := c.doRequest("json")
  3720. if res != nil && res.StatusCode == http.StatusNotModified {
  3721. if res.Body != nil {
  3722. res.Body.Close()
  3723. }
  3724. return nil, &googleapi.Error{
  3725. Code: res.StatusCode,
  3726. Header: res.Header,
  3727. }
  3728. }
  3729. if err != nil {
  3730. return nil, err
  3731. }
  3732. defer googleapi.CloseBody(res)
  3733. if err := googleapi.CheckResponse(res); err != nil {
  3734. return nil, err
  3735. }
  3736. ret := &RunQueryResponse{
  3737. ServerResponse: googleapi.ServerResponse{
  3738. Header: res.Header,
  3739. HTTPStatusCode: res.StatusCode,
  3740. },
  3741. }
  3742. target := &ret
  3743. if err := gensupport.DecodeResponse(target, res); err != nil {
  3744. return nil, err
  3745. }
  3746. return ret, nil
  3747. // {
  3748. // "description": "Queries for entities.",
  3749. // "flatPath": "v1/projects/{projectId}:runQuery",
  3750. // "httpMethod": "POST",
  3751. // "id": "datastore.projects.runQuery",
  3752. // "parameterOrder": [
  3753. // "projectId"
  3754. // ],
  3755. // "parameters": {
  3756. // "projectId": {
  3757. // "description": "The ID of the project against which to make the request.",
  3758. // "location": "path",
  3759. // "required": true,
  3760. // "type": "string"
  3761. // }
  3762. // },
  3763. // "path": "v1/projects/{projectId}:runQuery",
  3764. // "request": {
  3765. // "$ref": "RunQueryRequest"
  3766. // },
  3767. // "response": {
  3768. // "$ref": "RunQueryResponse"
  3769. // },
  3770. // "scopes": [
  3771. // "https://www.googleapis.com/auth/cloud-platform",
  3772. // "https://www.googleapis.com/auth/datastore"
  3773. // ]
  3774. // }
  3775. }
  3776. // method id "datastore.projects.indexes.get":
  3777. type ProjectsIndexesGetCall struct {
  3778. s *Service
  3779. projectId string
  3780. indexId string
  3781. urlParams_ gensupport.URLParams
  3782. ifNoneMatch_ string
  3783. ctx_ context.Context
  3784. header_ http.Header
  3785. }
  3786. // Get: Gets an index.
  3787. func (r *ProjectsIndexesService) Get(projectId string, indexId string) *ProjectsIndexesGetCall {
  3788. c := &ProjectsIndexesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3789. c.projectId = projectId
  3790. c.indexId = indexId
  3791. return c
  3792. }
  3793. // Fields allows partial responses to be retrieved. See
  3794. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3795. // for more information.
  3796. func (c *ProjectsIndexesGetCall) Fields(s ...googleapi.Field) *ProjectsIndexesGetCall {
  3797. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3798. return c
  3799. }
  3800. // IfNoneMatch sets the optional parameter which makes the operation
  3801. // fail if the object's ETag matches the given value. This is useful for
  3802. // getting updates only after the object has changed since the last
  3803. // request. Use googleapi.IsNotModified to check whether the response
  3804. // error from Do is the result of In-None-Match.
  3805. func (c *ProjectsIndexesGetCall) IfNoneMatch(entityTag string) *ProjectsIndexesGetCall {
  3806. c.ifNoneMatch_ = entityTag
  3807. return c
  3808. }
  3809. // Context sets the context to be used in this call's Do method. Any
  3810. // pending HTTP request will be aborted if the provided context is
  3811. // canceled.
  3812. func (c *ProjectsIndexesGetCall) Context(ctx context.Context) *ProjectsIndexesGetCall {
  3813. c.ctx_ = ctx
  3814. return c
  3815. }
  3816. // Header returns an http.Header that can be modified by the caller to
  3817. // add HTTP headers to the request.
  3818. func (c *ProjectsIndexesGetCall) Header() http.Header {
  3819. if c.header_ == nil {
  3820. c.header_ = make(http.Header)
  3821. }
  3822. return c.header_
  3823. }
  3824. func (c *ProjectsIndexesGetCall) doRequest(alt string) (*http.Response, error) {
  3825. reqHeaders := make(http.Header)
  3826. for k, v := range c.header_ {
  3827. reqHeaders[k] = v
  3828. }
  3829. reqHeaders.Set("User-Agent", c.s.userAgent())
  3830. if c.ifNoneMatch_ != "" {
  3831. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3832. }
  3833. var body io.Reader = nil
  3834. c.urlParams_.Set("alt", alt)
  3835. c.urlParams_.Set("prettyPrint", "false")
  3836. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/indexes/{indexId}")
  3837. urls += "?" + c.urlParams_.Encode()
  3838. req, err := http.NewRequest("GET", urls, body)
  3839. if err != nil {
  3840. return nil, err
  3841. }
  3842. req.Header = reqHeaders
  3843. googleapi.Expand(req.URL, map[string]string{
  3844. "projectId": c.projectId,
  3845. "indexId": c.indexId,
  3846. })
  3847. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3848. }
  3849. // Do executes the "datastore.projects.indexes.get" call.
  3850. // Exactly one of *GoogleDatastoreAdminV1Index or error will be non-nil.
  3851. // Any non-2xx status code is an error. Response headers are in either
  3852. // *GoogleDatastoreAdminV1Index.ServerResponse.Header or (if a response
  3853. // was returned at all) in error.(*googleapi.Error).Header. Use
  3854. // googleapi.IsNotModified to check whether the returned error was
  3855. // because http.StatusNotModified was returned.
  3856. func (c *ProjectsIndexesGetCall) Do(opts ...googleapi.CallOption) (*GoogleDatastoreAdminV1Index, error) {
  3857. gensupport.SetOptions(c.urlParams_, opts...)
  3858. res, err := c.doRequest("json")
  3859. if res != nil && res.StatusCode == http.StatusNotModified {
  3860. if res.Body != nil {
  3861. res.Body.Close()
  3862. }
  3863. return nil, &googleapi.Error{
  3864. Code: res.StatusCode,
  3865. Header: res.Header,
  3866. }
  3867. }
  3868. if err != nil {
  3869. return nil, err
  3870. }
  3871. defer googleapi.CloseBody(res)
  3872. if err := googleapi.CheckResponse(res); err != nil {
  3873. return nil, err
  3874. }
  3875. ret := &GoogleDatastoreAdminV1Index{
  3876. ServerResponse: googleapi.ServerResponse{
  3877. Header: res.Header,
  3878. HTTPStatusCode: res.StatusCode,
  3879. },
  3880. }
  3881. target := &ret
  3882. if err := gensupport.DecodeResponse(target, res); err != nil {
  3883. return nil, err
  3884. }
  3885. return ret, nil
  3886. // {
  3887. // "description": "Gets an index.",
  3888. // "flatPath": "v1/projects/{projectId}/indexes/{indexId}",
  3889. // "httpMethod": "GET",
  3890. // "id": "datastore.projects.indexes.get",
  3891. // "parameterOrder": [
  3892. // "projectId",
  3893. // "indexId"
  3894. // ],
  3895. // "parameters": {
  3896. // "indexId": {
  3897. // "description": "The resource ID of the index to get.",
  3898. // "location": "path",
  3899. // "required": true,
  3900. // "type": "string"
  3901. // },
  3902. // "projectId": {
  3903. // "description": "Project ID against which to make the request.",
  3904. // "location": "path",
  3905. // "required": true,
  3906. // "type": "string"
  3907. // }
  3908. // },
  3909. // "path": "v1/projects/{projectId}/indexes/{indexId}",
  3910. // "response": {
  3911. // "$ref": "GoogleDatastoreAdminV1Index"
  3912. // },
  3913. // "scopes": [
  3914. // "https://www.googleapis.com/auth/cloud-platform",
  3915. // "https://www.googleapis.com/auth/datastore"
  3916. // ]
  3917. // }
  3918. }
  3919. // method id "datastore.projects.indexes.list":
  3920. type ProjectsIndexesListCall struct {
  3921. s *Service
  3922. projectId string
  3923. urlParams_ gensupport.URLParams
  3924. ifNoneMatch_ string
  3925. ctx_ context.Context
  3926. header_ http.Header
  3927. }
  3928. // List: Lists the indexes that match the specified filters. Datastore
  3929. // uses an
  3930. // eventually consistent query to fetch the list of indexes and
  3931. // may
  3932. // occasionally return stale results.
  3933. func (r *ProjectsIndexesService) List(projectId string) *ProjectsIndexesListCall {
  3934. c := &ProjectsIndexesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3935. c.projectId = projectId
  3936. return c
  3937. }
  3938. // Filter sets the optional parameter "filter":
  3939. func (c *ProjectsIndexesListCall) Filter(filter string) *ProjectsIndexesListCall {
  3940. c.urlParams_.Set("filter", filter)
  3941. return c
  3942. }
  3943. // PageSize sets the optional parameter "pageSize": The maximum number
  3944. // of items to return. If zero, then all results will be
  3945. // returned.
  3946. func (c *ProjectsIndexesListCall) PageSize(pageSize int64) *ProjectsIndexesListCall {
  3947. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3948. return c
  3949. }
  3950. // PageToken sets the optional parameter "pageToken": The
  3951. // next_page_token value returned from a previous List request, if any.
  3952. func (c *ProjectsIndexesListCall) PageToken(pageToken string) *ProjectsIndexesListCall {
  3953. c.urlParams_.Set("pageToken", pageToken)
  3954. return c
  3955. }
  3956. // Fields allows partial responses to be retrieved. See
  3957. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  3958. // for more information.
  3959. func (c *ProjectsIndexesListCall) Fields(s ...googleapi.Field) *ProjectsIndexesListCall {
  3960. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3961. return c
  3962. }
  3963. // IfNoneMatch sets the optional parameter which makes the operation
  3964. // fail if the object's ETag matches the given value. This is useful for
  3965. // getting updates only after the object has changed since the last
  3966. // request. Use googleapi.IsNotModified to check whether the response
  3967. // error from Do is the result of In-None-Match.
  3968. func (c *ProjectsIndexesListCall) IfNoneMatch(entityTag string) *ProjectsIndexesListCall {
  3969. c.ifNoneMatch_ = entityTag
  3970. return c
  3971. }
  3972. // Context sets the context to be used in this call's Do method. Any
  3973. // pending HTTP request will be aborted if the provided context is
  3974. // canceled.
  3975. func (c *ProjectsIndexesListCall) Context(ctx context.Context) *ProjectsIndexesListCall {
  3976. c.ctx_ = ctx
  3977. return c
  3978. }
  3979. // Header returns an http.Header that can be modified by the caller to
  3980. // add HTTP headers to the request.
  3981. func (c *ProjectsIndexesListCall) Header() http.Header {
  3982. if c.header_ == nil {
  3983. c.header_ = make(http.Header)
  3984. }
  3985. return c.header_
  3986. }
  3987. func (c *ProjectsIndexesListCall) doRequest(alt string) (*http.Response, error) {
  3988. reqHeaders := make(http.Header)
  3989. for k, v := range c.header_ {
  3990. reqHeaders[k] = v
  3991. }
  3992. reqHeaders.Set("User-Agent", c.s.userAgent())
  3993. if c.ifNoneMatch_ != "" {
  3994. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3995. }
  3996. var body io.Reader = nil
  3997. c.urlParams_.Set("alt", alt)
  3998. c.urlParams_.Set("prettyPrint", "false")
  3999. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/projects/{projectId}/indexes")
  4000. urls += "?" + c.urlParams_.Encode()
  4001. req, err := http.NewRequest("GET", urls, body)
  4002. if err != nil {
  4003. return nil, err
  4004. }
  4005. req.Header = reqHeaders
  4006. googleapi.Expand(req.URL, map[string]string{
  4007. "projectId": c.projectId,
  4008. })
  4009. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4010. }
  4011. // Do executes the "datastore.projects.indexes.list" call.
  4012. // Exactly one of *GoogleDatastoreAdminV1ListIndexesResponse or error
  4013. // will be non-nil. Any non-2xx status code is an error. Response
  4014. // headers are in either
  4015. // *GoogleDatastoreAdminV1ListIndexesResponse.ServerResponse.Header or
  4016. // (if a response was returned at all) in
  4017. // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4018. // whether the returned error was because http.StatusNotModified was
  4019. // returned.
  4020. func (c *ProjectsIndexesListCall) Do(opts ...googleapi.CallOption) (*GoogleDatastoreAdminV1ListIndexesResponse, error) {
  4021. gensupport.SetOptions(c.urlParams_, opts...)
  4022. res, err := c.doRequest("json")
  4023. if res != nil && res.StatusCode == http.StatusNotModified {
  4024. if res.Body != nil {
  4025. res.Body.Close()
  4026. }
  4027. return nil, &googleapi.Error{
  4028. Code: res.StatusCode,
  4029. Header: res.Header,
  4030. }
  4031. }
  4032. if err != nil {
  4033. return nil, err
  4034. }
  4035. defer googleapi.CloseBody(res)
  4036. if err := googleapi.CheckResponse(res); err != nil {
  4037. return nil, err
  4038. }
  4039. ret := &GoogleDatastoreAdminV1ListIndexesResponse{
  4040. ServerResponse: googleapi.ServerResponse{
  4041. Header: res.Header,
  4042. HTTPStatusCode: res.StatusCode,
  4043. },
  4044. }
  4045. target := &ret
  4046. if err := gensupport.DecodeResponse(target, res); err != nil {
  4047. return nil, err
  4048. }
  4049. return ret, nil
  4050. // {
  4051. // "description": "Lists the indexes that match the specified filters. Datastore uses an\neventually consistent query to fetch the list of indexes and may\noccasionally return stale results.",
  4052. // "flatPath": "v1/projects/{projectId}/indexes",
  4053. // "httpMethod": "GET",
  4054. // "id": "datastore.projects.indexes.list",
  4055. // "parameterOrder": [
  4056. // "projectId"
  4057. // ],
  4058. // "parameters": {
  4059. // "filter": {
  4060. // "location": "query",
  4061. // "type": "string"
  4062. // },
  4063. // "pageSize": {
  4064. // "description": "The maximum number of items to return. If zero, then all results will be\nreturned.",
  4065. // "format": "int32",
  4066. // "location": "query",
  4067. // "type": "integer"
  4068. // },
  4069. // "pageToken": {
  4070. // "description": "The next_page_token value returned from a previous List request, if any.",
  4071. // "location": "query",
  4072. // "type": "string"
  4073. // },
  4074. // "projectId": {
  4075. // "description": "Project ID against which to make the request.",
  4076. // "location": "path",
  4077. // "required": true,
  4078. // "type": "string"
  4079. // }
  4080. // },
  4081. // "path": "v1/projects/{projectId}/indexes",
  4082. // "response": {
  4083. // "$ref": "GoogleDatastoreAdminV1ListIndexesResponse"
  4084. // },
  4085. // "scopes": [
  4086. // "https://www.googleapis.com/auth/cloud-platform",
  4087. // "https://www.googleapis.com/auth/datastore"
  4088. // ]
  4089. // }
  4090. }
  4091. // Pages invokes f for each page of results.
  4092. // A non-nil error returned from f will halt the iteration.
  4093. // The provided context supersedes any context provided to the Context method.
  4094. func (c *ProjectsIndexesListCall) Pages(ctx context.Context, f func(*GoogleDatastoreAdminV1ListIndexesResponse) error) error {
  4095. c.ctx_ = ctx
  4096. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4097. for {
  4098. x, err := c.Do()
  4099. if err != nil {
  4100. return err
  4101. }
  4102. if err := f(x); err != nil {
  4103. return err
  4104. }
  4105. if x.NextPageToken == "" {
  4106. return nil
  4107. }
  4108. c.PageToken(x.NextPageToken)
  4109. }
  4110. }
  4111. // method id "datastore.projects.operations.cancel":
  4112. type ProjectsOperationsCancelCall struct {
  4113. s *Service
  4114. name string
  4115. urlParams_ gensupport.URLParams
  4116. ctx_ context.Context
  4117. header_ http.Header
  4118. }
  4119. // Cancel: Starts asynchronous cancellation on a long-running operation.
  4120. // The server
  4121. // makes a best effort to cancel the operation, but success is
  4122. // not
  4123. // guaranteed. If the server doesn't support this method, it
  4124. // returns
  4125. // `google.rpc.Code.UNIMPLEMENTED`. Clients can
  4126. // use
  4127. // Operations.GetOperation or
  4128. // other methods to check whether the cancellation succeeded or whether
  4129. // the
  4130. // operation completed despite cancellation. On successful
  4131. // cancellation,
  4132. // the operation is not deleted; instead, it becomes an operation
  4133. // with
  4134. // an Operation.error value with a google.rpc.Status.code of
  4135. // 1,
  4136. // corresponding to `Code.CANCELLED`.
  4137. func (r *ProjectsOperationsService) Cancel(name string) *ProjectsOperationsCancelCall {
  4138. c := &ProjectsOperationsCancelCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4139. c.name = name
  4140. return c
  4141. }
  4142. // Fields allows partial responses to be retrieved. See
  4143. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4144. // for more information.
  4145. func (c *ProjectsOperationsCancelCall) Fields(s ...googleapi.Field) *ProjectsOperationsCancelCall {
  4146. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4147. return c
  4148. }
  4149. // Context sets the context to be used in this call's Do method. Any
  4150. // pending HTTP request will be aborted if the provided context is
  4151. // canceled.
  4152. func (c *ProjectsOperationsCancelCall) Context(ctx context.Context) *ProjectsOperationsCancelCall {
  4153. c.ctx_ = ctx
  4154. return c
  4155. }
  4156. // Header returns an http.Header that can be modified by the caller to
  4157. // add HTTP headers to the request.
  4158. func (c *ProjectsOperationsCancelCall) Header() http.Header {
  4159. if c.header_ == nil {
  4160. c.header_ = make(http.Header)
  4161. }
  4162. return c.header_
  4163. }
  4164. func (c *ProjectsOperationsCancelCall) doRequest(alt string) (*http.Response, error) {
  4165. reqHeaders := make(http.Header)
  4166. for k, v := range c.header_ {
  4167. reqHeaders[k] = v
  4168. }
  4169. reqHeaders.Set("User-Agent", c.s.userAgent())
  4170. var body io.Reader = nil
  4171. c.urlParams_.Set("alt", alt)
  4172. c.urlParams_.Set("prettyPrint", "false")
  4173. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}:cancel")
  4174. urls += "?" + c.urlParams_.Encode()
  4175. req, err := http.NewRequest("POST", urls, body)
  4176. if err != nil {
  4177. return nil, err
  4178. }
  4179. req.Header = reqHeaders
  4180. googleapi.Expand(req.URL, map[string]string{
  4181. "name": c.name,
  4182. })
  4183. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4184. }
  4185. // Do executes the "datastore.projects.operations.cancel" call.
  4186. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  4187. // code is an error. Response headers are in either
  4188. // *Empty.ServerResponse.Header or (if a response was returned at all)
  4189. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4190. // check whether the returned error was because http.StatusNotModified
  4191. // was returned.
  4192. func (c *ProjectsOperationsCancelCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  4193. gensupport.SetOptions(c.urlParams_, opts...)
  4194. res, err := c.doRequest("json")
  4195. if res != nil && res.StatusCode == http.StatusNotModified {
  4196. if res.Body != nil {
  4197. res.Body.Close()
  4198. }
  4199. return nil, &googleapi.Error{
  4200. Code: res.StatusCode,
  4201. Header: res.Header,
  4202. }
  4203. }
  4204. if err != nil {
  4205. return nil, err
  4206. }
  4207. defer googleapi.CloseBody(res)
  4208. if err := googleapi.CheckResponse(res); err != nil {
  4209. return nil, err
  4210. }
  4211. ret := &Empty{
  4212. ServerResponse: googleapi.ServerResponse{
  4213. Header: res.Header,
  4214. HTTPStatusCode: res.StatusCode,
  4215. },
  4216. }
  4217. target := &ret
  4218. if err := gensupport.DecodeResponse(target, res); err != nil {
  4219. return nil, err
  4220. }
  4221. return ret, nil
  4222. // {
  4223. // "description": "Starts asynchronous cancellation on a long-running operation. The server\nmakes a best effort to cancel the operation, but success is not\nguaranteed. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`. Clients can use\nOperations.GetOperation or\nother methods to check whether the cancellation succeeded or whether the\noperation completed despite cancellation. On successful cancellation,\nthe operation is not deleted; instead, it becomes an operation with\nan Operation.error value with a google.rpc.Status.code of 1,\ncorresponding to `Code.CANCELLED`.",
  4224. // "flatPath": "v1/projects/{projectsId}/operations/{operationsId}:cancel",
  4225. // "httpMethod": "POST",
  4226. // "id": "datastore.projects.operations.cancel",
  4227. // "parameterOrder": [
  4228. // "name"
  4229. // ],
  4230. // "parameters": {
  4231. // "name": {
  4232. // "description": "The name of the operation resource to be cancelled.",
  4233. // "location": "path",
  4234. // "pattern": "^projects/[^/]+/operations/[^/]+$",
  4235. // "required": true,
  4236. // "type": "string"
  4237. // }
  4238. // },
  4239. // "path": "v1/{+name}:cancel",
  4240. // "response": {
  4241. // "$ref": "Empty"
  4242. // },
  4243. // "scopes": [
  4244. // "https://www.googleapis.com/auth/cloud-platform",
  4245. // "https://www.googleapis.com/auth/datastore"
  4246. // ]
  4247. // }
  4248. }
  4249. // method id "datastore.projects.operations.delete":
  4250. type ProjectsOperationsDeleteCall struct {
  4251. s *Service
  4252. name string
  4253. urlParams_ gensupport.URLParams
  4254. ctx_ context.Context
  4255. header_ http.Header
  4256. }
  4257. // Delete: Deletes a long-running operation. This method indicates that
  4258. // the client is
  4259. // no longer interested in the operation result. It does not cancel
  4260. // the
  4261. // operation. If the server doesn't support this method, it
  4262. // returns
  4263. // `google.rpc.Code.UNIMPLEMENTED`.
  4264. func (r *ProjectsOperationsService) Delete(name string) *ProjectsOperationsDeleteCall {
  4265. c := &ProjectsOperationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4266. c.name = name
  4267. return c
  4268. }
  4269. // Fields allows partial responses to be retrieved. See
  4270. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4271. // for more information.
  4272. func (c *ProjectsOperationsDeleteCall) Fields(s ...googleapi.Field) *ProjectsOperationsDeleteCall {
  4273. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4274. return c
  4275. }
  4276. // Context sets the context to be used in this call's Do method. Any
  4277. // pending HTTP request will be aborted if the provided context is
  4278. // canceled.
  4279. func (c *ProjectsOperationsDeleteCall) Context(ctx context.Context) *ProjectsOperationsDeleteCall {
  4280. c.ctx_ = ctx
  4281. return c
  4282. }
  4283. // Header returns an http.Header that can be modified by the caller to
  4284. // add HTTP headers to the request.
  4285. func (c *ProjectsOperationsDeleteCall) Header() http.Header {
  4286. if c.header_ == nil {
  4287. c.header_ = make(http.Header)
  4288. }
  4289. return c.header_
  4290. }
  4291. func (c *ProjectsOperationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  4292. reqHeaders := make(http.Header)
  4293. for k, v := range c.header_ {
  4294. reqHeaders[k] = v
  4295. }
  4296. reqHeaders.Set("User-Agent", c.s.userAgent())
  4297. var body io.Reader = nil
  4298. c.urlParams_.Set("alt", alt)
  4299. c.urlParams_.Set("prettyPrint", "false")
  4300. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  4301. urls += "?" + c.urlParams_.Encode()
  4302. req, err := http.NewRequest("DELETE", urls, body)
  4303. if err != nil {
  4304. return nil, err
  4305. }
  4306. req.Header = reqHeaders
  4307. googleapi.Expand(req.URL, map[string]string{
  4308. "name": c.name,
  4309. })
  4310. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4311. }
  4312. // Do executes the "datastore.projects.operations.delete" call.
  4313. // Exactly one of *Empty or error will be non-nil. Any non-2xx status
  4314. // code is an error. Response headers are in either
  4315. // *Empty.ServerResponse.Header or (if a response was returned at all)
  4316. // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4317. // check whether the returned error was because http.StatusNotModified
  4318. // was returned.
  4319. func (c *ProjectsOperationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  4320. gensupport.SetOptions(c.urlParams_, opts...)
  4321. res, err := c.doRequest("json")
  4322. if res != nil && res.StatusCode == http.StatusNotModified {
  4323. if res.Body != nil {
  4324. res.Body.Close()
  4325. }
  4326. return nil, &googleapi.Error{
  4327. Code: res.StatusCode,
  4328. Header: res.Header,
  4329. }
  4330. }
  4331. if err != nil {
  4332. return nil, err
  4333. }
  4334. defer googleapi.CloseBody(res)
  4335. if err := googleapi.CheckResponse(res); err != nil {
  4336. return nil, err
  4337. }
  4338. ret := &Empty{
  4339. ServerResponse: googleapi.ServerResponse{
  4340. Header: res.Header,
  4341. HTTPStatusCode: res.StatusCode,
  4342. },
  4343. }
  4344. target := &ret
  4345. if err := gensupport.DecodeResponse(target, res); err != nil {
  4346. return nil, err
  4347. }
  4348. return ret, nil
  4349. // {
  4350. // "description": "Deletes a long-running operation. This method indicates that the client is\nno longer interested in the operation result. It does not cancel the\noperation. If the server doesn't support this method, it returns\n`google.rpc.Code.UNIMPLEMENTED`.",
  4351. // "flatPath": "v1/projects/{projectsId}/operations/{operationsId}",
  4352. // "httpMethod": "DELETE",
  4353. // "id": "datastore.projects.operations.delete",
  4354. // "parameterOrder": [
  4355. // "name"
  4356. // ],
  4357. // "parameters": {
  4358. // "name": {
  4359. // "description": "The name of the operation resource to be deleted.",
  4360. // "location": "path",
  4361. // "pattern": "^projects/[^/]+/operations/[^/]+$",
  4362. // "required": true,
  4363. // "type": "string"
  4364. // }
  4365. // },
  4366. // "path": "v1/{+name}",
  4367. // "response": {
  4368. // "$ref": "Empty"
  4369. // },
  4370. // "scopes": [
  4371. // "https://www.googleapis.com/auth/cloud-platform",
  4372. // "https://www.googleapis.com/auth/datastore"
  4373. // ]
  4374. // }
  4375. }
  4376. // method id "datastore.projects.operations.get":
  4377. type ProjectsOperationsGetCall struct {
  4378. s *Service
  4379. name string
  4380. urlParams_ gensupport.URLParams
  4381. ifNoneMatch_ string
  4382. ctx_ context.Context
  4383. header_ http.Header
  4384. }
  4385. // Get: Gets the latest state of a long-running operation. Clients can
  4386. // use this
  4387. // method to poll the operation result at intervals as recommended by
  4388. // the API
  4389. // service.
  4390. func (r *ProjectsOperationsService) Get(name string) *ProjectsOperationsGetCall {
  4391. c := &ProjectsOperationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4392. c.name = name
  4393. return c
  4394. }
  4395. // Fields allows partial responses to be retrieved. See
  4396. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4397. // for more information.
  4398. func (c *ProjectsOperationsGetCall) Fields(s ...googleapi.Field) *ProjectsOperationsGetCall {
  4399. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4400. return c
  4401. }
  4402. // IfNoneMatch sets the optional parameter which makes the operation
  4403. // fail if the object's ETag matches the given value. This is useful for
  4404. // getting updates only after the object has changed since the last
  4405. // request. Use googleapi.IsNotModified to check whether the response
  4406. // error from Do is the result of In-None-Match.
  4407. func (c *ProjectsOperationsGetCall) IfNoneMatch(entityTag string) *ProjectsOperationsGetCall {
  4408. c.ifNoneMatch_ = entityTag
  4409. return c
  4410. }
  4411. // Context sets the context to be used in this call's Do method. Any
  4412. // pending HTTP request will be aborted if the provided context is
  4413. // canceled.
  4414. func (c *ProjectsOperationsGetCall) Context(ctx context.Context) *ProjectsOperationsGetCall {
  4415. c.ctx_ = ctx
  4416. return c
  4417. }
  4418. // Header returns an http.Header that can be modified by the caller to
  4419. // add HTTP headers to the request.
  4420. func (c *ProjectsOperationsGetCall) Header() http.Header {
  4421. if c.header_ == nil {
  4422. c.header_ = make(http.Header)
  4423. }
  4424. return c.header_
  4425. }
  4426. func (c *ProjectsOperationsGetCall) doRequest(alt string) (*http.Response, error) {
  4427. reqHeaders := make(http.Header)
  4428. for k, v := range c.header_ {
  4429. reqHeaders[k] = v
  4430. }
  4431. reqHeaders.Set("User-Agent", c.s.userAgent())
  4432. if c.ifNoneMatch_ != "" {
  4433. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4434. }
  4435. var body io.Reader = nil
  4436. c.urlParams_.Set("alt", alt)
  4437. c.urlParams_.Set("prettyPrint", "false")
  4438. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}")
  4439. urls += "?" + c.urlParams_.Encode()
  4440. req, err := http.NewRequest("GET", urls, body)
  4441. if err != nil {
  4442. return nil, err
  4443. }
  4444. req.Header = reqHeaders
  4445. googleapi.Expand(req.URL, map[string]string{
  4446. "name": c.name,
  4447. })
  4448. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4449. }
  4450. // Do executes the "datastore.projects.operations.get" call.
  4451. // Exactly one of *GoogleLongrunningOperation or error will be non-nil.
  4452. // Any non-2xx status code is an error. Response headers are in either
  4453. // *GoogleLongrunningOperation.ServerResponse.Header or (if a response
  4454. // was returned at all) in error.(*googleapi.Error).Header. Use
  4455. // googleapi.IsNotModified to check whether the returned error was
  4456. // because http.StatusNotModified was returned.
  4457. func (c *ProjectsOperationsGetCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningOperation, error) {
  4458. gensupport.SetOptions(c.urlParams_, opts...)
  4459. res, err := c.doRequest("json")
  4460. if res != nil && res.StatusCode == http.StatusNotModified {
  4461. if res.Body != nil {
  4462. res.Body.Close()
  4463. }
  4464. return nil, &googleapi.Error{
  4465. Code: res.StatusCode,
  4466. Header: res.Header,
  4467. }
  4468. }
  4469. if err != nil {
  4470. return nil, err
  4471. }
  4472. defer googleapi.CloseBody(res)
  4473. if err := googleapi.CheckResponse(res); err != nil {
  4474. return nil, err
  4475. }
  4476. ret := &GoogleLongrunningOperation{
  4477. ServerResponse: googleapi.ServerResponse{
  4478. Header: res.Header,
  4479. HTTPStatusCode: res.StatusCode,
  4480. },
  4481. }
  4482. target := &ret
  4483. if err := gensupport.DecodeResponse(target, res); err != nil {
  4484. return nil, err
  4485. }
  4486. return ret, nil
  4487. // {
  4488. // "description": "Gets the latest state of a long-running operation. Clients can use this\nmethod to poll the operation result at intervals as recommended by the API\nservice.",
  4489. // "flatPath": "v1/projects/{projectsId}/operations/{operationsId}",
  4490. // "httpMethod": "GET",
  4491. // "id": "datastore.projects.operations.get",
  4492. // "parameterOrder": [
  4493. // "name"
  4494. // ],
  4495. // "parameters": {
  4496. // "name": {
  4497. // "description": "The name of the operation resource.",
  4498. // "location": "path",
  4499. // "pattern": "^projects/[^/]+/operations/[^/]+$",
  4500. // "required": true,
  4501. // "type": "string"
  4502. // }
  4503. // },
  4504. // "path": "v1/{+name}",
  4505. // "response": {
  4506. // "$ref": "GoogleLongrunningOperation"
  4507. // },
  4508. // "scopes": [
  4509. // "https://www.googleapis.com/auth/cloud-platform",
  4510. // "https://www.googleapis.com/auth/datastore"
  4511. // ]
  4512. // }
  4513. }
  4514. // method id "datastore.projects.operations.list":
  4515. type ProjectsOperationsListCall struct {
  4516. s *Service
  4517. name string
  4518. urlParams_ gensupport.URLParams
  4519. ifNoneMatch_ string
  4520. ctx_ context.Context
  4521. header_ http.Header
  4522. }
  4523. // List: Lists operations that match the specified filter in the
  4524. // request. If the
  4525. // server doesn't support this method, it returns
  4526. // `UNIMPLEMENTED`.
  4527. //
  4528. // NOTE: the `name` binding allows API services to override the
  4529. // binding
  4530. // to use different resource name schemes, such as `users/*/operations`.
  4531. // To
  4532. // override the binding, API services can add a binding such
  4533. // as
  4534. // "/v1/{name=users/*}/operations" to their service configuration.
  4535. // For backwards compatibility, the default name includes the
  4536. // operations
  4537. // collection id, however overriding users must ensure the name
  4538. // binding
  4539. // is the parent resource, without the operations collection id.
  4540. func (r *ProjectsOperationsService) List(name string) *ProjectsOperationsListCall {
  4541. c := &ProjectsOperationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4542. c.name = name
  4543. return c
  4544. }
  4545. // Filter sets the optional parameter "filter": The standard list
  4546. // filter.
  4547. func (c *ProjectsOperationsListCall) Filter(filter string) *ProjectsOperationsListCall {
  4548. c.urlParams_.Set("filter", filter)
  4549. return c
  4550. }
  4551. // PageSize sets the optional parameter "pageSize": The standard list
  4552. // page size.
  4553. func (c *ProjectsOperationsListCall) PageSize(pageSize int64) *ProjectsOperationsListCall {
  4554. c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4555. return c
  4556. }
  4557. // PageToken sets the optional parameter "pageToken": The standard list
  4558. // page token.
  4559. func (c *ProjectsOperationsListCall) PageToken(pageToken string) *ProjectsOperationsListCall {
  4560. c.urlParams_.Set("pageToken", pageToken)
  4561. return c
  4562. }
  4563. // Fields allows partial responses to be retrieved. See
  4564. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  4565. // for more information.
  4566. func (c *ProjectsOperationsListCall) Fields(s ...googleapi.Field) *ProjectsOperationsListCall {
  4567. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4568. return c
  4569. }
  4570. // IfNoneMatch sets the optional parameter which makes the operation
  4571. // fail if the object's ETag matches the given value. This is useful for
  4572. // getting updates only after the object has changed since the last
  4573. // request. Use googleapi.IsNotModified to check whether the response
  4574. // error from Do is the result of In-None-Match.
  4575. func (c *ProjectsOperationsListCall) IfNoneMatch(entityTag string) *ProjectsOperationsListCall {
  4576. c.ifNoneMatch_ = entityTag
  4577. return c
  4578. }
  4579. // Context sets the context to be used in this call's Do method. Any
  4580. // pending HTTP request will be aborted if the provided context is
  4581. // canceled.
  4582. func (c *ProjectsOperationsListCall) Context(ctx context.Context) *ProjectsOperationsListCall {
  4583. c.ctx_ = ctx
  4584. return c
  4585. }
  4586. // Header returns an http.Header that can be modified by the caller to
  4587. // add HTTP headers to the request.
  4588. func (c *ProjectsOperationsListCall) Header() http.Header {
  4589. if c.header_ == nil {
  4590. c.header_ = make(http.Header)
  4591. }
  4592. return c.header_
  4593. }
  4594. func (c *ProjectsOperationsListCall) doRequest(alt string) (*http.Response, error) {
  4595. reqHeaders := make(http.Header)
  4596. for k, v := range c.header_ {
  4597. reqHeaders[k] = v
  4598. }
  4599. reqHeaders.Set("User-Agent", c.s.userAgent())
  4600. if c.ifNoneMatch_ != "" {
  4601. reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4602. }
  4603. var body io.Reader = nil
  4604. c.urlParams_.Set("alt", alt)
  4605. c.urlParams_.Set("prettyPrint", "false")
  4606. urls := googleapi.ResolveRelative(c.s.BasePath, "v1/{+name}/operations")
  4607. urls += "?" + c.urlParams_.Encode()
  4608. req, err := http.NewRequest("GET", urls, body)
  4609. if err != nil {
  4610. return nil, err
  4611. }
  4612. req.Header = reqHeaders
  4613. googleapi.Expand(req.URL, map[string]string{
  4614. "name": c.name,
  4615. })
  4616. return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4617. }
  4618. // Do executes the "datastore.projects.operations.list" call.
  4619. // Exactly one of *GoogleLongrunningListOperationsResponse or error will
  4620. // be non-nil. Any non-2xx status code is an error. Response headers are
  4621. // in either
  4622. // *GoogleLongrunningListOperationsResponse.ServerResponse.Header or (if
  4623. // a response was returned at all) in error.(*googleapi.Error).Header.
  4624. // Use googleapi.IsNotModified to check whether the returned error was
  4625. // because http.StatusNotModified was returned.
  4626. func (c *ProjectsOperationsListCall) Do(opts ...googleapi.CallOption) (*GoogleLongrunningListOperationsResponse, error) {
  4627. gensupport.SetOptions(c.urlParams_, opts...)
  4628. res, err := c.doRequest("json")
  4629. if res != nil && res.StatusCode == http.StatusNotModified {
  4630. if res.Body != nil {
  4631. res.Body.Close()
  4632. }
  4633. return nil, &googleapi.Error{
  4634. Code: res.StatusCode,
  4635. Header: res.Header,
  4636. }
  4637. }
  4638. if err != nil {
  4639. return nil, err
  4640. }
  4641. defer googleapi.CloseBody(res)
  4642. if err := googleapi.CheckResponse(res); err != nil {
  4643. return nil, err
  4644. }
  4645. ret := &GoogleLongrunningListOperationsResponse{
  4646. ServerResponse: googleapi.ServerResponse{
  4647. Header: res.Header,
  4648. HTTPStatusCode: res.StatusCode,
  4649. },
  4650. }
  4651. target := &ret
  4652. if err := gensupport.DecodeResponse(target, res); err != nil {
  4653. return nil, err
  4654. }
  4655. return ret, nil
  4656. // {
  4657. // "description": "Lists operations that match the specified filter in the request. If the\nserver doesn't support this method, it returns `UNIMPLEMENTED`.\n\nNOTE: the `name` binding allows API services to override the binding\nto use different resource name schemes, such as `users/*/operations`. To\noverride the binding, API services can add a binding such as\n`\"/v1/{name=users/*}/operations\"` to their service configuration.\nFor backwards compatibility, the default name includes the operations\ncollection id, however overriding users must ensure the name binding\nis the parent resource, without the operations collection id.",
  4658. // "flatPath": "v1/projects/{projectsId}/operations",
  4659. // "httpMethod": "GET",
  4660. // "id": "datastore.projects.operations.list",
  4661. // "parameterOrder": [
  4662. // "name"
  4663. // ],
  4664. // "parameters": {
  4665. // "filter": {
  4666. // "description": "The standard list filter.",
  4667. // "location": "query",
  4668. // "type": "string"
  4669. // },
  4670. // "name": {
  4671. // "description": "The name of the operation's parent resource.",
  4672. // "location": "path",
  4673. // "pattern": "^projects/[^/]+$",
  4674. // "required": true,
  4675. // "type": "string"
  4676. // },
  4677. // "pageSize": {
  4678. // "description": "The standard list page size.",
  4679. // "format": "int32",
  4680. // "location": "query",
  4681. // "type": "integer"
  4682. // },
  4683. // "pageToken": {
  4684. // "description": "The standard list page token.",
  4685. // "location": "query",
  4686. // "type": "string"
  4687. // }
  4688. // },
  4689. // "path": "v1/{+name}/operations",
  4690. // "response": {
  4691. // "$ref": "GoogleLongrunningListOperationsResponse"
  4692. // },
  4693. // "scopes": [
  4694. // "https://www.googleapis.com/auth/cloud-platform",
  4695. // "https://www.googleapis.com/auth/datastore"
  4696. // ]
  4697. // }
  4698. }
  4699. // Pages invokes f for each page of results.
  4700. // A non-nil error returned from f will halt the iteration.
  4701. // The provided context supersedes any context provided to the Context method.
  4702. func (c *ProjectsOperationsListCall) Pages(ctx context.Context, f func(*GoogleLongrunningListOperationsResponse) error) error {
  4703. c.ctx_ = ctx
  4704. defer c.PageToken(c.urlParams_.Get("pageToken")) // reset paging to original point
  4705. for {
  4706. x, err := c.Do()
  4707. if err != nil {
  4708. return err
  4709. }
  4710. if err := f(x); err != nil {
  4711. return err
  4712. }
  4713. if x.NextPageToken == "" {
  4714. return nil
  4715. }
  4716. c.PageToken(x.NextPageToken)
  4717. }
  4718. }