datastore-gen.go 68 KB

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