datastore-gen.go 65 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885
  1. // Package datastore provides access to the Google Cloud Datastore API.
  2. //
  3. // See https://developers.google.com/datastore/
  4. //
  5. // Usage example:
  6. //
  7. // import "google.golang.org/api/datastore/v1beta2"
  8. // ...
  9. // datastoreService, err := datastore.New(oauthHttpClient)
  10. package datastore // import "google.golang.org/api/datastore/v1beta2"
  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:v1beta2"
  41. const apiName = "datastore"
  42. const apiVersion = "v1beta2"
  43. const basePath = "https://www.googleapis.com/datastore/v1beta2/datasets/"
  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. // View your email address
  51. UserinfoEmailScope = "https://www.googleapis.com/auth/userinfo.email"
  52. )
  53. func New(client *http.Client) (*Service, error) {
  54. if client == nil {
  55. return nil, errors.New("client is nil")
  56. }
  57. s := &Service{client: client, BasePath: basePath}
  58. s.Datasets = NewDatasetsService(s)
  59. return s, nil
  60. }
  61. type Service struct {
  62. client *http.Client
  63. BasePath string // API endpoint base URL
  64. UserAgent string // optional additional User-Agent fragment
  65. Datasets *DatasetsService
  66. }
  67. func (s *Service) userAgent() string {
  68. if s.UserAgent == "" {
  69. return googleapi.UserAgent
  70. }
  71. return googleapi.UserAgent + " " + s.UserAgent
  72. }
  73. func NewDatasetsService(s *Service) *DatasetsService {
  74. rs := &DatasetsService{s: s}
  75. return rs
  76. }
  77. type DatasetsService struct {
  78. s *Service
  79. }
  80. type AllocateIdsRequest struct {
  81. // Keys: A list of keys with incomplete key paths to allocate IDs for.
  82. // No key may be reserved/read-only.
  83. Keys []*Key `json:"keys,omitempty"`
  84. // ForceSendFields is a list of field names (e.g. "Keys") to
  85. // unconditionally include in API requests. By default, fields with
  86. // empty values are omitted from API requests. However, any non-pointer,
  87. // non-interface field appearing in ForceSendFields will be sent to the
  88. // server regardless of whether the field is empty or not. This may be
  89. // used to include empty fields in Patch requests.
  90. ForceSendFields []string `json:"-"`
  91. }
  92. func (s *AllocateIdsRequest) MarshalJSON() ([]byte, error) {
  93. type noMethod AllocateIdsRequest
  94. raw := noMethod(*s)
  95. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  96. }
  97. type AllocateIdsResponse struct {
  98. Header *ResponseHeader `json:"header,omitempty"`
  99. // Keys: The keys specified in the request (in the same order), each
  100. // with its key path completed with a newly allocated ID.
  101. Keys []*Key `json:"keys,omitempty"`
  102. // ServerResponse contains the HTTP response code and headers from the
  103. // server.
  104. googleapi.ServerResponse `json:"-"`
  105. // ForceSendFields is a list of field names (e.g. "Header") to
  106. // unconditionally include in API requests. By default, fields with
  107. // empty values are omitted from API requests. However, any non-pointer,
  108. // non-interface field appearing in ForceSendFields will be sent to the
  109. // server regardless of whether the field is empty or not. This may be
  110. // used to include empty fields in Patch requests.
  111. ForceSendFields []string `json:"-"`
  112. }
  113. func (s *AllocateIdsResponse) MarshalJSON() ([]byte, error) {
  114. type noMethod AllocateIdsResponse
  115. raw := noMethod(*s)
  116. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  117. }
  118. type BeginTransactionRequest struct {
  119. // IsolationLevel: The transaction isolation level. Either snapshot or
  120. // serializable. The default isolation level is snapshot isolation,
  121. // which means that another transaction may not concurrently modify the
  122. // data that is modified by this transaction. Optionally, a transaction
  123. // can request to be made serializable which means that another
  124. // transaction cannot concurrently modify the data that is read or
  125. // modified by this transaction.
  126. //
  127. // Possible values:
  128. // "SERIALIZABLE"
  129. // "SNAPSHOT"
  130. IsolationLevel string `json:"isolationLevel,omitempty"`
  131. // ForceSendFields is a list of field names (e.g. "IsolationLevel") to
  132. // unconditionally include in API requests. By default, fields with
  133. // empty values are omitted from API requests. However, any non-pointer,
  134. // non-interface field appearing in ForceSendFields will be sent to the
  135. // server regardless of whether the field is empty or not. This may be
  136. // used to include empty fields in Patch requests.
  137. ForceSendFields []string `json:"-"`
  138. }
  139. func (s *BeginTransactionRequest) MarshalJSON() ([]byte, error) {
  140. type noMethod BeginTransactionRequest
  141. raw := noMethod(*s)
  142. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  143. }
  144. type BeginTransactionResponse struct {
  145. Header *ResponseHeader `json:"header,omitempty"`
  146. // Transaction: The transaction identifier (always present).
  147. Transaction string `json:"transaction,omitempty"`
  148. // ServerResponse contains the HTTP response code and headers from the
  149. // server.
  150. googleapi.ServerResponse `json:"-"`
  151. // ForceSendFields is a list of field names (e.g. "Header") to
  152. // unconditionally include in API requests. By default, fields with
  153. // empty values are omitted from API requests. However, any non-pointer,
  154. // non-interface field appearing in ForceSendFields will be sent to the
  155. // server regardless of whether the field is empty or not. This may be
  156. // used to include empty fields in Patch requests.
  157. ForceSendFields []string `json:"-"`
  158. }
  159. func (s *BeginTransactionResponse) MarshalJSON() ([]byte, error) {
  160. type noMethod BeginTransactionResponse
  161. raw := noMethod(*s)
  162. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  163. }
  164. type CommitRequest struct {
  165. IgnoreReadOnly bool `json:"ignoreReadOnly,omitempty"`
  166. // Mode: The type of commit to perform. Either TRANSACTIONAL or
  167. // NON_TRANSACTIONAL.
  168. //
  169. // Possible values:
  170. // "NON_TRANSACTIONAL"
  171. // "TRANSACTIONAL"
  172. Mode string `json:"mode,omitempty"`
  173. // Mutation: The mutation to perform. Optional.
  174. Mutation *Mutation `json:"mutation,omitempty"`
  175. // Transaction: The transaction identifier, returned by a call to
  176. // beginTransaction. Must be set when mode is TRANSACTIONAL.
  177. Transaction string `json:"transaction,omitempty"`
  178. // ForceSendFields is a list of field names (e.g. "IgnoreReadOnly") to
  179. // unconditionally include in API requests. By default, fields with
  180. // empty values are omitted from API requests. However, any non-pointer,
  181. // non-interface field appearing in ForceSendFields will be sent to the
  182. // server regardless of whether the field is empty or not. This may be
  183. // used to include empty fields in Patch requests.
  184. ForceSendFields []string `json:"-"`
  185. }
  186. func (s *CommitRequest) MarshalJSON() ([]byte, error) {
  187. type noMethod CommitRequest
  188. raw := noMethod(*s)
  189. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  190. }
  191. type CommitResponse struct {
  192. Header *ResponseHeader `json:"header,omitempty"`
  193. // MutationResult: The result of performing the mutation (if any).
  194. MutationResult *MutationResult `json:"mutationResult,omitempty"`
  195. // ServerResponse contains the HTTP response code and headers from the
  196. // server.
  197. googleapi.ServerResponse `json:"-"`
  198. // ForceSendFields is a list of field names (e.g. "Header") to
  199. // unconditionally include in API requests. By default, fields with
  200. // empty values are omitted from API requests. However, any non-pointer,
  201. // non-interface field appearing in ForceSendFields will be sent to the
  202. // server regardless of whether the field is empty or not. This may be
  203. // used to include empty fields in Patch requests.
  204. ForceSendFields []string `json:"-"`
  205. }
  206. func (s *CommitResponse) MarshalJSON() ([]byte, error) {
  207. type noMethod CommitResponse
  208. raw := noMethod(*s)
  209. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  210. }
  211. // CompositeFilter: A filter that merges the multiple other filters
  212. // using the given operation.
  213. type CompositeFilter struct {
  214. // Filters: The list of filters to combine. Must contain at least one
  215. // filter.
  216. Filters []*Filter `json:"filters,omitempty"`
  217. // Operator: The operator for combining multiple filters. Only "and" is
  218. // currently supported.
  219. //
  220. // Possible values:
  221. // "AND"
  222. Operator string `json:"operator,omitempty"`
  223. // ForceSendFields is a list of field names (e.g. "Filters") to
  224. // unconditionally include in API requests. By default, fields with
  225. // empty values are omitted from API requests. However, any non-pointer,
  226. // non-interface field appearing in ForceSendFields will be sent to the
  227. // server regardless of whether the field is empty or not. This may be
  228. // used to include empty fields in Patch requests.
  229. ForceSendFields []string `json:"-"`
  230. }
  231. func (s *CompositeFilter) MarshalJSON() ([]byte, error) {
  232. type noMethod CompositeFilter
  233. raw := noMethod(*s)
  234. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  235. }
  236. // Entity: An entity.
  237. type Entity struct {
  238. // Key: The entity's key.
  239. //
  240. // An entity must have a key, unless otherwise documented (for example,
  241. // an entity in Value.entityValue may have no key). An entity's kind is
  242. // its key's path's last element's kind, or null if it has no key.
  243. Key *Key `json:"key,omitempty"`
  244. // Properties: The entity's properties.
  245. Properties map[string]Property `json:"properties,omitempty"`
  246. // ForceSendFields is a list of field names (e.g. "Key") to
  247. // unconditionally include in API requests. By default, fields with
  248. // empty values are omitted from API requests. However, any non-pointer,
  249. // non-interface field appearing in ForceSendFields will be sent to the
  250. // server regardless of whether the field is empty or not. This may be
  251. // used to include empty fields in Patch requests.
  252. ForceSendFields []string `json:"-"`
  253. }
  254. func (s *Entity) MarshalJSON() ([]byte, error) {
  255. type noMethod Entity
  256. raw := noMethod(*s)
  257. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  258. }
  259. // EntityResult: The result of fetching an entity from the datastore.
  260. type EntityResult struct {
  261. // Entity: The resulting entity.
  262. Entity *Entity `json:"entity,omitempty"`
  263. // ForceSendFields is a list of field names (e.g. "Entity") to
  264. // unconditionally include in API requests. By default, fields with
  265. // empty values are omitted from API requests. However, any non-pointer,
  266. // non-interface field appearing in ForceSendFields will be sent to the
  267. // server regardless of whether the field is empty or not. This may be
  268. // used to include empty fields in Patch requests.
  269. ForceSendFields []string `json:"-"`
  270. }
  271. func (s *EntityResult) MarshalJSON() ([]byte, error) {
  272. type noMethod EntityResult
  273. raw := noMethod(*s)
  274. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  275. }
  276. // Filter: A holder for any type of filter. Exactly one field should be
  277. // specified.
  278. type Filter struct {
  279. // CompositeFilter: A composite filter.
  280. CompositeFilter *CompositeFilter `json:"compositeFilter,omitempty"`
  281. // PropertyFilter: A filter on a property.
  282. PropertyFilter *PropertyFilter `json:"propertyFilter,omitempty"`
  283. // ForceSendFields is a list of field names (e.g. "CompositeFilter") to
  284. // unconditionally include in API requests. By default, fields with
  285. // empty values are omitted from API requests. However, any non-pointer,
  286. // non-interface field appearing in ForceSendFields will be sent to the
  287. // server regardless of whether the field is empty or not. This may be
  288. // used to include empty fields in Patch requests.
  289. ForceSendFields []string `json:"-"`
  290. }
  291. func (s *Filter) MarshalJSON() ([]byte, error) {
  292. type noMethod Filter
  293. raw := noMethod(*s)
  294. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  295. }
  296. // GqlQuery: A GQL query.
  297. type GqlQuery struct {
  298. // AllowLiteral: When false, the query string must not contain a
  299. // literal.
  300. AllowLiteral bool `json:"allowLiteral,omitempty"`
  301. // NameArgs: A named argument must set field GqlQueryArg.name. No two
  302. // named arguments may have the same name. For each non-reserved named
  303. // binding site in the query string, there must be a named argument with
  304. // that name, but not necessarily the inverse.
  305. NameArgs []*GqlQueryArg `json:"nameArgs,omitempty"`
  306. // NumberArgs: Numbered binding site @1 references the first numbered
  307. // argument, effectively using 1-based indexing, rather than the usual
  308. // 0. A numbered argument must NOT set field GqlQueryArg.name. For each
  309. // binding site numbered i in query_string, there must be an ith
  310. // numbered argument. The inverse must also be true.
  311. NumberArgs []*GqlQueryArg `json:"numberArgs,omitempty"`
  312. // QueryString: The query string.
  313. QueryString string `json:"queryString,omitempty"`
  314. // ForceSendFields is a list of field names (e.g. "AllowLiteral") to
  315. // unconditionally include in API requests. By default, fields with
  316. // empty values are omitted from API requests. However, any non-pointer,
  317. // non-interface field appearing in ForceSendFields will be sent to the
  318. // server regardless of whether the field is empty or not. This may be
  319. // used to include empty fields in Patch requests.
  320. ForceSendFields []string `json:"-"`
  321. }
  322. func (s *GqlQuery) MarshalJSON() ([]byte, error) {
  323. type noMethod GqlQuery
  324. raw := noMethod(*s)
  325. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  326. }
  327. // GqlQueryArg: A binding argument for a GQL query.
  328. type GqlQueryArg struct {
  329. Cursor string `json:"cursor,omitempty"`
  330. // Name: Must match regex "[A-Za-z_$][A-Za-z_$0-9]*". Must not match
  331. // regex "__.*__". Must not be "".
  332. Name string `json:"name,omitempty"`
  333. Value *Value `json:"value,omitempty"`
  334. // ForceSendFields is a list of field names (e.g. "Cursor") to
  335. // unconditionally include in API requests. By default, fields with
  336. // empty values are omitted from API requests. However, any non-pointer,
  337. // non-interface field appearing in ForceSendFields will be sent to the
  338. // server regardless of whether the field is empty or not. This may be
  339. // used to include empty fields in Patch requests.
  340. ForceSendFields []string `json:"-"`
  341. }
  342. func (s *GqlQueryArg) MarshalJSON() ([]byte, error) {
  343. type noMethod GqlQueryArg
  344. raw := noMethod(*s)
  345. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  346. }
  347. // Key: A unique identifier for an entity.
  348. type Key struct {
  349. // PartitionId: Entities are partitioned into subsets, currently
  350. // identified by a dataset (usually implicitly specified by the project)
  351. // and namespace ID. Queries are scoped to a single partition.
  352. PartitionId *PartitionId `json:"partitionId,omitempty"`
  353. // Path: The entity path. An entity path consists of one or more
  354. // elements composed of a kind and a string or numerical identifier,
  355. // which identify entities. The first element identifies a root entity,
  356. // the second element identifies a child of the root entity, the third
  357. // element a child of the second entity, and so forth. The entities
  358. // identified by all prefixes of the path are called the element's
  359. // ancestors. An entity path is always fully complete: ALL of the
  360. // entity's ancestors are required to be in the path along with the
  361. // entity identifier itself. The only exception is that in some
  362. // documented cases, the identifier in the last path element (for the
  363. // entity) itself may be omitted. A path can never be empty. The path
  364. // can have at most 100 elements.
  365. Path []*KeyPathElement `json:"path,omitempty"`
  366. // ForceSendFields is a list of field names (e.g. "PartitionId") to
  367. // unconditionally include in API requests. By default, fields with
  368. // empty values are omitted from API requests. However, any non-pointer,
  369. // non-interface field appearing in ForceSendFields will be sent to the
  370. // server regardless of whether the field is empty or not. This may be
  371. // used to include empty fields in Patch requests.
  372. ForceSendFields []string `json:"-"`
  373. }
  374. func (s *Key) MarshalJSON() ([]byte, error) {
  375. type noMethod Key
  376. raw := noMethod(*s)
  377. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  378. }
  379. // KeyPathElement: A (kind, ID/name) pair used to construct a key
  380. // path.
  381. //
  382. // At most one of name or ID may be set. If either is set, the element
  383. // is complete. If neither is set, the element is incomplete.
  384. type KeyPathElement struct {
  385. // Id: The ID of the entity. Never equal to zero. Values less than zero
  386. // are discouraged and will not be supported in the future.
  387. Id int64 `json:"id,omitempty,string"`
  388. // Kind: The kind of the entity. A kind matching regex "__.*__" is
  389. // reserved/read-only. A kind must not contain more than 500 characters.
  390. // Cannot be "".
  391. Kind string `json:"kind,omitempty"`
  392. // Name: The name of the entity. A name matching regex "__.*__" is
  393. // reserved/read-only. A name must not be more than 500 characters.
  394. // Cannot be "".
  395. Name string `json:"name,omitempty"`
  396. // ForceSendFields is a list of field names (e.g. "Id") to
  397. // unconditionally include in API requests. By default, fields with
  398. // empty values are omitted from API requests. However, any non-pointer,
  399. // non-interface field appearing in ForceSendFields will be sent to the
  400. // server regardless of whether the field is empty or not. This may be
  401. // used to include empty fields in Patch requests.
  402. ForceSendFields []string `json:"-"`
  403. }
  404. func (s *KeyPathElement) MarshalJSON() ([]byte, error) {
  405. type noMethod KeyPathElement
  406. raw := noMethod(*s)
  407. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  408. }
  409. // KindExpression: A representation of a kind.
  410. type KindExpression struct {
  411. // Name: The name of the kind.
  412. Name string `json:"name,omitempty"`
  413. // ForceSendFields is a list of field names (e.g. "Name") to
  414. // unconditionally include in API requests. By default, fields with
  415. // empty values are omitted from API requests. However, any non-pointer,
  416. // non-interface field appearing in ForceSendFields will be sent to the
  417. // server regardless of whether the field is empty or not. This may be
  418. // used to include empty fields in Patch requests.
  419. ForceSendFields []string `json:"-"`
  420. }
  421. func (s *KindExpression) MarshalJSON() ([]byte, error) {
  422. type noMethod KindExpression
  423. raw := noMethod(*s)
  424. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  425. }
  426. type LookupRequest struct {
  427. // Keys: Keys of entities to look up from the datastore.
  428. Keys []*Key `json:"keys,omitempty"`
  429. // ReadOptions: Options for this lookup request. Optional.
  430. ReadOptions *ReadOptions `json:"readOptions,omitempty"`
  431. // ForceSendFields is a list of field names (e.g. "Keys") to
  432. // unconditionally include in API requests. By default, fields with
  433. // empty values are omitted from API requests. However, any non-pointer,
  434. // non-interface field appearing in ForceSendFields will be sent to the
  435. // server regardless of whether the field is empty or not. This may be
  436. // used to include empty fields in Patch requests.
  437. ForceSendFields []string `json:"-"`
  438. }
  439. func (s *LookupRequest) MarshalJSON() ([]byte, error) {
  440. type noMethod LookupRequest
  441. raw := noMethod(*s)
  442. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  443. }
  444. type LookupResponse struct {
  445. // Deferred: A list of keys that were not looked up due to resource
  446. // constraints.
  447. Deferred []*Key `json:"deferred,omitempty"`
  448. // Found: Entities found.
  449. Found []*EntityResult `json:"found,omitempty"`
  450. Header *ResponseHeader `json:"header,omitempty"`
  451. // Missing: Entities not found, with only the key populated.
  452. Missing []*EntityResult `json:"missing,omitempty"`
  453. // ServerResponse contains the HTTP response code and headers from the
  454. // server.
  455. googleapi.ServerResponse `json:"-"`
  456. // ForceSendFields is a list of field names (e.g. "Deferred") to
  457. // unconditionally include in API requests. By default, fields with
  458. // empty values are omitted from API requests. However, any non-pointer,
  459. // non-interface field appearing in ForceSendFields will be sent to the
  460. // server regardless of whether the field is empty or not. This may be
  461. // used to include empty fields in Patch requests.
  462. ForceSendFields []string `json:"-"`
  463. }
  464. func (s *LookupResponse) MarshalJSON() ([]byte, error) {
  465. type noMethod LookupResponse
  466. raw := noMethod(*s)
  467. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  468. }
  469. // Mutation: A set of changes to apply.
  470. type Mutation struct {
  471. // Delete: Keys of entities to delete. Each key must have a complete key
  472. // path and must not be reserved/read-only.
  473. Delete []*Key `json:"delete,omitempty"`
  474. // Force: Ignore a user specified read-only period. Optional.
  475. Force bool `json:"force,omitempty"`
  476. // Insert: Entities to insert. Each inserted entity's key must have a
  477. // complete path and must not be reserved/read-only.
  478. Insert []*Entity `json:"insert,omitempty"`
  479. // InsertAutoId: Insert entities with a newly allocated ID. Each
  480. // inserted entity's key must omit the final identifier in its path and
  481. // must not be reserved/read-only.
  482. InsertAutoId []*Entity `json:"insertAutoId,omitempty"`
  483. // Update: Entities to update. Each updated entity's key must have a
  484. // complete path and must not be reserved/read-only.
  485. Update []*Entity `json:"update,omitempty"`
  486. // Upsert: Entities to upsert. Each upserted entity's key must have a
  487. // complete path and must not be reserved/read-only.
  488. Upsert []*Entity `json:"upsert,omitempty"`
  489. // ForceSendFields is a list of field names (e.g. "Delete") to
  490. // unconditionally include in API requests. By default, fields with
  491. // empty values are omitted from API requests. However, any non-pointer,
  492. // non-interface field appearing in ForceSendFields will be sent to the
  493. // server regardless of whether the field is empty or not. This may be
  494. // used to include empty fields in Patch requests.
  495. ForceSendFields []string `json:"-"`
  496. }
  497. func (s *Mutation) MarshalJSON() ([]byte, error) {
  498. type noMethod Mutation
  499. raw := noMethod(*s)
  500. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  501. }
  502. type MutationResult struct {
  503. // IndexUpdates: Number of index writes.
  504. IndexUpdates int64 `json:"indexUpdates,omitempty"`
  505. // InsertAutoIdKeys: Keys for insertAutoId entities. One per entity from
  506. // the request, in the same order.
  507. InsertAutoIdKeys []*Key `json:"insertAutoIdKeys,omitempty"`
  508. // ForceSendFields is a list of field names (e.g. "IndexUpdates") to
  509. // unconditionally include in API requests. By default, fields with
  510. // empty values are omitted from API requests. However, any non-pointer,
  511. // non-interface field appearing in ForceSendFields will be sent to the
  512. // server regardless of whether the field is empty or not. This may be
  513. // used to include empty fields in Patch requests.
  514. ForceSendFields []string `json:"-"`
  515. }
  516. func (s *MutationResult) MarshalJSON() ([]byte, error) {
  517. type noMethod MutationResult
  518. raw := noMethod(*s)
  519. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  520. }
  521. // PartitionId: An identifier for a particular subset of
  522. // entities.
  523. //
  524. // Entities are partitioned into various subsets, each used by different
  525. // datasets and different namespaces within a dataset and so forth.
  526. type PartitionId struct {
  527. // DatasetId: The dataset ID.
  528. DatasetId string `json:"datasetId,omitempty"`
  529. // Namespace: The namespace.
  530. Namespace string `json:"namespace,omitempty"`
  531. // ForceSendFields is a list of field names (e.g. "DatasetId") to
  532. // unconditionally include in API requests. By default, fields with
  533. // empty values are omitted from API requests. However, any non-pointer,
  534. // non-interface field appearing in ForceSendFields will be sent to the
  535. // server regardless of whether the field is empty or not. This may be
  536. // used to include empty fields in Patch requests.
  537. ForceSendFields []string `json:"-"`
  538. }
  539. func (s *PartitionId) MarshalJSON() ([]byte, error) {
  540. type noMethod PartitionId
  541. raw := noMethod(*s)
  542. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  543. }
  544. // Property: An entity property.
  545. type Property struct {
  546. // BlobKeyValue: A blob key value.
  547. BlobKeyValue *string `json:"blobKeyValue,omitempty"`
  548. // BlobValue: A blob value. May be a maximum of 1,000,000 bytes. When
  549. // indexed is true, may have at most 500 bytes.
  550. BlobValue *string `json:"blobValue,omitempty"`
  551. // BooleanValue: A boolean value.
  552. BooleanValue *bool `json:"booleanValue,omitempty"`
  553. // DateTimeValue: A timestamp value.
  554. DateTimeValue *string `json:"dateTimeValue,omitempty"`
  555. // DoubleValue: A double value.
  556. DoubleValue *float64 `json:"doubleValue,omitempty"`
  557. // EntityValue: An entity value. May have no key. May have a key with an
  558. // incomplete key path. May have a reserved/read-only key.
  559. EntityValue *Entity `json:"entityValue,omitempty"`
  560. // Indexed: If the value should be indexed.
  561. //
  562. // The indexed property may be set for a null value. When indexed is
  563. // true, stringValue is limited to 500 characters and the blob value is
  564. // limited to 500 bytes. Input values by default have indexed set to
  565. // true; however, you can explicitly set indexed to true if you want.
  566. // (An output value never has indexed explicitly set to true.) If a
  567. // value is itself an entity, it cannot have indexed set to true.
  568. Indexed *bool `json:"indexed,omitempty"`
  569. // IntegerValue: An integer value.
  570. IntegerValue *int64 `json:"integerValue,omitempty,string"`
  571. // KeyValue: A key value.
  572. KeyValue *Key `json:"keyValue,omitempty"`
  573. // ListValue: A list value. Cannot contain another list value. A Value
  574. // instance that sets field list_value must not set field meaning or
  575. // field indexed.
  576. ListValue []*Value `json:"listValue,omitempty"`
  577. // Meaning: The meaning field is reserved and should not be used.
  578. Meaning int64 `json:"meaning,omitempty"`
  579. // StringValue: A UTF-8 encoded string value. When indexed is true, may
  580. // have at most 500 characters.
  581. StringValue *string `json:"stringValue,omitempty"`
  582. // ForceSendFields is a list of field names (e.g. "BlobKeyValue") to
  583. // unconditionally include in API requests. By default, fields with
  584. // empty values are omitted from API requests. However, any non-pointer,
  585. // non-interface field appearing in ForceSendFields will be sent to the
  586. // server regardless of whether the field is empty or not. This may be
  587. // used to include empty fields in Patch requests.
  588. ForceSendFields []string `json:"-"`
  589. }
  590. func (s *Property) MarshalJSON() ([]byte, error) {
  591. type noMethod Property
  592. raw := noMethod(*s)
  593. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  594. }
  595. // PropertyExpression: A representation of a property in a projection.
  596. type PropertyExpression struct {
  597. // AggregationFunction: The aggregation function to apply to the
  598. // property. Optional. Can only be used when grouping by at least one
  599. // property. Must then be set on all properties in the projection that
  600. // are not being grouped by. Aggregation functions: first selects the
  601. // first result as determined by the query's order.
  602. //
  603. // Possible values:
  604. // "FIRST"
  605. AggregationFunction string `json:"aggregationFunction,omitempty"`
  606. // Property: The property to project.
  607. Property *PropertyReference `json:"property,omitempty"`
  608. // ForceSendFields is a list of field names (e.g. "AggregationFunction")
  609. // to 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. }
  616. func (s *PropertyExpression) MarshalJSON() ([]byte, error) {
  617. type noMethod PropertyExpression
  618. raw := noMethod(*s)
  619. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  620. }
  621. // PropertyFilter: A filter on a specific property.
  622. type PropertyFilter struct {
  623. // Operator: The operator to filter by. One of lessThan,
  624. // lessThanOrEqual, greaterThan, greaterThanOrEqual, equal, or
  625. // hasAncestor.
  626. //
  627. // Possible values:
  628. // "EQUAL"
  629. // "GREATER_THAN"
  630. // "GREATER_THAN_OR_EQUAL"
  631. // "HAS_ANCESTOR"
  632. // "LESS_THAN"
  633. // "LESS_THAN_OR_EQUAL"
  634. Operator string `json:"operator,omitempty"`
  635. // Property: The property to filter by.
  636. Property *PropertyReference `json:"property,omitempty"`
  637. // Value: The value to compare the property to.
  638. Value *Value `json:"value,omitempty"`
  639. // ForceSendFields is a list of field names (e.g. "Operator") to
  640. // unconditionally include in API requests. By default, fields with
  641. // empty values are omitted from API requests. However, any non-pointer,
  642. // non-interface field appearing in ForceSendFields will be sent to the
  643. // server regardless of whether the field is empty or not. This may be
  644. // used to include empty fields in Patch requests.
  645. ForceSendFields []string `json:"-"`
  646. }
  647. func (s *PropertyFilter) MarshalJSON() ([]byte, error) {
  648. type noMethod PropertyFilter
  649. raw := noMethod(*s)
  650. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  651. }
  652. // PropertyOrder: The desired order for a specific property.
  653. type PropertyOrder struct {
  654. // Direction: The direction to order by. One of ascending or descending.
  655. // Optional, defaults to ascending.
  656. //
  657. // Possible values:
  658. // "ASCENDING"
  659. // "DESCENDING"
  660. Direction string `json:"direction,omitempty"`
  661. // Property: The property to order by.
  662. Property *PropertyReference `json:"property,omitempty"`
  663. // ForceSendFields is a list of field names (e.g. "Direction") to
  664. // unconditionally include in API requests. By default, fields with
  665. // empty values are omitted from API requests. However, any non-pointer,
  666. // non-interface field appearing in ForceSendFields will be sent to the
  667. // server regardless of whether the field is empty or not. This may be
  668. // used to include empty fields in Patch requests.
  669. ForceSendFields []string `json:"-"`
  670. }
  671. func (s *PropertyOrder) MarshalJSON() ([]byte, error) {
  672. type noMethod PropertyOrder
  673. raw := noMethod(*s)
  674. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  675. }
  676. // PropertyReference: A reference to a property relative to the kind
  677. // expressions.
  678. type PropertyReference struct {
  679. // Name: The name of the property.
  680. Name string `json:"name,omitempty"`
  681. // ForceSendFields is a list of field names (e.g. "Name") to
  682. // unconditionally include in API requests. By default, fields with
  683. // empty values are omitted from API requests. However, any non-pointer,
  684. // non-interface field appearing in ForceSendFields will be sent to the
  685. // server regardless of whether the field is empty or not. This may be
  686. // used to include empty fields in Patch requests.
  687. ForceSendFields []string `json:"-"`
  688. }
  689. func (s *PropertyReference) MarshalJSON() ([]byte, error) {
  690. type noMethod PropertyReference
  691. raw := noMethod(*s)
  692. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  693. }
  694. // Query: A query.
  695. type Query struct {
  696. // EndCursor: An ending point for the query results. Optional. Query
  697. // cursors are returned in query result batches.
  698. EndCursor string `json:"endCursor,omitempty"`
  699. // Filter: The filter to apply (optional).
  700. Filter *Filter `json:"filter,omitempty"`
  701. // GroupBy: The properties to group by (if empty, no grouping is applied
  702. // to the result set).
  703. GroupBy []*PropertyReference `json:"groupBy,omitempty"`
  704. // Kinds: The kinds to query (if empty, returns entities from all
  705. // kinds).
  706. Kinds []*KindExpression `json:"kinds,omitempty"`
  707. // Limit: The maximum number of results to return. Applies after all
  708. // other constraints. Optional.
  709. Limit int64 `json:"limit,omitempty"`
  710. // Offset: The number of results to skip. Applies before limit, but
  711. // after all other constraints (optional, defaults to 0).
  712. Offset int64 `json:"offset,omitempty"`
  713. // Order: The order to apply to the query results (if empty, order is
  714. // unspecified).
  715. Order []*PropertyOrder `json:"order,omitempty"`
  716. // Projection: The projection to return. If not set the entire entity is
  717. // returned.
  718. Projection []*PropertyExpression `json:"projection,omitempty"`
  719. // StartCursor: A starting point for the query results. Optional. Query
  720. // cursors are returned in query result batches.
  721. StartCursor string `json:"startCursor,omitempty"`
  722. // ForceSendFields is a list of field names (e.g. "EndCursor") to
  723. // unconditionally include in API requests. By default, fields with
  724. // empty values are omitted from API requests. However, any non-pointer,
  725. // non-interface field appearing in ForceSendFields will be sent to the
  726. // server regardless of whether the field is empty or not. This may be
  727. // used to include empty fields in Patch requests.
  728. ForceSendFields []string `json:"-"`
  729. }
  730. func (s *Query) MarshalJSON() ([]byte, error) {
  731. type noMethod Query
  732. raw := noMethod(*s)
  733. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  734. }
  735. // QueryResultBatch: A batch of results produced by a query.
  736. type QueryResultBatch struct {
  737. // EndCursor: A cursor that points to the position after the last result
  738. // in the batch. May be absent. TODO(arfuller): Once all plans produce
  739. // cursors update documentation here.
  740. EndCursor string `json:"endCursor,omitempty"`
  741. // EntityResultType: The result type for every entity in entityResults.
  742. // full for full entities, projection for entities with only projected
  743. // properties, keyOnly for entities with only a key.
  744. //
  745. // Possible values:
  746. // "FULL"
  747. // "KEY_ONLY"
  748. // "PROJECTION"
  749. EntityResultType string `json:"entityResultType,omitempty"`
  750. // EntityResults: The results for this batch.
  751. EntityResults []*EntityResult `json:"entityResults,omitempty"`
  752. // MoreResults: The state of the query after the current batch. One of
  753. // notFinished, moreResultsAfterLimit, noMoreResults.
  754. //
  755. // Possible values:
  756. // "MORE_RESULTS_AFTER_LIMIT"
  757. // "NOT_FINISHED"
  758. // "NO_MORE_RESULTS"
  759. MoreResults string `json:"moreResults,omitempty"`
  760. // SkippedResults: The number of results skipped because of
  761. // Query.offset.
  762. SkippedResults int64 `json:"skippedResults,omitempty"`
  763. // ForceSendFields is a list of field names (e.g. "EndCursor") to
  764. // unconditionally include in API requests. By default, fields with
  765. // empty values are omitted from API requests. However, any non-pointer,
  766. // non-interface field appearing in ForceSendFields will be sent to the
  767. // server regardless of whether the field is empty or not. This may be
  768. // used to include empty fields in Patch requests.
  769. ForceSendFields []string `json:"-"`
  770. }
  771. func (s *QueryResultBatch) MarshalJSON() ([]byte, error) {
  772. type noMethod QueryResultBatch
  773. raw := noMethod(*s)
  774. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  775. }
  776. type ReadOptions struct {
  777. // ReadConsistency: The read consistency to use. One of default, strong,
  778. // or eventual. Cannot be set when transaction is set. Lookup and
  779. // ancestor queries default to strong, global queries default to
  780. // eventual and cannot be set to strong. Optional. Default is default.
  781. //
  782. // Possible values:
  783. // "DEFAULT"
  784. // "EVENTUAL"
  785. // "STRONG"
  786. ReadConsistency string `json:"readConsistency,omitempty"`
  787. // Transaction: The transaction to use. Optional.
  788. Transaction string `json:"transaction,omitempty"`
  789. // ForceSendFields is a list of field names (e.g. "ReadConsistency") to
  790. // unconditionally include in API requests. By default, fields with
  791. // empty values are omitted from API requests. However, any non-pointer,
  792. // non-interface field appearing in ForceSendFields will be sent to the
  793. // server regardless of whether the field is empty or not. This may be
  794. // used to include empty fields in Patch requests.
  795. ForceSendFields []string `json:"-"`
  796. }
  797. func (s *ReadOptions) MarshalJSON() ([]byte, error) {
  798. type noMethod ReadOptions
  799. raw := noMethod(*s)
  800. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  801. }
  802. type ResponseHeader struct {
  803. // Kind: Identifies what kind of resource this is. Value: the fixed
  804. // string "datastore#responseHeader".
  805. Kind string `json:"kind,omitempty"`
  806. // ForceSendFields is a list of field names (e.g. "Kind") to
  807. // unconditionally include in API requests. By default, fields with
  808. // empty values are omitted from API requests. However, any non-pointer,
  809. // non-interface field appearing in ForceSendFields will be sent to the
  810. // server regardless of whether the field is empty or not. This may be
  811. // used to include empty fields in Patch requests.
  812. ForceSendFields []string `json:"-"`
  813. }
  814. func (s *ResponseHeader) MarshalJSON() ([]byte, error) {
  815. type noMethod ResponseHeader
  816. raw := noMethod(*s)
  817. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  818. }
  819. type RollbackRequest struct {
  820. // Transaction: The transaction identifier, returned by a call to
  821. // beginTransaction.
  822. Transaction string `json:"transaction,omitempty"`
  823. // ForceSendFields is a list of field names (e.g. "Transaction") to
  824. // unconditionally include in API requests. By default, fields with
  825. // empty values are omitted from API requests. However, any non-pointer,
  826. // non-interface field appearing in ForceSendFields will be sent to the
  827. // server regardless of whether the field is empty or not. This may be
  828. // used to include empty fields in Patch requests.
  829. ForceSendFields []string `json:"-"`
  830. }
  831. func (s *RollbackRequest) MarshalJSON() ([]byte, error) {
  832. type noMethod RollbackRequest
  833. raw := noMethod(*s)
  834. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  835. }
  836. type RollbackResponse struct {
  837. Header *ResponseHeader `json:"header,omitempty"`
  838. // ServerResponse contains the HTTP response code and headers from the
  839. // server.
  840. googleapi.ServerResponse `json:"-"`
  841. // ForceSendFields is a list of field names (e.g. "Header") to
  842. // unconditionally include in API requests. By default, fields with
  843. // empty values are omitted from API requests. However, any non-pointer,
  844. // non-interface field appearing in ForceSendFields will be sent to the
  845. // server regardless of whether the field is empty or not. This may be
  846. // used to include empty fields in Patch requests.
  847. ForceSendFields []string `json:"-"`
  848. }
  849. func (s *RollbackResponse) MarshalJSON() ([]byte, error) {
  850. type noMethod RollbackResponse
  851. raw := noMethod(*s)
  852. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  853. }
  854. type RunQueryRequest struct {
  855. // GqlQuery: The GQL query to run. Either this field or field query must
  856. // be set, but not both.
  857. GqlQuery *GqlQuery `json:"gqlQuery,omitempty"`
  858. // PartitionId: Entities are partitioned into subsets, identified by a
  859. // dataset (usually implicitly specified by the project) and namespace
  860. // ID. Queries are scoped to a single partition. This partition ID is
  861. // normalized with the standard default context partition ID, but all
  862. // other partition IDs in RunQueryRequest are normalized with this
  863. // partition ID as the context partition ID.
  864. PartitionId *PartitionId `json:"partitionId,omitempty"`
  865. // Query: The query to run. Either this field or field gql_query must be
  866. // set, but not both.
  867. Query *Query `json:"query,omitempty"`
  868. // ReadOptions: The options for this query.
  869. ReadOptions *ReadOptions `json:"readOptions,omitempty"`
  870. // ForceSendFields is a list of field names (e.g. "GqlQuery") to
  871. // unconditionally include in API requests. By default, fields with
  872. // empty values are omitted from API requests. However, any non-pointer,
  873. // non-interface field appearing in ForceSendFields will be sent to the
  874. // server regardless of whether the field is empty or not. This may be
  875. // used to include empty fields in Patch requests.
  876. ForceSendFields []string `json:"-"`
  877. }
  878. func (s *RunQueryRequest) MarshalJSON() ([]byte, error) {
  879. type noMethod RunQueryRequest
  880. raw := noMethod(*s)
  881. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  882. }
  883. type RunQueryResponse struct {
  884. // Batch: A batch of query results (always present).
  885. Batch *QueryResultBatch `json:"batch,omitempty"`
  886. Header *ResponseHeader `json:"header,omitempty"`
  887. // ServerResponse contains the HTTP response code and headers from the
  888. // server.
  889. googleapi.ServerResponse `json:"-"`
  890. // ForceSendFields is a list of field names (e.g. "Batch") to
  891. // unconditionally include in API requests. By default, fields with
  892. // empty values are omitted from API requests. However, any non-pointer,
  893. // non-interface field appearing in ForceSendFields will be sent to the
  894. // server regardless of whether the field is empty or not. This may be
  895. // used to include empty fields in Patch requests.
  896. ForceSendFields []string `json:"-"`
  897. }
  898. func (s *RunQueryResponse) MarshalJSON() ([]byte, error) {
  899. type noMethod RunQueryResponse
  900. raw := noMethod(*s)
  901. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  902. }
  903. // Value: A message that can hold any of the supported value types and
  904. // associated metadata.
  905. type Value struct {
  906. // BlobKeyValue: A blob key value.
  907. BlobKeyValue string `json:"blobKeyValue,omitempty"`
  908. // BlobValue: A blob value. May be a maximum of 1,000,000 bytes. When
  909. // indexed is true, may have at most 500 bytes.
  910. BlobValue string `json:"blobValue,omitempty"`
  911. // BooleanValue: A boolean value.
  912. BooleanValue bool `json:"booleanValue,omitempty"`
  913. // DateTimeValue: A timestamp value.
  914. DateTimeValue string `json:"dateTimeValue,omitempty"`
  915. // DoubleValue: A double value.
  916. DoubleValue float64 `json:"doubleValue,omitempty"`
  917. // EntityValue: An entity value. May have no key. May have a key with an
  918. // incomplete key path. May have a reserved/read-only key.
  919. EntityValue *Entity `json:"entityValue,omitempty"`
  920. // Indexed: If the value should be indexed.
  921. //
  922. // The indexed property may be set for a null value. When indexed is
  923. // true, stringValue is limited to 500 characters and the blob value is
  924. // limited to 500 bytes. Input values by default have indexed set to
  925. // true; however, you can explicitly set indexed to true if you want.
  926. // (An output value never has indexed explicitly set to true.) If a
  927. // value is itself an entity, it cannot have indexed set to true.
  928. Indexed bool `json:"indexed,omitempty"`
  929. // IntegerValue: An integer value.
  930. IntegerValue int64 `json:"integerValue,omitempty,string"`
  931. // KeyValue: A key value.
  932. KeyValue *Key `json:"keyValue,omitempty"`
  933. // ListValue: A list value. Cannot contain another list value. A Value
  934. // instance that sets field list_value must not set field meaning or
  935. // field indexed.
  936. ListValue []*Value `json:"listValue,omitempty"`
  937. // Meaning: The meaning field is reserved and should not be used.
  938. Meaning int64 `json:"meaning,omitempty"`
  939. // StringValue: A UTF-8 encoded string value. When indexed is true, may
  940. // have at most 500 characters.
  941. StringValue string `json:"stringValue,omitempty"`
  942. // ForceSendFields is a list of field names (e.g. "BlobKeyValue") to
  943. // unconditionally include in API requests. By default, fields with
  944. // empty values are omitted from API requests. However, any non-pointer,
  945. // non-interface field appearing in ForceSendFields will be sent to the
  946. // server regardless of whether the field is empty or not. This may be
  947. // used to include empty fields in Patch requests.
  948. ForceSendFields []string `json:"-"`
  949. }
  950. func (s *Value) MarshalJSON() ([]byte, error) {
  951. type noMethod Value
  952. raw := noMethod(*s)
  953. return gensupport.MarshalJSON(raw, s.ForceSendFields)
  954. }
  955. // method id "datastore.datasets.allocateIds":
  956. type DatasetsAllocateIdsCall struct {
  957. s *Service
  958. datasetId string
  959. allocateidsrequest *AllocateIdsRequest
  960. urlParams_ gensupport.URLParams
  961. ctx_ context.Context
  962. }
  963. // AllocateIds: Allocate IDs for incomplete keys (useful for referencing
  964. // an entity before it is inserted).
  965. func (r *DatasetsService) AllocateIds(datasetId string, allocateidsrequest *AllocateIdsRequest) *DatasetsAllocateIdsCall {
  966. c := &DatasetsAllocateIdsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  967. c.datasetId = datasetId
  968. c.allocateidsrequest = allocateidsrequest
  969. return c
  970. }
  971. // Fields allows partial responses to be retrieved. See
  972. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  973. // for more information.
  974. func (c *DatasetsAllocateIdsCall) Fields(s ...googleapi.Field) *DatasetsAllocateIdsCall {
  975. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  976. return c
  977. }
  978. // Context sets the context to be used in this call's Do method. Any
  979. // pending HTTP request will be aborted if the provided context is
  980. // canceled.
  981. func (c *DatasetsAllocateIdsCall) Context(ctx context.Context) *DatasetsAllocateIdsCall {
  982. c.ctx_ = ctx
  983. return c
  984. }
  985. func (c *DatasetsAllocateIdsCall) doRequest(alt string) (*http.Response, error) {
  986. var body io.Reader = nil
  987. body, err := googleapi.WithoutDataWrapper.JSONReader(c.allocateidsrequest)
  988. if err != nil {
  989. return nil, err
  990. }
  991. ctype := "application/json"
  992. c.urlParams_.Set("alt", alt)
  993. urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/allocateIds")
  994. urls += "?" + c.urlParams_.Encode()
  995. req, _ := http.NewRequest("POST", urls, body)
  996. googleapi.Expand(req.URL, map[string]string{
  997. "datasetId": c.datasetId,
  998. })
  999. req.Header.Set("Content-Type", ctype)
  1000. req.Header.Set("User-Agent", c.s.userAgent())
  1001. if c.ctx_ != nil {
  1002. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1003. }
  1004. return c.s.client.Do(req)
  1005. }
  1006. // Do executes the "datastore.datasets.allocateIds" call.
  1007. // Exactly one of *AllocateIdsResponse or error will be non-nil. Any
  1008. // non-2xx status code is an error. Response headers are in either
  1009. // *AllocateIdsResponse.ServerResponse.Header or (if a response was
  1010. // returned at all) in error.(*googleapi.Error).Header. Use
  1011. // googleapi.IsNotModified to check whether the returned error was
  1012. // because http.StatusNotModified was returned.
  1013. func (c *DatasetsAllocateIdsCall) Do(opts ...googleapi.CallOption) (*AllocateIdsResponse, error) {
  1014. gensupport.SetOptions(c.urlParams_, opts...)
  1015. res, err := c.doRequest("json")
  1016. if res != nil && res.StatusCode == http.StatusNotModified {
  1017. if res.Body != nil {
  1018. res.Body.Close()
  1019. }
  1020. return nil, &googleapi.Error{
  1021. Code: res.StatusCode,
  1022. Header: res.Header,
  1023. }
  1024. }
  1025. if err != nil {
  1026. return nil, err
  1027. }
  1028. defer googleapi.CloseBody(res)
  1029. if err := googleapi.CheckResponse(res); err != nil {
  1030. return nil, err
  1031. }
  1032. ret := &AllocateIdsResponse{
  1033. ServerResponse: googleapi.ServerResponse{
  1034. Header: res.Header,
  1035. HTTPStatusCode: res.StatusCode,
  1036. },
  1037. }
  1038. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1039. return nil, err
  1040. }
  1041. return ret, nil
  1042. // {
  1043. // "description": "Allocate IDs for incomplete keys (useful for referencing an entity before it is inserted).",
  1044. // "httpMethod": "POST",
  1045. // "id": "datastore.datasets.allocateIds",
  1046. // "parameterOrder": [
  1047. // "datasetId"
  1048. // ],
  1049. // "parameters": {
  1050. // "datasetId": {
  1051. // "description": "Identifies the dataset.",
  1052. // "location": "path",
  1053. // "required": true,
  1054. // "type": "string"
  1055. // }
  1056. // },
  1057. // "path": "{datasetId}/allocateIds",
  1058. // "request": {
  1059. // "$ref": "AllocateIdsRequest"
  1060. // },
  1061. // "response": {
  1062. // "$ref": "AllocateIdsResponse"
  1063. // },
  1064. // "scopes": [
  1065. // "https://www.googleapis.com/auth/cloud-platform",
  1066. // "https://www.googleapis.com/auth/datastore",
  1067. // "https://www.googleapis.com/auth/userinfo.email"
  1068. // ]
  1069. // }
  1070. }
  1071. // method id "datastore.datasets.beginTransaction":
  1072. type DatasetsBeginTransactionCall struct {
  1073. s *Service
  1074. datasetId string
  1075. begintransactionrequest *BeginTransactionRequest
  1076. urlParams_ gensupport.URLParams
  1077. ctx_ context.Context
  1078. }
  1079. // BeginTransaction: Begin a new transaction.
  1080. func (r *DatasetsService) BeginTransaction(datasetId string, begintransactionrequest *BeginTransactionRequest) *DatasetsBeginTransactionCall {
  1081. c := &DatasetsBeginTransactionCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1082. c.datasetId = datasetId
  1083. c.begintransactionrequest = begintransactionrequest
  1084. return c
  1085. }
  1086. // Fields allows partial responses to be retrieved. See
  1087. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1088. // for more information.
  1089. func (c *DatasetsBeginTransactionCall) Fields(s ...googleapi.Field) *DatasetsBeginTransactionCall {
  1090. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1091. return c
  1092. }
  1093. // Context sets the context to be used in this call's Do method. Any
  1094. // pending HTTP request will be aborted if the provided context is
  1095. // canceled.
  1096. func (c *DatasetsBeginTransactionCall) Context(ctx context.Context) *DatasetsBeginTransactionCall {
  1097. c.ctx_ = ctx
  1098. return c
  1099. }
  1100. func (c *DatasetsBeginTransactionCall) doRequest(alt string) (*http.Response, error) {
  1101. var body io.Reader = nil
  1102. body, err := googleapi.WithoutDataWrapper.JSONReader(c.begintransactionrequest)
  1103. if err != nil {
  1104. return nil, err
  1105. }
  1106. ctype := "application/json"
  1107. c.urlParams_.Set("alt", alt)
  1108. urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/beginTransaction")
  1109. urls += "?" + c.urlParams_.Encode()
  1110. req, _ := http.NewRequest("POST", urls, body)
  1111. googleapi.Expand(req.URL, map[string]string{
  1112. "datasetId": c.datasetId,
  1113. })
  1114. req.Header.Set("Content-Type", ctype)
  1115. req.Header.Set("User-Agent", c.s.userAgent())
  1116. if c.ctx_ != nil {
  1117. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1118. }
  1119. return c.s.client.Do(req)
  1120. }
  1121. // Do executes the "datastore.datasets.beginTransaction" call.
  1122. // Exactly one of *BeginTransactionResponse or error will be non-nil.
  1123. // Any non-2xx status code is an error. Response headers are in either
  1124. // *BeginTransactionResponse.ServerResponse.Header or (if a response was
  1125. // returned at all) in error.(*googleapi.Error).Header. Use
  1126. // googleapi.IsNotModified to check whether the returned error was
  1127. // because http.StatusNotModified was returned.
  1128. func (c *DatasetsBeginTransactionCall) Do(opts ...googleapi.CallOption) (*BeginTransactionResponse, error) {
  1129. gensupport.SetOptions(c.urlParams_, opts...)
  1130. res, err := c.doRequest("json")
  1131. if res != nil && res.StatusCode == http.StatusNotModified {
  1132. if res.Body != nil {
  1133. res.Body.Close()
  1134. }
  1135. return nil, &googleapi.Error{
  1136. Code: res.StatusCode,
  1137. Header: res.Header,
  1138. }
  1139. }
  1140. if err != nil {
  1141. return nil, err
  1142. }
  1143. defer googleapi.CloseBody(res)
  1144. if err := googleapi.CheckResponse(res); err != nil {
  1145. return nil, err
  1146. }
  1147. ret := &BeginTransactionResponse{
  1148. ServerResponse: googleapi.ServerResponse{
  1149. Header: res.Header,
  1150. HTTPStatusCode: res.StatusCode,
  1151. },
  1152. }
  1153. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1154. return nil, err
  1155. }
  1156. return ret, nil
  1157. // {
  1158. // "description": "Begin a new transaction.",
  1159. // "httpMethod": "POST",
  1160. // "id": "datastore.datasets.beginTransaction",
  1161. // "parameterOrder": [
  1162. // "datasetId"
  1163. // ],
  1164. // "parameters": {
  1165. // "datasetId": {
  1166. // "description": "Identifies the dataset.",
  1167. // "location": "path",
  1168. // "required": true,
  1169. // "type": "string"
  1170. // }
  1171. // },
  1172. // "path": "{datasetId}/beginTransaction",
  1173. // "request": {
  1174. // "$ref": "BeginTransactionRequest"
  1175. // },
  1176. // "response": {
  1177. // "$ref": "BeginTransactionResponse"
  1178. // },
  1179. // "scopes": [
  1180. // "https://www.googleapis.com/auth/cloud-platform",
  1181. // "https://www.googleapis.com/auth/datastore",
  1182. // "https://www.googleapis.com/auth/userinfo.email"
  1183. // ]
  1184. // }
  1185. }
  1186. // method id "datastore.datasets.commit":
  1187. type DatasetsCommitCall struct {
  1188. s *Service
  1189. datasetId string
  1190. commitrequest *CommitRequest
  1191. urlParams_ gensupport.URLParams
  1192. ctx_ context.Context
  1193. }
  1194. // Commit: Commit a transaction, optionally creating, deleting or
  1195. // modifying some entities.
  1196. func (r *DatasetsService) Commit(datasetId string, commitrequest *CommitRequest) *DatasetsCommitCall {
  1197. c := &DatasetsCommitCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1198. c.datasetId = datasetId
  1199. c.commitrequest = commitrequest
  1200. return c
  1201. }
  1202. // Fields allows partial responses to be retrieved. See
  1203. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1204. // for more information.
  1205. func (c *DatasetsCommitCall) Fields(s ...googleapi.Field) *DatasetsCommitCall {
  1206. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1207. return c
  1208. }
  1209. // Context sets the context to be used in this call's Do method. Any
  1210. // pending HTTP request will be aborted if the provided context is
  1211. // canceled.
  1212. func (c *DatasetsCommitCall) Context(ctx context.Context) *DatasetsCommitCall {
  1213. c.ctx_ = ctx
  1214. return c
  1215. }
  1216. func (c *DatasetsCommitCall) doRequest(alt string) (*http.Response, error) {
  1217. var body io.Reader = nil
  1218. body, err := googleapi.WithoutDataWrapper.JSONReader(c.commitrequest)
  1219. if err != nil {
  1220. return nil, err
  1221. }
  1222. ctype := "application/json"
  1223. c.urlParams_.Set("alt", alt)
  1224. urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/commit")
  1225. urls += "?" + c.urlParams_.Encode()
  1226. req, _ := http.NewRequest("POST", urls, body)
  1227. googleapi.Expand(req.URL, map[string]string{
  1228. "datasetId": c.datasetId,
  1229. })
  1230. req.Header.Set("Content-Type", ctype)
  1231. req.Header.Set("User-Agent", c.s.userAgent())
  1232. if c.ctx_ != nil {
  1233. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1234. }
  1235. return c.s.client.Do(req)
  1236. }
  1237. // Do executes the "datastore.datasets.commit" call.
  1238. // Exactly one of *CommitResponse or error will be non-nil. Any non-2xx
  1239. // status code is an error. Response headers are in either
  1240. // *CommitResponse.ServerResponse.Header or (if a response was returned
  1241. // at all) in error.(*googleapi.Error).Header. Use
  1242. // googleapi.IsNotModified to check whether the returned error was
  1243. // because http.StatusNotModified was returned.
  1244. func (c *DatasetsCommitCall) Do(opts ...googleapi.CallOption) (*CommitResponse, error) {
  1245. gensupport.SetOptions(c.urlParams_, opts...)
  1246. res, err := c.doRequest("json")
  1247. if res != nil && res.StatusCode == http.StatusNotModified {
  1248. if res.Body != nil {
  1249. res.Body.Close()
  1250. }
  1251. return nil, &googleapi.Error{
  1252. Code: res.StatusCode,
  1253. Header: res.Header,
  1254. }
  1255. }
  1256. if err != nil {
  1257. return nil, err
  1258. }
  1259. defer googleapi.CloseBody(res)
  1260. if err := googleapi.CheckResponse(res); err != nil {
  1261. return nil, err
  1262. }
  1263. ret := &CommitResponse{
  1264. ServerResponse: googleapi.ServerResponse{
  1265. Header: res.Header,
  1266. HTTPStatusCode: res.StatusCode,
  1267. },
  1268. }
  1269. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1270. return nil, err
  1271. }
  1272. return ret, nil
  1273. // {
  1274. // "description": "Commit a transaction, optionally creating, deleting or modifying some entities.",
  1275. // "httpMethod": "POST",
  1276. // "id": "datastore.datasets.commit",
  1277. // "parameterOrder": [
  1278. // "datasetId"
  1279. // ],
  1280. // "parameters": {
  1281. // "datasetId": {
  1282. // "description": "Identifies the dataset.",
  1283. // "location": "path",
  1284. // "required": true,
  1285. // "type": "string"
  1286. // }
  1287. // },
  1288. // "path": "{datasetId}/commit",
  1289. // "request": {
  1290. // "$ref": "CommitRequest"
  1291. // },
  1292. // "response": {
  1293. // "$ref": "CommitResponse"
  1294. // },
  1295. // "scopes": [
  1296. // "https://www.googleapis.com/auth/cloud-platform",
  1297. // "https://www.googleapis.com/auth/datastore",
  1298. // "https://www.googleapis.com/auth/userinfo.email"
  1299. // ]
  1300. // }
  1301. }
  1302. // method id "datastore.datasets.lookup":
  1303. type DatasetsLookupCall struct {
  1304. s *Service
  1305. datasetId string
  1306. lookuprequest *LookupRequest
  1307. urlParams_ gensupport.URLParams
  1308. ctx_ context.Context
  1309. }
  1310. // Lookup: Look up some entities by key.
  1311. func (r *DatasetsService) Lookup(datasetId string, lookuprequest *LookupRequest) *DatasetsLookupCall {
  1312. c := &DatasetsLookupCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1313. c.datasetId = datasetId
  1314. c.lookuprequest = lookuprequest
  1315. return c
  1316. }
  1317. // Fields allows partial responses to be retrieved. See
  1318. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1319. // for more information.
  1320. func (c *DatasetsLookupCall) Fields(s ...googleapi.Field) *DatasetsLookupCall {
  1321. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1322. return c
  1323. }
  1324. // Context sets the context to be used in this call's Do method. Any
  1325. // pending HTTP request will be aborted if the provided context is
  1326. // canceled.
  1327. func (c *DatasetsLookupCall) Context(ctx context.Context) *DatasetsLookupCall {
  1328. c.ctx_ = ctx
  1329. return c
  1330. }
  1331. func (c *DatasetsLookupCall) doRequest(alt string) (*http.Response, error) {
  1332. var body io.Reader = nil
  1333. body, err := googleapi.WithoutDataWrapper.JSONReader(c.lookuprequest)
  1334. if err != nil {
  1335. return nil, err
  1336. }
  1337. ctype := "application/json"
  1338. c.urlParams_.Set("alt", alt)
  1339. urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/lookup")
  1340. urls += "?" + c.urlParams_.Encode()
  1341. req, _ := http.NewRequest("POST", urls, body)
  1342. googleapi.Expand(req.URL, map[string]string{
  1343. "datasetId": c.datasetId,
  1344. })
  1345. req.Header.Set("Content-Type", ctype)
  1346. req.Header.Set("User-Agent", c.s.userAgent())
  1347. if c.ctx_ != nil {
  1348. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1349. }
  1350. return c.s.client.Do(req)
  1351. }
  1352. // Do executes the "datastore.datasets.lookup" call.
  1353. // Exactly one of *LookupResponse or error will be non-nil. Any non-2xx
  1354. // status code is an error. Response headers are in either
  1355. // *LookupResponse.ServerResponse.Header or (if a response was returned
  1356. // at all) in error.(*googleapi.Error).Header. Use
  1357. // googleapi.IsNotModified to check whether the returned error was
  1358. // because http.StatusNotModified was returned.
  1359. func (c *DatasetsLookupCall) Do(opts ...googleapi.CallOption) (*LookupResponse, error) {
  1360. gensupport.SetOptions(c.urlParams_, opts...)
  1361. res, err := c.doRequest("json")
  1362. if res != nil && res.StatusCode == http.StatusNotModified {
  1363. if res.Body != nil {
  1364. res.Body.Close()
  1365. }
  1366. return nil, &googleapi.Error{
  1367. Code: res.StatusCode,
  1368. Header: res.Header,
  1369. }
  1370. }
  1371. if err != nil {
  1372. return nil, err
  1373. }
  1374. defer googleapi.CloseBody(res)
  1375. if err := googleapi.CheckResponse(res); err != nil {
  1376. return nil, err
  1377. }
  1378. ret := &LookupResponse{
  1379. ServerResponse: googleapi.ServerResponse{
  1380. Header: res.Header,
  1381. HTTPStatusCode: res.StatusCode,
  1382. },
  1383. }
  1384. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1385. return nil, err
  1386. }
  1387. return ret, nil
  1388. // {
  1389. // "description": "Look up some entities by key.",
  1390. // "httpMethod": "POST",
  1391. // "id": "datastore.datasets.lookup",
  1392. // "parameterOrder": [
  1393. // "datasetId"
  1394. // ],
  1395. // "parameters": {
  1396. // "datasetId": {
  1397. // "description": "Identifies the dataset.",
  1398. // "location": "path",
  1399. // "required": true,
  1400. // "type": "string"
  1401. // }
  1402. // },
  1403. // "path": "{datasetId}/lookup",
  1404. // "request": {
  1405. // "$ref": "LookupRequest"
  1406. // },
  1407. // "response": {
  1408. // "$ref": "LookupResponse"
  1409. // },
  1410. // "scopes": [
  1411. // "https://www.googleapis.com/auth/cloud-platform",
  1412. // "https://www.googleapis.com/auth/datastore",
  1413. // "https://www.googleapis.com/auth/userinfo.email"
  1414. // ]
  1415. // }
  1416. }
  1417. // method id "datastore.datasets.rollback":
  1418. type DatasetsRollbackCall struct {
  1419. s *Service
  1420. datasetId string
  1421. rollbackrequest *RollbackRequest
  1422. urlParams_ gensupport.URLParams
  1423. ctx_ context.Context
  1424. }
  1425. // Rollback: Roll back a transaction.
  1426. func (r *DatasetsService) Rollback(datasetId string, rollbackrequest *RollbackRequest) *DatasetsRollbackCall {
  1427. c := &DatasetsRollbackCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1428. c.datasetId = datasetId
  1429. c.rollbackrequest = rollbackrequest
  1430. return c
  1431. }
  1432. // Fields allows partial responses to be retrieved. See
  1433. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1434. // for more information.
  1435. func (c *DatasetsRollbackCall) Fields(s ...googleapi.Field) *DatasetsRollbackCall {
  1436. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1437. return c
  1438. }
  1439. // Context sets the context to be used in this call's Do method. Any
  1440. // pending HTTP request will be aborted if the provided context is
  1441. // canceled.
  1442. func (c *DatasetsRollbackCall) Context(ctx context.Context) *DatasetsRollbackCall {
  1443. c.ctx_ = ctx
  1444. return c
  1445. }
  1446. func (c *DatasetsRollbackCall) doRequest(alt string) (*http.Response, error) {
  1447. var body io.Reader = nil
  1448. body, err := googleapi.WithoutDataWrapper.JSONReader(c.rollbackrequest)
  1449. if err != nil {
  1450. return nil, err
  1451. }
  1452. ctype := "application/json"
  1453. c.urlParams_.Set("alt", alt)
  1454. urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/rollback")
  1455. urls += "?" + c.urlParams_.Encode()
  1456. req, _ := http.NewRequest("POST", urls, body)
  1457. googleapi.Expand(req.URL, map[string]string{
  1458. "datasetId": c.datasetId,
  1459. })
  1460. req.Header.Set("Content-Type", ctype)
  1461. req.Header.Set("User-Agent", c.s.userAgent())
  1462. if c.ctx_ != nil {
  1463. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1464. }
  1465. return c.s.client.Do(req)
  1466. }
  1467. // Do executes the "datastore.datasets.rollback" call.
  1468. // Exactly one of *RollbackResponse or error will be non-nil. Any
  1469. // non-2xx status code is an error. Response headers are in either
  1470. // *RollbackResponse.ServerResponse.Header or (if a response was
  1471. // returned at all) in error.(*googleapi.Error).Header. Use
  1472. // googleapi.IsNotModified to check whether the returned error was
  1473. // because http.StatusNotModified was returned.
  1474. func (c *DatasetsRollbackCall) Do(opts ...googleapi.CallOption) (*RollbackResponse, error) {
  1475. gensupport.SetOptions(c.urlParams_, opts...)
  1476. res, err := c.doRequest("json")
  1477. if res != nil && res.StatusCode == http.StatusNotModified {
  1478. if res.Body != nil {
  1479. res.Body.Close()
  1480. }
  1481. return nil, &googleapi.Error{
  1482. Code: res.StatusCode,
  1483. Header: res.Header,
  1484. }
  1485. }
  1486. if err != nil {
  1487. return nil, err
  1488. }
  1489. defer googleapi.CloseBody(res)
  1490. if err := googleapi.CheckResponse(res); err != nil {
  1491. return nil, err
  1492. }
  1493. ret := &RollbackResponse{
  1494. ServerResponse: googleapi.ServerResponse{
  1495. Header: res.Header,
  1496. HTTPStatusCode: res.StatusCode,
  1497. },
  1498. }
  1499. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1500. return nil, err
  1501. }
  1502. return ret, nil
  1503. // {
  1504. // "description": "Roll back a transaction.",
  1505. // "httpMethod": "POST",
  1506. // "id": "datastore.datasets.rollback",
  1507. // "parameterOrder": [
  1508. // "datasetId"
  1509. // ],
  1510. // "parameters": {
  1511. // "datasetId": {
  1512. // "description": "Identifies the dataset.",
  1513. // "location": "path",
  1514. // "required": true,
  1515. // "type": "string"
  1516. // }
  1517. // },
  1518. // "path": "{datasetId}/rollback",
  1519. // "request": {
  1520. // "$ref": "RollbackRequest"
  1521. // },
  1522. // "response": {
  1523. // "$ref": "RollbackResponse"
  1524. // },
  1525. // "scopes": [
  1526. // "https://www.googleapis.com/auth/cloud-platform",
  1527. // "https://www.googleapis.com/auth/datastore",
  1528. // "https://www.googleapis.com/auth/userinfo.email"
  1529. // ]
  1530. // }
  1531. }
  1532. // method id "datastore.datasets.runQuery":
  1533. type DatasetsRunQueryCall struct {
  1534. s *Service
  1535. datasetId string
  1536. runqueryrequest *RunQueryRequest
  1537. urlParams_ gensupport.URLParams
  1538. ctx_ context.Context
  1539. }
  1540. // RunQuery: Query for entities.
  1541. func (r *DatasetsService) RunQuery(datasetId string, runqueryrequest *RunQueryRequest) *DatasetsRunQueryCall {
  1542. c := &DatasetsRunQueryCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  1543. c.datasetId = datasetId
  1544. c.runqueryrequest = runqueryrequest
  1545. return c
  1546. }
  1547. // Fields allows partial responses to be retrieved. See
  1548. // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse
  1549. // for more information.
  1550. func (c *DatasetsRunQueryCall) Fields(s ...googleapi.Field) *DatasetsRunQueryCall {
  1551. c.urlParams_.Set("fields", googleapi.CombineFields(s))
  1552. return c
  1553. }
  1554. // Context sets the context to be used in this call's Do method. Any
  1555. // pending HTTP request will be aborted if the provided context is
  1556. // canceled.
  1557. func (c *DatasetsRunQueryCall) Context(ctx context.Context) *DatasetsRunQueryCall {
  1558. c.ctx_ = ctx
  1559. return c
  1560. }
  1561. func (c *DatasetsRunQueryCall) doRequest(alt string) (*http.Response, error) {
  1562. var body io.Reader = nil
  1563. body, err := googleapi.WithoutDataWrapper.JSONReader(c.runqueryrequest)
  1564. if err != nil {
  1565. return nil, err
  1566. }
  1567. ctype := "application/json"
  1568. c.urlParams_.Set("alt", alt)
  1569. urls := googleapi.ResolveRelative(c.s.BasePath, "{datasetId}/runQuery")
  1570. urls += "?" + c.urlParams_.Encode()
  1571. req, _ := http.NewRequest("POST", urls, body)
  1572. googleapi.Expand(req.URL, map[string]string{
  1573. "datasetId": c.datasetId,
  1574. })
  1575. req.Header.Set("Content-Type", ctype)
  1576. req.Header.Set("User-Agent", c.s.userAgent())
  1577. if c.ctx_ != nil {
  1578. return ctxhttp.Do(c.ctx_, c.s.client, req)
  1579. }
  1580. return c.s.client.Do(req)
  1581. }
  1582. // Do executes the "datastore.datasets.runQuery" call.
  1583. // Exactly one of *RunQueryResponse or error will be non-nil. Any
  1584. // non-2xx status code is an error. Response headers are in either
  1585. // *RunQueryResponse.ServerResponse.Header or (if a response was
  1586. // returned at all) in error.(*googleapi.Error).Header. Use
  1587. // googleapi.IsNotModified to check whether the returned error was
  1588. // because http.StatusNotModified was returned.
  1589. func (c *DatasetsRunQueryCall) Do(opts ...googleapi.CallOption) (*RunQueryResponse, error) {
  1590. gensupport.SetOptions(c.urlParams_, opts...)
  1591. res, err := c.doRequest("json")
  1592. if res != nil && res.StatusCode == http.StatusNotModified {
  1593. if res.Body != nil {
  1594. res.Body.Close()
  1595. }
  1596. return nil, &googleapi.Error{
  1597. Code: res.StatusCode,
  1598. Header: res.Header,
  1599. }
  1600. }
  1601. if err != nil {
  1602. return nil, err
  1603. }
  1604. defer googleapi.CloseBody(res)
  1605. if err := googleapi.CheckResponse(res); err != nil {
  1606. return nil, err
  1607. }
  1608. ret := &RunQueryResponse{
  1609. ServerResponse: googleapi.ServerResponse{
  1610. Header: res.Header,
  1611. HTTPStatusCode: res.StatusCode,
  1612. },
  1613. }
  1614. if err := json.NewDecoder(res.Body).Decode(&ret); err != nil {
  1615. return nil, err
  1616. }
  1617. return ret, nil
  1618. // {
  1619. // "description": "Query for entities.",
  1620. // "httpMethod": "POST",
  1621. // "id": "datastore.datasets.runQuery",
  1622. // "parameterOrder": [
  1623. // "datasetId"
  1624. // ],
  1625. // "parameters": {
  1626. // "datasetId": {
  1627. // "description": "Identifies the dataset.",
  1628. // "location": "path",
  1629. // "required": true,
  1630. // "type": "string"
  1631. // }
  1632. // },
  1633. // "path": "{datasetId}/runQuery",
  1634. // "request": {
  1635. // "$ref": "RunQueryRequest"
  1636. // },
  1637. // "response": {
  1638. // "$ref": "RunQueryResponse"
  1639. // },
  1640. // "scopes": [
  1641. // "https://www.googleapis.com/auth/cloud-platform",
  1642. // "https://www.googleapis.com/auth/datastore",
  1643. // "https://www.googleapis.com/auth/userinfo.email"
  1644. // ]
  1645. // }
  1646. }