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.
 
 
 

4555 lines
167 KiB

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