@@ -20,6 +20,80 @@ module Network.Google.Datastore.Types.Product where
2020import Network.Google.Datastore.Types.Sum
2121import Network.Google.Prelude
2222
23+-- | An object representing a latitude\/longitude pair. This is expressed as
24+-- a pair of doubles representing degrees latitude and degrees longitude.
25+-- Unless specified otherwise, this must conform to the
26+-- <http://www.unoosa.org/pdf/icg/2012/template/WGS_84.pdf WGS84 standard>.
27+-- Values must be within normalized ranges. Example of normalization code
28+-- in Python: def NormalizeLongitude(longitude): \"\"\"Wraps decimal
29+-- degrees longitude to [-180.0, 180.0].\"\"\" q, r = divmod(longitude,
30+-- 360.0) if r > 180.0 or (r == 180.0 and q \<= -1.0): return r - 360.0
31+-- return r def NormalizeLatLng(latitude, longitude): \"\"\"Wraps decimal
32+-- degrees latitude and longitude to [-180.0, 180.0] and [-90.0, 90.0],
33+-- respectively.\"\"\" r = latitude % 360.0 if r \<= 90.0: return r,
34+-- NormalizeLongitude(longitude) elif r >= 270.0: return r - 360,
35+-- NormalizeLongitude(longitude) else: return 180 - r,
36+-- NormalizeLongitude(longitude + 180.0) assert 180.0 ==
37+-- NormalizeLongitude(180.0) assert -180.0 == NormalizeLongitude(-180.0)
38+-- assert -179.0 == NormalizeLongitude(181.0) assert (0.0, 0.0) ==
39+-- NormalizeLatLng(360.0, 0.0) assert (0.0, 0.0) == NormalizeLatLng(-360.0,
40+-- 0.0) assert (85.0, 180.0) == NormalizeLatLng(95.0, 0.0) assert (-85.0,
41+-- -170.0) == NormalizeLatLng(-95.0, 10.0) assert (90.0, 10.0) ==
42+-- NormalizeLatLng(90.0, 10.0) assert (-90.0, -10.0) ==
43+-- NormalizeLatLng(-90.0, -10.0) assert (0.0, -170.0) ==
44+-- NormalizeLatLng(-180.0, 10.0) assert (0.0, -170.0) ==
45+-- NormalizeLatLng(180.0, 10.0) assert (-90.0, 10.0) ==
46+-- NormalizeLatLng(270.0, 10.0) assert (90.0, 10.0) ==
47+-- NormalizeLatLng(-270.0, 10.0)
48+--
49+-- /See:/ 'latLng' smart constructor.
50+data LatLng = LatLng'
51+ { _llLatitude :: !(Maybe (Textual Double))
52+ , _llLongitude :: !(Maybe (Textual Double))
53+ } deriving (Eq,Show,Data,Typeable,Generic)
54+
55+-- | Creates a value of 'LatLng' with the minimum fields required to make a request.
56+--
57+-- Use one of the following lenses to modify other fields as desired:
58+--
59+-- * 'llLatitude'
60+--
61+-- * 'llLongitude'
62+latLng
63+ :: LatLng
64+latLng =
65+ LatLng'
66+ { _llLatitude = Nothing
67+ , _llLongitude = Nothing
68+ }
69+
70+-- | The latitude in degrees. It must be in the range [-90.0, +90.0].
71+llLatitude :: Lens' LatLng (Maybe Double)
72+llLatitude
73+ = lens _llLatitude (\ s a -> s{_llLatitude = a}) .
74+ mapping _Coerce
75+
76+-- | The longitude in degrees. It must be in the range [-180.0, +180.0].
77+llLongitude :: Lens' LatLng (Maybe Double)
78+llLongitude
79+ = lens _llLongitude (\ s a -> s{_llLongitude = a}) .
80+ mapping _Coerce
81+
82+instance FromJSON LatLng where
83+ parseJSON
84+ = withObject "LatLng"
85+ (\ o ->
86+ LatLng' <$>
87+ (o .:? "latitude") <*> (o .:? "longitude"))
88+
89+instance ToJSON LatLng where
90+ toJSON LatLng'{..}
91+ = object
92+ (catMaybes
93+ [("latitude" .=) <$> _llLatitude,
94+ ("longitude" .=) <$> _llLongitude])
95+
96+-- | The request for google.datastore.v1beta3.Datastore.Rollback.
2397--
2498-- /See:/ 'rollbackRequest' smart constructor.
2599newtype RollbackRequest = RollbackRequest'
@@ -38,7 +112,8 @@ rollbackRequest =
38112 { _rrTransaction = Nothing
39113 }
40114
41−-- | The transaction identifier, returned by a call to beginTransaction.
115+-- | The transaction identifier, returned by a call to
116+-- google.datastore.v1beta3.Datastore.BeginTransaction.
42117rrTransaction :: Lens' RollbackRequest (Maybe Word8)
43118rrTransaction
44119 = lens _rrTransaction
@@ -55,237 +130,70 @@ instance ToJSON RollbackRequest where
55130 = object
56131 (catMaybes [("transaction" .=) <$> _rrTransaction])
57132
58−-- | An entity property.
59−--
60−-- /See:/ 'property' smart constructor.
61−data Property = Property'
62− { _pKeyValue :: !(Maybe Key)
63− , _pBlobKeyValue :: !(Maybe Text)
64− , _pDateTimeValue :: !(Maybe DateTime')
65− , _pIntegerValue :: !(Maybe (Textual Int64))
66− , _pEntityValue :: !(Maybe Entity)
67− , _pDoubleValue :: !(Maybe (Textual Double))
68− , _pStringValue :: !(Maybe Text)
69− , _pListValue :: !(Maybe [Value])
70− , _pIndexed :: !(Maybe Bool)
71− , _pBooleanValue :: !(Maybe Bool)
72− , _pMeaning :: !(Maybe (Textual Int32))
73− , _pBlobValue :: !(Maybe (Textual Word8))
74− } deriving (Eq,Show,Data,Typeable,Generic)
75−
76−-- | Creates a value of 'Property' with the minimum fields required to make a request.
77−--
78−-- Use one of the following lenses to modify other fields as desired:
79−--
80−-- * 'pKeyValue'
81−--
82−-- * 'pBlobKeyValue'
83−--
84−-- * 'pDateTimeValue'
85−--
86−-- * 'pIntegerValue'
87−--
88−-- * 'pEntityValue'
89−--
90−-- * 'pDoubleValue'
91−--
92−-- * 'pStringValue'
93−--
94−-- * 'pListValue'
95−--
96−-- * 'pIndexed'
97−--
98−-- * 'pBooleanValue'
99−--
100−-- * 'pMeaning'
101−--
102−-- * 'pBlobValue'
103−property
104− :: Property
105−property =
106− Property'
107− { _pKeyValue = Nothing
108− , _pBlobKeyValue = Nothing
109− , _pDateTimeValue = Nothing
110− , _pIntegerValue = Nothing
111− , _pEntityValue = Nothing
112− , _pDoubleValue = Nothing
113− , _pStringValue = Nothing
114− , _pListValue = Nothing
115− , _pIndexed = Nothing
116− , _pBooleanValue = Nothing
117− , _pMeaning = Nothing
118− , _pBlobValue = Nothing
119− }
120−
121−-- | A key value.
122−pKeyValue :: Lens' Property (Maybe Key)
123−pKeyValue
124− = lens _pKeyValue (\ s a -> s{_pKeyValue = a})
125−
126−-- | A blob key value.
127−pBlobKeyValue :: Lens' Property (Maybe Text)
128−pBlobKeyValue
129− = lens _pBlobKeyValue
130− (\ s a -> s{_pBlobKeyValue = a})
131−
132−-- | A timestamp value.
133−pDateTimeValue :: Lens' Property (Maybe UTCTime)
134−pDateTimeValue
135− = lens _pDateTimeValue
136− (\ s a -> s{_pDateTimeValue = a})
137− . mapping _DateTime
138−
139−-- | An integer value.
140−pIntegerValue :: Lens' Property (Maybe Int64)
141−pIntegerValue
142− = lens _pIntegerValue
143− (\ s a -> s{_pIntegerValue = a})
144− . mapping _Coerce
145−
146−-- | An entity value. May have no key. May have a key with an incomplete key
147−-- path. May have a reserved\/read-only key.
148−pEntityValue :: Lens' Property (Maybe Entity)
149−pEntityValue
150− = lens _pEntityValue (\ s a -> s{_pEntityValue = a})
151−
152−-- | A double value.
153−pDoubleValue :: Lens' Property (Maybe Double)
154−pDoubleValue
155− = lens _pDoubleValue (\ s a -> s{_pDoubleValue = a})
156− . mapping _Coerce
157−
158−-- | A UTF-8 encoded string value. When indexed is true, may have at most 500
159−-- characters.
160−pStringValue :: Lens' Property (Maybe Text)
161−pStringValue
162− = lens _pStringValue (\ s a -> s{_pStringValue = a})
163−
164−-- | A list value. Cannot contain another list value. A Value instance that
165−-- sets field list_value must not set field meaning or field indexed.
166−pListValue :: Lens' Property [Value]
167−pListValue
168− = lens _pListValue (\ s a -> s{_pListValue = a}) .
169− _Default
170− . _Coerce
171−
172−-- | If the value should be indexed. The indexed property may be set for a
173−-- null value. When indexed is true, stringValue is limited to 500
174−-- characters and the blob value is limited to 500 bytes. Input values by
175−-- default have indexed set to true; however, you can explicitly set
176−-- indexed to true if you want. (An output value never has indexed
177−-- explicitly set to true.) If a value is itself an entity, it cannot have
178−-- indexed set to true.
179−pIndexed :: Lens' Property (Maybe Bool)
180−pIndexed = lens _pIndexed (\ s a -> s{_pIndexed = a})
181−
182−-- | A boolean value.
183−pBooleanValue :: Lens' Property (Maybe Bool)
184−pBooleanValue
185− = lens _pBooleanValue
186− (\ s a -> s{_pBooleanValue = a})
187−
188−-- | The meaning field is reserved and should not be used.
189−pMeaning :: Lens' Property (Maybe Int32)
190−pMeaning
191− = lens _pMeaning (\ s a -> s{_pMeaning = a}) .
192− mapping _Coerce
193−
194−-- | A blob value. May be a maximum of 1,000,000 bytes. When indexed is true,
195−-- may have at most 500 bytes.
196−pBlobValue :: Lens' Property (Maybe Word8)
197−pBlobValue
198− = lens _pBlobValue (\ s a -> s{_pBlobValue = a}) .
199− mapping _Coerce
200−
201−instance FromJSON Property where
202− parseJSON
203− = withObject "Property"
204− (\ o ->
205− Property' <$>
206− (o .:? "keyValue") <*> (o .:? "blobKeyValue") <*>
207− (o .:? "dateTimeValue")
208− <*> (o .:? "integerValue")
209− <*> (o .:? "entityValue")
210− <*> (o .:? "doubleValue")
211− <*> (o .:? "stringValue")
212− <*> (o .:? "listValue" .!= mempty)
213− <*> (o .:? "indexed")
214− <*> (o .:? "booleanValue")
215− <*> (o .:? "meaning")
216− <*> (o .:? "blobValue"))
217−
218−instance ToJSON Property where
219− toJSON Property'{..}
220− = object
221− (catMaybes
222− [("keyValue" .=) <$> _pKeyValue,
223− ("blobKeyValue" .=) <$> _pBlobKeyValue,
224− ("dateTimeValue" .=) <$> _pDateTimeValue,
225− ("integerValue" .=) <$> _pIntegerValue,
226− ("entityValue" .=) <$> _pEntityValue,
227− ("doubleValue" .=) <$> _pDoubleValue,
228− ("stringValue" .=) <$> _pStringValue,
229− ("listValue" .=) <$> _pListValue,
230− ("indexed" .=) <$> _pIndexed,
231− ("booleanValue" .=) <$> _pBooleanValue,
232− ("meaning" .=) <$> _pMeaning,
233− ("blobValue" .=) <$> _pBlobValue])
234−
235−-- | An identifier for a particular subset of entities. Entities are
236−-- partitioned into various subsets, each used by different datasets and
237−-- different namespaces within a dataset and so forth.
133+-- | A partition ID identifies a grouping of entities. The grouping is always
134+-- by project and namespace, however the namespace ID may be empty. A
135+-- partition ID contains several dimensions: project ID and namespace ID.
136+-- Partition dimensions: - May be \`\"\"\`. - Must be valid UTF-8 bytes. -
137+-- Must have values that match regex \`[A-Za-z\\d\\.\\-_]{1,100}\` If the
138+-- value of any dimension matches regex \`__.*__\`, the partition is
139+-- reserved\/read-only. A reserved\/read-only partition ID is forbidden in
140+-- certain documented contexts. Foreign partition IDs (in which the project
141+-- ID does not match the context project ID ) are discouraged. Reads and
142+-- writes of foreign partition IDs may fail if the project is not in an
143+-- active state.
238144--
239145-- /See:/ 'partitionId' smart constructor.
240146data PartitionId = PartitionId'
241− { _piNamespace :: !(Maybe Text)
242− , _piDataSetId :: !(Maybe Text)
147+ { _piNamespaceId :: !(Maybe Text)
148+ , _piProjectId :: !(Maybe Text)
243149 } deriving (Eq,Show,Data,Typeable,Generic)
244150
245151-- | Creates a value of 'PartitionId' with the minimum fields required to make a request.
246152--
247153-- Use one of the following lenses to modify other fields as desired:
248154--
249−-- * 'piNamespace'
155+-- * 'piNamespaceId'
250156--
251−-- * 'piDataSetId'
157+-- * 'piProjectId'
252158partitionId
253159 :: PartitionId
254160partitionId =
255161 PartitionId'
256− { _piNamespace = Nothing
257− , _piDataSetId = Nothing
162+ { _piNamespaceId = Nothing
163+ , _piProjectId = Nothing
258164 }
259165
260−-- | The namespace.
261−piNamespace :: Lens' PartitionId (Maybe Text)
262−piNamespace
263− = lens _piNamespace (\ s a -> s{_piNamespace = a})
166+-- | If not empty, the ID of the namespace to which the entities belong.
167+piNamespaceId :: Lens' PartitionId (Maybe Text)
168+piNamespaceId
169+ = lens _piNamespaceId
170+ (\ s a -> s{_piNamespaceId = a})
264171
265−-- | The dataset ID.
266−piDataSetId :: Lens' PartitionId (Maybe Text)
267−piDataSetId
268− = lens _piDataSetId (\ s a -> s{_piDataSetId = a})
172+-- | The ID of the project to which the entities belong.
173+piProjectId :: Lens' PartitionId (Maybe Text)
174+piProjectId
175+ = lens _piProjectId (\ s a -> s{_piProjectId = a})
269176
270177instance FromJSON PartitionId where
271178 parseJSON
272179 = withObject "PartitionId"
273180 (\ o ->
274181 PartitionId' <$>
275− (o .:? "namespace") <*> (o .:? "datasetId"))
182+ (o .:? "namespaceId") <*> (o .:? "projectId"))
276183
277184instance ToJSON PartitionId where
278185 toJSON PartitionId'{..}
279186 = object
280187 (catMaybes
281− [("namespace" .=) <$> _piNamespace,
282− ("datasetId" .=) <$> _piDataSetId])
188+ [("namespaceId" .=) <$> _piNamespaceId,
189+ ("projectId" .=) <$> _piProjectId])
283190
284191-- | A batch of results produced by a query.
285192--
286193-- /See:/ 'queryResultBatch' smart constructor.
287194data QueryResultBatch = QueryResultBatch'
288195 { _qrbSkippedResults :: !(Maybe (Textual Int32))
196+ , _qrbSkippedCursor :: !(Maybe (Textual Word8))
289197 , _qrbEntityResultType :: !(Maybe QueryResultBatchEntityResultType)
290198 , _qrbEntityResults :: !(Maybe [EntityResult])
291199 , _qrbMoreResults :: !(Maybe QueryResultBatchMoreResults)
@@ -298,6 +206,8 @@ data QueryResultBatch = QueryResultBatch'
298206--
299207-- * 'qrbSkippedResults'
300208--
209+-- * 'qrbSkippedCursor'
210+--
301211-- * 'qrbEntityResultType'
302212--
303213-- * 'qrbEntityResults'
@@ -310,22 +220,29 @@ queryResultBatch
310220queryResultBatch =
311221 QueryResultBatch'
312222 { _qrbSkippedResults = Nothing
223+ , _qrbSkippedCursor = Nothing
313224 , _qrbEntityResultType = Nothing
314225 , _qrbEntityResults = Nothing
315226 , _qrbMoreResults = Nothing
316227 , _qrbEndCursor = Nothing
317228 }
318229
319−-- | The number of results skipped because of Query.offset.
230+-- | The number of results skipped, typically because of an offset.
320231qrbSkippedResults :: Lens' QueryResultBatch (Maybe Int32)
321232qrbSkippedResults
322233 = lens _qrbSkippedResults
323234 (\ s a -> s{_qrbSkippedResults = a})
324235 . mapping _Coerce
325236
326−-- | The result type for every entity in entityResults. full for full
327−-- entities, projection for entities with only projected properties,
328−-- keyOnly for entities with only a key.
237+-- | A cursor that points to the position after the last skipped result. Will
238+-- be set when \`skipped_results\` != 0.
239+qrbSkippedCursor :: Lens' QueryResultBatch (Maybe Word8)
240+qrbSkippedCursor
241+ = lens _qrbSkippedCursor
242+ (\ s a -> s{_qrbSkippedCursor = a})
243+ . mapping _Coerce
244+
245+-- | The result type for every entity in \`entity_results\`.
329246qrbEntityResultType :: Lens' QueryResultBatch (Maybe QueryResultBatchEntityResultType)
330247qrbEntityResultType
331248 = lens _qrbEntityResultType
@@ -339,16 +256,13 @@ qrbEntityResults
339256 . _Default
340257 . _Coerce
341258
342−-- | The state of the query after the current batch. One of notFinished,
343−-- moreResultsAfterLimit, noMoreResults.
259+-- | The state of the query after the current batch.
344260qrbMoreResults :: Lens' QueryResultBatch (Maybe QueryResultBatchMoreResults)
345261qrbMoreResults
346262 = lens _qrbMoreResults
347263 (\ s a -> s{_qrbMoreResults = a})
348264
349265-- | A cursor that points to the position after the last result in the batch.
350−-- May be absent. TODO(arfuller): Once all plans produce cursors update
351−-- documentation here.
352266qrbEndCursor :: Lens' QueryResultBatch (Maybe Word8)
353267qrbEndCursor
354268 = lens _qrbEndCursor (\ s a -> s{_qrbEndCursor = a})
@@ -359,8 +273,8 @@ instance FromJSON QueryResultBatch where
359273 = withObject "QueryResultBatch"
360274 (\ o ->
361275 QueryResultBatch' <$>
362− (o .:? "skippedResults") <*>
363− (o .:? "entityResultType")
276+ (o .:? "skippedResults") <*> (o .:? "skippedCursor")
277+ <*> (o .:? "entityResultType")
364278 <*> (o .:? "entityResults" .!= mempty)
365279 <*> (o .:? "moreResults")
366280 <*> (o .:? "endCursor"))
@@ -370,16 +284,20 @@ instance ToJSON QueryResultBatch where
370284 = object
371285 (catMaybes
372286 [("skippedResults" .=) <$> _qrbSkippedResults,
287+ ("skippedCursor" .=) <$> _qrbSkippedCursor,
373288 ("entityResultType" .=) <$> _qrbEntityResultType,
374289 ("entityResults" .=) <$> _qrbEntityResults,
375290 ("moreResults" .=) <$> _qrbMoreResults,
376291 ("endCursor" .=) <$> _qrbEndCursor])
377292
378−-- | The entity\'s properties.
293+-- | The entity\'s properties. The map\'s keys are property names. A property
294+-- name matching regex \`__.*__\` is reserved. A reserved property name is
295+-- forbidden in certain documented contexts. The name must not contain more
296+-- than 500 characters. The name cannot be \`\"\"\`.
379297--
380298-- /See:/ 'entityProperties' smart constructor.
381299newtype EntityProperties = EntityProperties'
382− { _epAddtional :: HashMap Text Property
300+ { _epAddtional :: HashMap Text Value
383301 } deriving (Eq,Show,Data,Typeable,Generic)
384302
385303-- | Creates a value of 'EntityProperties' with the minimum fields required to make a request.
@@ -388,18 +306,14 @@ newtype EntityProperties = EntityProperties'
388306--
389307-- * 'epAddtional'
390308entityProperties
391− :: HashMap Text Property -- ^ 'epAddtional'
309+ :: HashMap Text Value -- ^ 'epAddtional'
392310 -> EntityProperties
393311entityProperties pEpAddtional_ =
394312 EntityProperties'
395313 { _epAddtional = _Coerce # pEpAddtional_
396314 }
397315
398−-- | The name of the property. A property name matching regex \"__.*__\" is
399−-- reserved. A reserved property name is forbidden in certain documented
400−-- contexts. The name must not contain more than 500 characters. Cannot be
401−-- \"\".
402−epAddtional :: Lens' EntityProperties (HashMap Text Property)
316+epAddtional :: Lens' EntityProperties (HashMap Text Value)
403317epAddtional
404318 = lens _epAddtional (\ s a -> s{_epAddtional = a}) .
405319 _Coerce
@@ -412,48 +326,28 @@ instance FromJSON EntityProperties where
412326instance ToJSON EntityProperties where
413327 toJSON = toJSON . _epAddtional
414328
329+-- | The request for google.datastore.v1beta3.Datastore.BeginTransaction.
415330--
416331-- /See:/ 'beginTransactionRequest' smart constructor.
417−newtype BeginTransactionRequest = BeginTransactionRequest'
418− { _btrIsolationLevel :: Maybe BeginTransactionRequestIsolationLevel
419− } deriving (Eq,Show,Data,Typeable,Generic)
332+data BeginTransactionRequest =
333+ BeginTransactionRequest'
334+ deriving (Eq,Show,Data,Typeable,Generic)
420335
421336-- | Creates a value of 'BeginTransactionRequest' with the minimum fields required to make a request.
422337--
423−-- Use one of the following lenses to modify other fields as desired:
424−--
425−-- * 'btrIsolationLevel'
426338beginTransactionRequest
427339 :: BeginTransactionRequest
428−beginTransactionRequest =
429− BeginTransactionRequest'
430− { _btrIsolationLevel = Nothing
431− }
432−
433−-- | The transaction isolation level. Either snapshot or serializable. The
434−-- default isolation level is snapshot isolation, which means that another
435−-- transaction may not concurrently modify the data that is modified by
436−-- this transaction. Optionally, a transaction can request to be made
437−-- serializable which means that another transaction cannot concurrently
438−-- modify the data that is read or modified by this transaction.
439−btrIsolationLevel :: Lens' BeginTransactionRequest (Maybe BeginTransactionRequestIsolationLevel)
440−btrIsolationLevel
441− = lens _btrIsolationLevel
442− (\ s a -> s{_btrIsolationLevel = a})
340+beginTransactionRequest = BeginTransactionRequest'
443341
444342instance FromJSON BeginTransactionRequest where
445343 parseJSON
446344 = withObject "BeginTransactionRequest"
447− (\ o ->
448− BeginTransactionRequest' <$>
449− (o .:? "isolationLevel"))
345+ (\ o -> pure BeginTransactionRequest')
450346
451347instance ToJSON BeginTransactionRequest where
452− toJSON BeginTransactionRequest'{..}
453− = object
454− (catMaybes
455− [("isolationLevel" .=) <$> _btrIsolationLevel])
348+ toJSON = const emptyObject
456349
350+-- | The request for google.datastore.v1beta3.Datastore.RunQuery.
457351--
458352-- /See:/ 'runQueryRequest' smart constructor.
459353data RunQueryRequest = RunQueryRequest'
@@ -484,25 +378,20 @@ runQueryRequest =
484378 , _rqrReadOptions = Nothing
485379 }
486380
487−-- | Entities are partitioned into subsets, identified by a dataset (usually
488−-- implicitly specified by the project) and namespace ID. Queries are
489−-- scoped to a single partition. This partition ID is normalized with the
490−-- standard default context partition ID, but all other partition IDs in
491−-- RunQueryRequest are normalized with this partition ID as the context
492−-- partition ID.
381+-- | Entities are partitioned into subsets, identified by a partition ID.
382+-- Queries are scoped to a single partition. This partition ID is
383+-- normalized with the standard default context partition ID.
493384rqrPartitionId :: Lens' RunQueryRequest (Maybe PartitionId)
494385rqrPartitionId
495386 = lens _rqrPartitionId
496387 (\ s a -> s{_rqrPartitionId = a})
497388
498−-- | The GQL query to run. Either this field or field query must be set, but
499−-- not both.
389+-- | The GQL query to run.
500390rqrGqlQuery :: Lens' RunQueryRequest (Maybe GqlQuery)
501391rqrGqlQuery
502392 = lens _rqrGqlQuery (\ s a -> s{_rqrGqlQuery = a})
503393
504−-- | The query to run. Either this field or field gql_query must be set, but
505−-- not both.
394+-- | The query to run.
506395rqrQuery :: Lens' RunQueryRequest (Maybe Query)
507396rqrQuery = lens _rqrQuery (\ s a -> s{_rqrQuery = a})
508397
@@ -530,6 +419,7 @@ instance ToJSON RunQueryRequest where
530419 ("query" .=) <$> _rqrQuery,
531420 ("readOptions" .=) <$> _rqrReadOptions])
532421
422+-- | The request for google.datastore.v1beta3.Datastore.AllocateIds.
533423--
534424-- /See:/ 'allocateIdsRequest' smart constructor.
535425newtype AllocateIdsRequest = AllocateIdsRequest'
@@ -548,8 +438,8 @@ allocateIdsRequest =
548438 { _airKeys = Nothing
549439 }
550440
551−-- | A list of keys with incomplete key paths to allocate IDs for. No key may
552−-- be reserved\/read-only.
441+-- | A list of keys with incomplete key paths for which to allocate IDs. No
442+-- key may be reserved\/read-only.
553443airKeys :: Lens' AllocateIdsRequest [Key]
554444airKeys
555445 = lens _airKeys (\ s a -> s{_airKeys = a}) . _Default
@@ -565,35 +455,32 @@ instance ToJSON AllocateIdsRequest where
565455 toJSON AllocateIdsRequest'{..}
566456 = object (catMaybes [("keys" .=) <$> _airKeys])
567457
568−-- | A filter that merges the multiple other filters using the given
569−-- operation.
458+-- | A filter that merges multiple other filters using the given operator.
570459--
571460-- /See:/ 'compositeFilter' smart constructor.
572461data CompositeFilter = CompositeFilter'
573− { _cfOperator :: !(Maybe CompositeFilterOperator)
574− , _cfFilters :: !(Maybe [Filter])
462+ { _cfOp :: !(Maybe CompositeFilterOp)
463+ , _cfFilters :: !(Maybe [Filter])
575464 } deriving (Eq,Show,Data,Typeable,Generic)
576465
577466-- | Creates a value of 'CompositeFilter' with the minimum fields required to make a request.
578467--
579468-- Use one of the following lenses to modify other fields as desired:
580469--
581−-- * 'cfOperator'
470+-- * 'cfOp'
582471--
583472-- * 'cfFilters'
584473compositeFilter
585474 :: CompositeFilter
586475compositeFilter =
587476 CompositeFilter'
588− { _cfOperator = Nothing
477+ { _cfOp = Nothing
589478 , _cfFilters = Nothing
590479 }
591480
592−-- | The operator for combining multiple filters. Only \"and\" is currently
593−-- supported.
594−cfOperator :: Lens' CompositeFilter (Maybe CompositeFilterOperator)
595−cfOperator
596− = lens _cfOperator (\ s a -> s{_cfOperator = a})
481+-- | The operator for combining multiple filters.
482+cfOp :: Lens' CompositeFilter (Maybe CompositeFilterOp)
483+cfOp = lens _cfOp (\ s a -> s{_cfOp = a})
597484
598485-- | The list of filters to combine. Must contain at least one filter.
599486cfFilters :: Lens' CompositeFilter [Filter]
@@ -607,20 +494,19 @@ instance FromJSON CompositeFilter where
607494 = withObject "CompositeFilter"
608495 (\ o ->
609496 CompositeFilter' <$>
610− (o .:? "operator") <*> (o .:? "filters" .!= mempty))
497+ (o .:? "op") <*> (o .:? "filters" .!= mempty))
611498
612499instance ToJSON CompositeFilter where
613500 toJSON CompositeFilter'{..}
614501 = object
615502 (catMaybes
616− [("operator" .=) <$> _cfOperator,
617− ("filters" .=) <$> _cfFilters])
503+ [("op" .=) <$> _cfOp, ("filters" .=) <$> _cfFilters])
618504
505+-- | The response for google.datastore.v1beta3.Datastore.BeginTransaction.
619506--
620507-- /See:/ 'beginTransactionResponse' smart constructor.
621−data BeginTransactionResponse = BeginTransactionResponse'
622− { _btrTransaction :: !(Maybe (Textual Word8))
623− , _btrHeader :: !(Maybe ResponseHeader)
508+newtype BeginTransactionResponse = BeginTransactionResponse'
509+ { _btrTransaction :: Maybe (Textual Word8)
624510 } deriving (Eq,Show,Data,Typeable,Generic)
625511
626512-- | Creates a value of 'BeginTransactionResponse' with the minimum fields required to make a request.
@@ -628,14 +514,11 @@ data BeginTransactionResponse = BeginTransactionResponse'
628514-- Use one of the following lenses to modify other fields as desired:
629515--
630516-- * 'btrTransaction'
631−--
632−-- * 'btrHeader'
633517beginTransactionResponse
634518 :: BeginTransactionResponse
635519beginTransactionResponse =
636520 BeginTransactionResponse'
637521 { _btrTransaction = Nothing
638− , _btrHeader = Nothing
639522 }
640523
641524-- | The transaction identifier (always present).
@@ -645,82 +528,55 @@ btrTransaction
645528 (\ s a -> s{_btrTransaction = a})
646529 . mapping _Coerce
647530
648−btrHeader :: Lens' BeginTransactionResponse (Maybe ResponseHeader)
649−btrHeader
650− = lens _btrHeader (\ s a -> s{_btrHeader = a})
651−
652531instance FromJSON BeginTransactionResponse where
653532 parseJSON
654533 = withObject "BeginTransactionResponse"
655534 (\ o ->
656− BeginTransactionResponse' <$>
657− (o .:? "transaction") <*> (o .:? "header"))
535+ BeginTransactionResponse' <$> (o .:? "transaction"))
658536
659537instance ToJSON BeginTransactionResponse where
660538 toJSON BeginTransactionResponse'{..}
661539 = object
662− (catMaybes
663− [("transaction" .=) <$> _btrTransaction,
664− ("header" .=) <$> _btrHeader])
540+ (catMaybes [("transaction" .=) <$> _btrTransaction])
665541
542+-- | The result of applying a mutation.
666543--
667544-- /See:/ 'mutationResult' smart constructor.
668−data MutationResult = MutationResult'
669− { _mrInsertAutoIdKeys :: !(Maybe [Key])
670− , _mrIndexUpdates :: !(Maybe (Textual Int32))
545+newtype MutationResult = MutationResult'
546+ { _mrKey :: Maybe Key
671547 } deriving (Eq,Show,Data,Typeable,Generic)
672548
673549-- | Creates a value of 'MutationResult' with the minimum fields required to make a request.
674550--
675551-- Use one of the following lenses to modify other fields as desired:
676552--
677−-- * 'mrInsertAutoIdKeys'
678−--
679−-- * 'mrIndexUpdates'
553+-- * 'mrKey'
680554mutationResult
681555 :: MutationResult
682556mutationResult =
683557 MutationResult'
684− { _mrInsertAutoIdKeys = Nothing
685− , _mrIndexUpdates = Nothing
558+ { _mrKey = Nothing
686559 }
687560
688−-- | Keys for insertAutoId entities. One per entity from the request, in the
689−-- same order.
690−mrInsertAutoIdKeys :: Lens' MutationResult [Key]
691−mrInsertAutoIdKeys
692− = lens _mrInsertAutoIdKeys
693− (\ s a -> s{_mrInsertAutoIdKeys = a})
694− . _Default
695− . _Coerce
696−
697−-- | Number of index writes.
698−mrIndexUpdates :: Lens' MutationResult (Maybe Int32)
699−mrIndexUpdates
700− = lens _mrIndexUpdates
701− (\ s a -> s{_mrIndexUpdates = a})
702− . mapping _Coerce
561+-- | The automatically allocated key. Set only when the mutation allocated a
562+-- key.
563+mrKey :: Lens' MutationResult (Maybe Key)
564+mrKey = lens _mrKey (\ s a -> s{_mrKey = a})
703565
704566instance FromJSON MutationResult where
705567 parseJSON
706568 = withObject "MutationResult"
707− (\ o ->
708− MutationResult' <$>
709− (o .:? "insertAutoIdKeys" .!= mempty) <*>
710− (o .:? "indexUpdates"))
569+ (\ o -> MutationResult' <$> (o .:? "key"))
711570
712571instance ToJSON MutationResult where
713572 toJSON MutationResult'{..}
714− = object
715− (catMaybes
716− [("insertAutoIdKeys" .=) <$> _mrInsertAutoIdKeys,
717− ("indexUpdates" .=) <$> _mrIndexUpdates])
573+ = object (catMaybes [("key" .=) <$> _mrKey])
718574
575+-- | The response for google.datastore.v1beta3.Datastore.AllocateIds.
719576--
720577-- /See:/ 'allocateIdsResponse' smart constructor.
721−data AllocateIdsResponse = AllocateIdsResponse'
722− { _aKeys :: !(Maybe [Key])
723− , _aHeader :: !(Maybe ResponseHeader)
578+newtype AllocateIdsResponse = AllocateIdsResponse'
579+ { _aKeys :: Maybe [Key]
724580 } deriving (Eq,Show,Data,Typeable,Generic)
725581
726582-- | Creates a value of 'AllocateIdsResponse' with the minimum fields required to make a request.
@@ -728,14 +584,11 @@ data AllocateIdsResponse = AllocateIdsResponse'
728584-- Use one of the following lenses to modify other fields as desired:
729585--
730586-- * 'aKeys'
731−--
732−-- * 'aHeader'
733587allocateIdsResponse
734588 :: AllocateIdsResponse
735589allocateIdsResponse =
736590 AllocateIdsResponse'
737591 { _aKeys = Nothing
738− , _aHeader = Nothing
739592 }
740593
741594-- | The keys specified in the request (in the same order), each with its key
@@ -745,166 +598,165 @@ aKeys
745598 = lens _aKeys (\ s a -> s{_aKeys = a}) . _Default .
746599 _Coerce
747600
748−aHeader :: Lens' AllocateIdsResponse (Maybe ResponseHeader)
749−aHeader = lens _aHeader (\ s a -> s{_aHeader = a})
750−
751601instance FromJSON AllocateIdsResponse where
752602 parseJSON
753603 = withObject "AllocateIdsResponse"
754604 (\ o ->
755− AllocateIdsResponse' <$>
756− (o .:? "keys" .!= mempty) <*> (o .:? "header"))
605+ AllocateIdsResponse' <$> (o .:? "keys" .!= mempty))
757606
758607instance ToJSON AllocateIdsResponse where
759608 toJSON AllocateIdsResponse'{..}
760− = object
761− (catMaybes
762− [("keys" .=) <$> _aKeys, ("header" .=) <$> _aHeader])
609+ = object (catMaybes [("keys" .=) <$> _aKeys])
763610
764−-- | A GQL query.
611+-- | A [GQL
612+-- query](https:\/\/cloud.google.com\/datastore\/docs\/apis\/gql\/gql_reference).
765613--
766614-- /See:/ 'gqlQuery' smart constructor.
767615data GqlQuery = GqlQuery'
768− { _gqAllowLiteral :: !(Maybe Bool)
769− , _gqNumberArgs :: !(Maybe [GqlQueryArg])
770− , _gqQueryString :: !(Maybe Text)
771− , _gqNameArgs :: !(Maybe [GqlQueryArg])
616+ { _gqPositionalBindings :: !(Maybe [GqlQueryParameter])
617+ , _gqNamedBindings :: !(Maybe GqlQueryNamedBindings)
618+ , _gqQueryString :: !(Maybe Text)
619+ , _gqAllowLiterals :: !(Maybe Bool)
772620 } deriving (Eq,Show,Data,Typeable,Generic)
773621
774622-- | Creates a value of 'GqlQuery' with the minimum fields required to make a request.
775623--
776624-- Use one of the following lenses to modify other fields as desired:
777625--
778−-- * 'gqAllowLiteral'
626+-- * 'gqPositionalBindings'
779627--
780−-- * 'gqNumberArgs'
628+-- * 'gqNamedBindings'
781629--
782630-- * 'gqQueryString'
783631--
784−-- * 'gqNameArgs'
632+-- * 'gqAllowLiterals'
785633gqlQuery
786634 :: GqlQuery
787635gqlQuery =
788636 GqlQuery'
789− { _gqAllowLiteral = Nothing
790− , _gqNumberArgs = Nothing
637+ { _gqPositionalBindings = Nothing
638+ , _gqNamedBindings = Nothing
791639 , _gqQueryString = Nothing
792− , _gqNameArgs = Nothing
640+ , _gqAllowLiterals = Nothing
793641 }
794642
795−-- | When false, the query string must not contain a literal.
796−gqAllowLiteral :: Lens' GqlQuery (Maybe Bool)
797−gqAllowLiteral
798− = lens _gqAllowLiteral
799− (\ s a -> s{_gqAllowLiteral = a})
800−
801−-- | Numbered binding site \'1 references the first numbered argument,
802−-- effectively using 1-based indexing, rather than the usual 0. A numbered
803−-- argument must NOT set field GqlQueryArg.name. For each binding site
804−-- numbered i in query_string, there must be an ith numbered argument. The
805−-- inverse must also be true.
806−gqNumberArgs :: Lens' GqlQuery [GqlQueryArg]
807−gqNumberArgs
808− = lens _gqNumberArgs (\ s a -> s{_gqNumberArgs = a})
643+-- | Numbered binding site \'1 references the first numbered parameter,
644+-- effectively using 1-based indexing, rather than the usual 0. For each
645+-- binding site numbered i in \`query_string\`, there must be an i-th
646+-- numbered parameter. The inverse must also be true.
647+gqPositionalBindings :: Lens' GqlQuery [GqlQueryParameter]
648+gqPositionalBindings
649+ = lens _gqPositionalBindings
650+ (\ s a -> s{_gqPositionalBindings = a})
809651 . _Default
810652 . _Coerce
811653
812−-- | The query string.
654+-- | For each non-reserved named binding site in the query string, there must
655+-- be a named parameter with that name, but not necessarily the inverse.
656+-- Key must match regex \`A-Za-z_$*\`, must not match regex \`__.*__\`, and
657+-- must not be \`\"\"\`.
658+gqNamedBindings :: Lens' GqlQuery (Maybe GqlQueryNamedBindings)
659+gqNamedBindings
660+ = lens _gqNamedBindings
661+ (\ s a -> s{_gqNamedBindings = a})
662+
663+-- | A string of the format described
664+-- [here](https:\/\/cloud.google.com\/datastore\/docs\/apis\/gql\/gql_reference).
813665gqQueryString :: Lens' GqlQuery (Maybe Text)
814666gqQueryString
815667 = lens _gqQueryString
816668 (\ s a -> s{_gqQueryString = a})
817669
818−-- | A named argument must set field GqlQueryArg.name. No two named arguments
819−-- may have the same name. For each non-reserved named binding site in the
820−-- query string, there must be a named argument with that name, but not
821−-- necessarily the inverse.
822−gqNameArgs :: Lens' GqlQuery [GqlQueryArg]
823−gqNameArgs
824− = lens _gqNameArgs (\ s a -> s{_gqNameArgs = a}) .
825− _Default
826− . _Coerce
670+-- | When false, the query string must not contain any literals and instead
671+-- must bind all values. For example, \`SELECT * FROM Kind WHERE a =
672+-- \'string literal\'\` is not allowed, while \`SELECT * FROM Kind WHERE a
673+-- = \'value\` is.
674+gqAllowLiterals :: Lens' GqlQuery (Maybe Bool)
675+gqAllowLiterals
676+ = lens _gqAllowLiterals
677+ (\ s a -> s{_gqAllowLiterals = a})
827678
828679instance FromJSON GqlQuery where
829680 parseJSON
830681 = withObject "GqlQuery"
831682 (\ o ->
832683 GqlQuery' <$>
833− (o .:? "allowLiteral") <*>
834− (o .:? "numberArgs" .!= mempty)
684+ (o .:? "positionalBindings" .!= mempty) <*>
685+ (o .:? "namedBindings")
835686 <*> (o .:? "queryString")
836− <*> (o .:? "nameArgs" .!= mempty))
687+ <*> (o .:? "allowLiterals"))
837688
838689instance ToJSON GqlQuery where
839690 toJSON GqlQuery'{..}
840691 = object
841692 (catMaybes
842− [("allowLiteral" .=) <$> _gqAllowLiteral,
843− ("numberArgs" .=) <$> _gqNumberArgs,
693+ [("positionalBindings" .=) <$> _gqPositionalBindings,
694+ ("namedBindings" .=) <$> _gqNamedBindings,
844695 ("queryString" .=) <$> _gqQueryString,
845− ("nameArgs" .=) <$> _gqNameArgs])
696+ ("allowLiterals" .=) <$> _gqAllowLiterals])
846697
698+-- | The response for google.datastore.v1beta3.Datastore.RunQuery.
847699--
848700-- /See:/ 'runQueryResponse' smart constructor.
849701data RunQueryResponse = RunQueryResponse'
850− { _rqrBatch :: !(Maybe QueryResultBatch)
851− , _rqrHeader :: !(Maybe ResponseHeader)
702+ { _rBatch :: !(Maybe QueryResultBatch)
703+ , _rQuery :: !(Maybe Query)
852704 } deriving (Eq,Show,Data,Typeable,Generic)
853705
854706-- | Creates a value of 'RunQueryResponse' with the minimum fields required to make a request.
855707--
856708-- Use one of the following lenses to modify other fields as desired:
857709--
858−-- * 'rqrBatch'
710+-- * 'rBatch'
859711--
860−-- * 'rqrHeader'
712+-- * 'rQuery'
861713runQueryResponse
862714 :: RunQueryResponse
863715runQueryResponse =
864716 RunQueryResponse'
865− { _rqrBatch = Nothing
866− , _rqrHeader = Nothing
717+ { _rBatch = Nothing
718+ , _rQuery = Nothing
867719 }
868720
869721-- | A batch of query results (always present).
870−rqrBatch :: Lens' RunQueryResponse (Maybe QueryResultBatch)
871−rqrBatch = lens _rqrBatch (\ s a -> s{_rqrBatch = a})
722+rBatch :: Lens' RunQueryResponse (Maybe QueryResultBatch)
723+rBatch = lens _rBatch (\ s a -> s{_rBatch = a})
872724
873−rqrHeader :: Lens' RunQueryResponse (Maybe ResponseHeader)
874−rqrHeader
875− = lens _rqrHeader (\ s a -> s{_rqrHeader = a})
725+-- | The parsed form of the \`GqlQuery\` from the request, if it was set.
726+rQuery :: Lens' RunQueryResponse (Maybe Query)
727+rQuery = lens _rQuery (\ s a -> s{_rQuery = a})
876728
877729instance FromJSON RunQueryResponse where
878730 parseJSON
879731 = withObject "RunQueryResponse"
880732 (\ o ->
881733 RunQueryResponse' <$>
882− (o .:? "batch") <*> (o .:? "header"))
734+ (o .:? "batch") <*> (o .:? "query"))
883735
884736instance ToJSON RunQueryResponse where
885737 toJSON RunQueryResponse'{..}
886738 = object
887739 (catMaybes
888− [("batch" .=) <$> _rqrBatch,
889− ("header" .=) <$> _rqrHeader])
740+ [("batch" .=) <$> _rBatch, ("query" .=) <$> _rQuery])
890741
891742-- | A message that can hold any of the supported value types and associated
892743-- metadata.
893744--
894745-- /See:/ 'value' smart constructor.
895746data Value = Value'
896− { _vKeyValue :: !(Maybe Key)
897− , _vBlobKeyValue :: !(Maybe Text)
898− , _vDateTimeValue :: !(Maybe DateTime')
899− , _vIntegerValue :: !(Maybe (Textual Int64))
900− , _vEntityValue :: !(Maybe Entity)
901− , _vDoubleValue :: !(Maybe (Textual Double))
902− , _vStringValue :: !(Maybe Text)
903− , _vListValue :: !(Maybe [Value])
904− , _vIndexed :: !(Maybe Bool)
905− , _vBooleanValue :: !(Maybe Bool)
906− , _vMeaning :: !(Maybe (Textual Int32))
907− , _vBlobValue :: !(Maybe (Textual Word8))
747+ { _vKeyValue :: !(Maybe Key)
748+ , _vGeoPointValue :: !(Maybe LatLng)
749+ , _vIntegerValue :: !(Maybe (Textual Int64))
750+ , _vTimestampValue :: !(Maybe DateTime')
751+ , _vEntityValue :: !(Maybe Entity)
752+ , _vExcludeFromIndexes :: !(Maybe Bool)
753+ , _vDoubleValue :: !(Maybe (Textual Double))
754+ , _vStringValue :: !(Maybe Text)
755+ , _vBooleanValue :: !(Maybe Bool)
756+ , _vMeaning :: !(Maybe (Textual Int32))
757+ , _vArrayValue :: !(Maybe ArrayValue)
758+ , _vNullValue :: !(Maybe ValueNullValue)
759+ , _vBlobValue :: !(Maybe (Textual Word8))
908760 } deriving (Eq,Show,Data,Typeable,Generic)
909761
910762-- | Creates a value of 'Value' with the minimum fields required to make a request.
@@ -913,42 +765,45 @@ data Value = Value'
913765--
914766-- * 'vKeyValue'
915767--
916−-- * 'vBlobKeyValue'
917−--
918−-- * 'vDateTimeValue'
768+-- * 'vGeoPointValue'
919769--
920770-- * 'vIntegerValue'
921771--
772+-- * 'vTimestampValue'
773+--
922774-- * 'vEntityValue'
923775--
776+-- * 'vExcludeFromIndexes'
777+--
924778-- * 'vDoubleValue'
925779--
926780-- * 'vStringValue'
927781--
928−-- * 'vListValue'
929−--
930−-- * 'vIndexed'
931−--
932782-- * 'vBooleanValue'
933783--
934784-- * 'vMeaning'
935785--
786+-- * 'vArrayValue'
787+--
788+-- * 'vNullValue'
789+--
936790-- * 'vBlobValue'
937791value
938792 :: Value
939793value =
940794 Value'
941795 { _vKeyValue = Nothing
942− , _vBlobKeyValue = Nothing
943− , _vDateTimeValue = Nothing
796+ , _vGeoPointValue = Nothing
944797 , _vIntegerValue = Nothing
798+ , _vTimestampValue = Nothing
945799 , _vEntityValue = Nothing
800+ , _vExcludeFromIndexes = Nothing
946801 , _vDoubleValue = Nothing
947802 , _vStringValue = Nothing
948− , _vListValue = Nothing
949− , _vIndexed = Nothing
950803 , _vBooleanValue = Nothing
951804 , _vMeaning = Nothing
805+ , _vArrayValue = Nothing
806+ , _vNullValue = Nothing
952807 , _vBlobValue = Nothing
953808 }
954809
@@ -957,18 +812,11 @@ vKeyValue :: Lens' Value (Maybe Key)
957812vKeyValue
958813 = lens _vKeyValue (\ s a -> s{_vKeyValue = a})
959814
960−-- | A blob key value.
961−vBlobKeyValue :: Lens' Value (Maybe Text)
962−vBlobKeyValue
963− = lens _vBlobKeyValue
964− (\ s a -> s{_vBlobKeyValue = a})
965−
966−-- | A timestamp value.
967−vDateTimeValue :: Lens' Value (Maybe UTCTime)
968−vDateTimeValue
969− = lens _vDateTimeValue
970− (\ s a -> s{_vDateTimeValue = a})
971− . mapping _DateTime
815+-- | A geo point value representing a point on the surface of Earth.
816+vGeoPointValue :: Lens' Value (Maybe LatLng)
817+vGeoPointValue
818+ = lens _vGeoPointValue
819+ (\ s a -> s{_vGeoPointValue = a})
972820
973821-- | An integer value.
974822vIntegerValue :: Lens' Value (Maybe Int64)
@@ -977,56 +825,68 @@ vIntegerValue
977825 (\ s a -> s{_vIntegerValue = a})
978826 . mapping _Coerce
979827
980−-- | An entity value. May have no key. May have a key with an incomplete key
981−-- path. May have a reserved\/read-only key.
828+-- | A timestamp value. When stored in the Datastore, precise only to
829+-- microseconds; any additional precision is rounded down.
830+vTimestampValue :: Lens' Value (Maybe UTCTime)
831+vTimestampValue
832+ = lens _vTimestampValue
833+ (\ s a -> s{_vTimestampValue = a})
834+ . mapping _DateTime
835+
836+-- | An entity value. - May have no key. - May have a key with an incomplete
837+-- key path. - May have a reserved\/read-only key.
982838vEntityValue :: Lens' Value (Maybe Entity)
983839vEntityValue
984840 = lens _vEntityValue (\ s a -> s{_vEntityValue = a})
985841
842+-- | If the value should be excluded from all indexes including those defined
843+-- explicitly.
844+vExcludeFromIndexes :: Lens' Value (Maybe Bool)
845+vExcludeFromIndexes
846+ = lens _vExcludeFromIndexes
847+ (\ s a -> s{_vExcludeFromIndexes = a})
848+
986849-- | A double value.
987850vDoubleValue :: Lens' Value (Maybe Double)
988851vDoubleValue
989852 = lens _vDoubleValue (\ s a -> s{_vDoubleValue = a})
990853 . mapping _Coerce
991854
992−-- | A UTF-8 encoded string value. When indexed is true, may have at most 500
993−-- characters.
855+-- | A UTF-8 encoded string value. When \`exclude_from_indexes\` is false (it
856+-- is indexed) , may have at most 1500 bytes. Otherwise, may be set to at
857+-- least 1,000,000 bytes.
994858vStringValue :: Lens' Value (Maybe Text)
995859vStringValue
996860 = lens _vStringValue (\ s a -> s{_vStringValue = a})
997861
998−-- | A list value. Cannot contain another list value. A Value instance that
999−-- sets field list_value must not set field meaning or field indexed.
1000−vListValue :: Lens' Value [Value]
1001−vListValue
1002− = lens _vListValue (\ s a -> s{_vListValue = a}) .
1003− _Default
1004− . _Coerce
1005−
1006−-- | If the value should be indexed. The indexed property may be set for a
1007−-- null value. When indexed is true, stringValue is limited to 500
1008−-- characters and the blob value is limited to 500 bytes. Input values by
1009−-- default have indexed set to true; however, you can explicitly set
1010−-- indexed to true if you want. (An output value never has indexed
1011−-- explicitly set to true.) If a value is itself an entity, it cannot have
1012−-- indexed set to true.
1013−vIndexed :: Lens' Value (Maybe Bool)
1014−vIndexed = lens _vIndexed (\ s a -> s{_vIndexed = a})
1015−
1016862-- | A boolean value.
1017863vBooleanValue :: Lens' Value (Maybe Bool)
1018864vBooleanValue
1019865 = lens _vBooleanValue
1020866 (\ s a -> s{_vBooleanValue = a})
1021867
1022−-- | The meaning field is reserved and should not be used.
868+-- | The \`meaning\` field should only be populated for backwards
869+-- compatibility.
1023870vMeaning :: Lens' Value (Maybe Int32)
1024871vMeaning
1025872 = lens _vMeaning (\ s a -> s{_vMeaning = a}) .
1026873 mapping _Coerce
1027874
1028−-- | A blob value. May be a maximum of 1,000,000 bytes. When indexed is true,
1029−-- may have at most 500 bytes.
875+-- | An array value. Cannot contain another array value. A \`Value\` instance
876+-- that sets field \`array_value\` must not set fields \`meaning\` or
877+-- \`exclude_from_indexes\`.
878+vArrayValue :: Lens' Value (Maybe ArrayValue)
879+vArrayValue
880+ = lens _vArrayValue (\ s a -> s{_vArrayValue = a})
881+
882+-- | A null value.
883+vNullValue :: Lens' Value (Maybe ValueNullValue)
884+vNullValue
885+ = lens _vNullValue (\ s a -> s{_vNullValue = a})
886+
887+-- | A blob value. May have at most 1,000,000 bytes. When
888+-- \`exclude_from_indexes\` is false, may have at most 1500 bytes. In JSON
889+-- requests, must be base64-encoded.
1030890vBlobValue :: Lens' Value (Maybe Word8)
1031891vBlobValue
1032892 = lens _vBlobValue (\ s a -> s{_vBlobValue = a}) .
@@ -1037,16 +897,17 @@ instance FromJSON Value where
1037897 = withObject "Value"
1038898 (\ o ->
1039899 Value' <$>
1040− (o .:? "keyValue") <*> (o .:? "blobKeyValue") <*>
1041− (o .:? "dateTimeValue")
1042− <*> (o .:? "integerValue")
900+ (o .:? "keyValue") <*> (o .:? "geoPointValue") <*>
901+ (o .:? "integerValue")
902+ <*> (o .:? "timestampValue")
1043903 <*> (o .:? "entityValue")
904+ <*> (o .:? "excludeFromIndexes")
1044905 <*> (o .:? "doubleValue")
1045906 <*> (o .:? "stringValue")
1046− <*> (o .:? "listValue" .!= mempty)
1047− <*> (o .:? "indexed")
1048907 <*> (o .:? "booleanValue")
1049908 <*> (o .:? "meaning")
909+ <*> (o .:? "arrayValue")
910+ <*> (o .:? "nullValue")
1050911 <*> (o .:? "blobValue"))
1051912
1052913instance ToJSON Value where
@@ -1054,18 +915,20 @@ instance ToJSON Value where
1054915 = object
1055916 (catMaybes
1056917 [("keyValue" .=) <$> _vKeyValue,
1057− ("blobKeyValue" .=) <$> _vBlobKeyValue,
1058− ("dateTimeValue" .=) <$> _vDateTimeValue,
918+ ("geoPointValue" .=) <$> _vGeoPointValue,
1059919 ("integerValue" .=) <$> _vIntegerValue,
920+ ("timestampValue" .=) <$> _vTimestampValue,
1060921 ("entityValue" .=) <$> _vEntityValue,
922+ ("excludeFromIndexes" .=) <$> _vExcludeFromIndexes,
1061923 ("doubleValue" .=) <$> _vDoubleValue,
1062924 ("stringValue" .=) <$> _vStringValue,
1063− ("listValue" .=) <$> _vListValue,
1064− ("indexed" .=) <$> _vIndexed,
1065925 ("booleanValue" .=) <$> _vBooleanValue,
1066926 ("meaning" .=) <$> _vMeaning,
927+ ("arrayValue" .=) <$> _vArrayValue,
928+ ("nullValue" .=) <$> _vNullValue,
1067929 ("blobValue" .=) <$> _vBlobValue])
1068930
931+-- | The request for google.datastore.v1beta3.Datastore.Lookup.
1069932--
1070933-- /See:/ 'lookupRequest' smart constructor.
1071934data LookupRequest = LookupRequest'
@@ -1088,13 +951,13 @@ lookupRequest =
1088951 , _lrReadOptions = Nothing
1089952 }
1090953
1091−-- | Keys of entities to look up from the datastore.
954+-- | Keys of entities to look up.
1092955lrKeys :: Lens' LookupRequest [Key]
1093956lrKeys
1094957 = lens _lrKeys (\ s a -> s{_lrKeys = a}) . _Default .
1095958 _Coerce
1096959
1097−-- | Options for this lookup request. Optional.
960+-- | The options for this lookup request.
1098961lrReadOptions :: Lens' LookupRequest (Maybe ReadOptions)
1099962lrReadOptions
1100963 = lens _lrReadOptions
@@ -1114,16 +977,14 @@ instance ToJSON LookupRequest where
1114977 [("keys" .=) <$> _lrKeys,
1115978 ("readOptions" .=) <$> _lrReadOptions])
1116979
1117−-- | A set of changes to apply.
980+-- | A mutation to apply to an entity.
1118981--
1119982-- /See:/ 'mutation' smart constructor.
1120983data Mutation = Mutation'
1121− { _mInsert :: !(Maybe [Entity])
1122− , _mForce :: !(Maybe Bool)
1123− , _mInsertAutoId :: !(Maybe [Entity])
1124− , _mUpsert :: !(Maybe [Entity])
1125− , _mDelete :: !(Maybe [Key])
1126− , _mUpdate :: !(Maybe [Entity])
984+ { _mInsert :: !(Maybe Entity)
985+ , _mUpsert :: !(Maybe Entity)
986+ , _mDelete :: !(Maybe Key)
987+ , _mUpdate :: !(Maybe Entity)
1127988 } deriving (Eq,Show,Data,Typeable,Generic)
1128989
1129990-- | Creates a value of 'Mutation' with the minimum fields required to make a request.
@@ -1132,10 +993,6 @@ data Mutation = Mutation'
1132993--
1133994-- * 'mInsert'
1134995--
1135−-- * 'mForce'
1136−--
1137−-- * 'mInsertAutoId'
1138−--
1139996-- * 'mUpsert'
1140997--
1141998-- * 'mDelete'
@@ -1146,172 +1003,87 @@ mutation
11461003mutation =
11471004 Mutation'
11481005 { _mInsert = Nothing
1149− , _mForce = Nothing
1150− , _mInsertAutoId = Nothing
11511006 , _mUpsert = Nothing
11521007 , _mDelete = Nothing
11531008 , _mUpdate = Nothing
11541009 }
11551010
1156−-- | Entities to insert. Each inserted entity\'s key must have a complete
1157−-- path and must not be reserved\/read-only.
1158−mInsert :: Lens' Mutation [Entity]
1159−mInsert
1160− = lens _mInsert (\ s a -> s{_mInsert = a}) . _Default
1161− . _Coerce
1011+-- | The entity to insert. The entity must not already exist. The entity
1012+-- key\'s final path element may be incomplete.
1013+mInsert :: Lens' Mutation (Maybe Entity)
1014+mInsert = lens _mInsert (\ s a -> s{_mInsert = a})
11621015
1163−-- | Ignore a user specified read-only period. Optional.
1164−mForce :: Lens' Mutation (Maybe Bool)
1165−mForce = lens _mForce (\ s a -> s{_mForce = a})
1016+-- | The entity to upsert. The entity may or may not already exist. The
1017+-- entity key\'s final path element may be incomplete.
1018+mUpsert :: Lens' Mutation (Maybe Entity)
1019+mUpsert = lens _mUpsert (\ s a -> s{_mUpsert = a})
11661020
1167−-- | Insert entities with a newly allocated ID. Each inserted entity\'s key
1168−-- must omit the final identifier in its path and must not be
1021+-- | The key of the entity to delete. The entity may or may not already
1022+-- exist. Must have a complete key path and must not be
11691023-- reserved\/read-only.
1170−mInsertAutoId :: Lens' Mutation [Entity]
1171−mInsertAutoId
1172− = lens _mInsertAutoId
1173− (\ s a -> s{_mInsertAutoId = a})
1174− . _Default
1175− . _Coerce
1176−
1177−-- | Entities to upsert. Each upserted entity\'s key must have a complete
1178−-- path and must not be reserved\/read-only.
1179−mUpsert :: Lens' Mutation [Entity]
1180−mUpsert
1181− = lens _mUpsert (\ s a -> s{_mUpsert = a}) . _Default
1182− . _Coerce
1024+mDelete :: Lens' Mutation (Maybe Key)
1025+mDelete = lens _mDelete (\ s a -> s{_mDelete = a})
11831026
1184−-- | Keys of entities to delete. Each key must have a complete key path and
1185−-- must not be reserved\/read-only.
1186−mDelete :: Lens' Mutation [Key]
1187−mDelete
1188− = lens _mDelete (\ s a -> s{_mDelete = a}) . _Default
1189− . _Coerce
1190−
1191−-- | Entities to update. Each updated entity\'s key must have a complete path
1192−-- and must not be reserved\/read-only.
1193−mUpdate :: Lens' Mutation [Entity]
1194−mUpdate
1195− = lens _mUpdate (\ s a -> s{_mUpdate = a}) . _Default
1196− . _Coerce
1027+-- | The entity to update. The entity must already exist. Must have a
1028+-- complete key path.
1029+mUpdate :: Lens' Mutation (Maybe Entity)
1030+mUpdate = lens _mUpdate (\ s a -> s{_mUpdate = a})
11971031
11981032instance FromJSON Mutation where
11991033 parseJSON
12001034 = withObject "Mutation"
12011035 (\ o ->
12021036 Mutation' <$>
1203− (o .:? "insert" .!= mempty) <*> (o .:? "force") <*>
1204− (o .:? "insertAutoId" .!= mempty)
1205− <*> (o .:? "upsert" .!= mempty)
1206− <*> (o .:? "delete" .!= mempty)
1207− <*> (o .:? "update" .!= mempty))
1037+ (o .:? "insert") <*> (o .:? "upsert") <*>
1038+ (o .:? "delete")
1039+ <*> (o .:? "update"))
12081040
12091041instance ToJSON Mutation where
12101042 toJSON Mutation'{..}
12111043 = object
12121044 (catMaybes
12131045 [("insert" .=) <$> _mInsert,
1214− ("force" .=) <$> _mForce,
1215− ("insertAutoId" .=) <$> _mInsertAutoId,
12161046 ("upsert" .=) <$> _mUpsert,
12171047 ("delete" .=) <$> _mDelete,
12181048 ("update" .=) <$> _mUpdate])
12191049
1050+-- | For each non-reserved named binding site in the query string, there must
1051+-- be a named parameter with that name, but not necessarily the inverse.
1052+-- Key must match regex \`A-Za-z_$*\`, must not match regex \`__.*__\`, and
1053+-- must not be \`\"\"\`.
12201054--
1221−-- /See:/ 'responseHeader' smart constructor.
1222−newtype ResponseHeader = ResponseHeader'
1223− { _rhKind :: Text
1224− } deriving (Eq,Show,Data,Typeable,Generic)
1225−
1226−-- | Creates a value of 'ResponseHeader' with the minimum fields required to make a request.
1227−--
1228−-- Use one of the following lenses to modify other fields as desired:
1229−--
1230−-- * 'rhKind'
1231−responseHeader
1232− :: ResponseHeader
1233−responseHeader =
1234− ResponseHeader'
1235− { _rhKind = "datastore#responseHeader"
1236− }
1237−
1238−-- | Identifies what kind of resource this is. Value: the fixed string
1239−-- \"datastore#responseHeader\".
1240−rhKind :: Lens' ResponseHeader Text
1241−rhKind = lens _rhKind (\ s a -> s{_rhKind = a})
1242−
1243−instance FromJSON ResponseHeader where
1244− parseJSON
1245− = withObject "ResponseHeader"
1246− (\ o ->
1247− ResponseHeader' <$>
1248− (o .:? "kind" .!= "datastore#responseHeader"))
1249−
1250−instance ToJSON ResponseHeader where
1251− toJSON ResponseHeader'{..}
1252− = object (catMaybes [Just ("kind" .= _rhKind)])
1253−
1254−-- | A (kind, ID\/name) pair used to construct a key path. At most one of
1255−-- name or ID may be set. If either is set, the element is complete. If
1256−-- neither is set, the element is incomplete.
1257−--
1258−-- /See:/ 'keyPathElement' smart constructor.
1259−data KeyPathElement = KeyPathElement'
1260− { _kpeKind :: !(Maybe Text)
1261− , _kpeName :: !(Maybe Text)
1262− , _kpeId :: !(Maybe (Textual Int64))
1055+-- /See:/ 'gqlQueryNamedBindings' smart constructor.
1056+newtype GqlQueryNamedBindings = GqlQueryNamedBindings'
1057+ { _gqnbAddtional :: HashMap Text GqlQueryParameter
12631058 } deriving (Eq,Show,Data,Typeable,Generic)
12641059
1265−-- | Creates a value of 'KeyPathElement' with the minimum fields required to make a request.
1060+-- | Creates a value of 'GqlQueryNamedBindings' with the minimum fields required to make a request.
12661061--
12671062-- Use one of the following lenses to modify other fields as desired:
12681063--
1269−-- * 'kpeKind'
1270−--
1271−-- * 'kpeName'
1272−--
1273−-- * 'kpeId'
1274−keyPathElement
1275− :: KeyPathElement
1276−keyPathElement =
1277− KeyPathElement'
1278− { _kpeKind = Nothing
1279− , _kpeName = Nothing
1280− , _kpeId = Nothing
1064+-- * 'gqnbAddtional'
1065+gqlQueryNamedBindings
1066+ :: HashMap Text GqlQueryParameter -- ^ 'gqnbAddtional'
1067+ -> GqlQueryNamedBindings
1068+gqlQueryNamedBindings pGqnbAddtional_ =
1069+ GqlQueryNamedBindings'
1070+ { _gqnbAddtional = _Coerce # pGqnbAddtional_
12811071 }
12821072
1283−-- | The kind of the entity. A kind matching regex \"__.*__\" is
1284−-- reserved\/read-only. A kind must not contain more than 500 characters.
1285−-- Cannot be \"\".
1286−kpeKind :: Lens' KeyPathElement (Maybe Text)
1287−kpeKind = lens _kpeKind (\ s a -> s{_kpeKind = a})
1288−
1289−-- | The name of the entity. A name matching regex \"__.*__\" is
1290−-- reserved\/read-only. A name must not be more than 500 characters. Cannot
1291−-- be \"\".
1292−kpeName :: Lens' KeyPathElement (Maybe Text)
1293−kpeName = lens _kpeName (\ s a -> s{_kpeName = a})
1294−
1295−-- | The ID of the entity. Never equal to zero. Values less than zero are
1296−-- discouraged and will not be supported in the future.
1297−kpeId :: Lens' KeyPathElement (Maybe Int64)
1298−kpeId
1299− = lens _kpeId (\ s a -> s{_kpeId = a}) .
1300− mapping _Coerce
1073+gqnbAddtional :: Lens' GqlQueryNamedBindings (HashMap Text GqlQueryParameter)
1074+gqnbAddtional
1075+ = lens _gqnbAddtional
1076+ (\ s a -> s{_gqnbAddtional = a})
1077+ . _Coerce
13011078
1302−instance FromJSON KeyPathElement where
1079+instance FromJSON GqlQueryNamedBindings where
13031080 parseJSON
1304− = withObject "KeyPathElement"
1081+ = withObject "GqlQueryNamedBindings"
13051082 (\ o ->
1306− KeyPathElement' <$>
1307− (o .:? "kind") <*> (o .:? "name") <*> (o .:? "id"))
1083+ GqlQueryNamedBindings' <$> (parseJSONObject o))
13081084
1309−instance ToJSON KeyPathElement where
1310− toJSON KeyPathElement'{..}
1311− = object
1312− (catMaybes
1313− [("kind" .=) <$> _kpeKind, ("name" .=) <$> _kpeName,
1314− ("id" .=) <$> _kpeId])
1085+instance ToJSON GqlQueryNamedBindings where
1086+ toJSON = toJSON . _gqnbAddtional
13151087
13161088-- | A reference to a property relative to the kind expressions.
13171089--
@@ -1332,7 +1104,8 @@ propertyReference =
13321104 { _prName = Nothing
13331105 }
13341106
1335−-- | The name of the property.
1107+-- | The name of the property. If name includes \".\"s, it may be interpreted
1108+-- as a property name path.
13361109prName :: Lens' PropertyReference (Maybe Text)
13371110prName = lens _prName (\ s a -> s{_prName = a})
13381111
@@ -1345,68 +1118,15 @@ instance ToJSON PropertyReference where
13451118 toJSON PropertyReference'{..}
13461119 = object (catMaybes [("name" .=) <$> _prName])
13471120
1348−-- | A binding argument for a GQL query.
1349−--
1350−-- /See:/ 'gqlQueryArg' smart constructor.
1351−data GqlQueryArg = GqlQueryArg'
1352− { _gqaCursor :: !(Maybe (Textual Word8))
1353− , _gqaValue :: !(Maybe Value)
1354− , _gqaName :: !(Maybe Text)
1355− } deriving (Eq,Show,Data,Typeable,Generic)
1356−
1357−-- | Creates a value of 'GqlQueryArg' with the minimum fields required to make a request.
1358−--
1359−-- Use one of the following lenses to modify other fields as desired:
1360−--
1361−-- * 'gqaCursor'
1362−--
1363−-- * 'gqaValue'
1364−--
1365−-- * 'gqaName'
1366−gqlQueryArg
1367− :: GqlQueryArg
1368−gqlQueryArg =
1369− GqlQueryArg'
1370− { _gqaCursor = Nothing
1371− , _gqaValue = Nothing
1372− , _gqaName = Nothing
1373− }
1374−
1375−gqaCursor :: Lens' GqlQueryArg (Maybe Word8)
1376−gqaCursor
1377− = lens _gqaCursor (\ s a -> s{_gqaCursor = a}) .
1378− mapping _Coerce
1379−
1380−gqaValue :: Lens' GqlQueryArg (Maybe Value)
1381−gqaValue = lens _gqaValue (\ s a -> s{_gqaValue = a})
1382−
1383−-- | Must match regex \"[A-Za-z_$][A-Za-z_$0-9]*\". Must not match regex
1384−-- \"__.*__\". Must not be \"\".
1385−gqaName :: Lens' GqlQueryArg (Maybe Text)
1386−gqaName = lens _gqaName (\ s a -> s{_gqaName = a})
1387−
1388−instance FromJSON GqlQueryArg where
1389− parseJSON
1390− = withObject "GqlQueryArg"
1391− (\ o ->
1392− GqlQueryArg' <$>
1393− (o .:? "cursor") <*> (o .:? "value") <*>
1394− (o .:? "name"))
1395−
1396−instance ToJSON GqlQueryArg where
1397− toJSON GqlQueryArg'{..}
1398− = object
1399− (catMaybes
1400− [("cursor" .=) <$> _gqaCursor,
1401− ("value" .=) <$> _gqaValue,
1402− ("name" .=) <$> _gqaName])
1403−
1404−-- | A unique identifier for an entity.
1121+-- | A unique identifier for an entity. If a key\'s partition ID or any of
1122+-- its path kinds or names are reserved\/read-only, the key is
1123+-- reserved\/read-only. A reserved\/read-only key is forbidden in certain
1124+-- documented contexts.
14051125--
14061126-- /See:/ 'key' smart constructor.
14071127data Key = Key'
14081128 { _kPartitionId :: !(Maybe PartitionId)
1409− , _kPath :: !(Maybe [KeyPathElement])
1129+ , _kPath :: !(Maybe [PathElement])
14101130 } deriving (Eq,Show,Data,Typeable,Generic)
14111131
14121132-- | Creates a value of 'Key' with the minimum fields required to make a request.
@@ -1424,25 +1144,26 @@ key =
14241144 , _kPath = Nothing
14251145 }
14261146
1427−-- | Entities are partitioned into subsets, currently identified by a dataset
1428−-- (usually implicitly specified by the project) and namespace ID. Queries
1429−-- are scoped to a single partition.
1147+-- | Entities are partitioned into subsets, currently identified by a project
1148+-- ID and namespace ID. Queries are scoped to a single partition.
14301149kPartitionId :: Lens' Key (Maybe PartitionId)
14311150kPartitionId
14321151 = lens _kPartitionId (\ s a -> s{_kPartitionId = a})
14331152
14341153-- | The entity path. An entity path consists of one or more elements
14351154-- composed of a kind and a string or numerical identifier, which identify
1436−-- entities. The first element identifies a root entity, the second element
1437−-- identifies a child of the root entity, the third element a child of the
1438−-- second entity, and so forth. The entities identified by all prefixes of
1439−-- the path are called the element\'s ancestors. An entity path is always
1440−-- fully complete: ALL of the entity\'s ancestors are required to be in the
1441−-- path along with the entity identifier itself. The only exception is that
1442−-- in some documented cases, the identifier in the last path element (for
1443−-- the entity) itself may be omitted. A path can never be empty. The path
1444−-- can have at most 100 elements.
1445−kPath :: Lens' Key [KeyPathElement]
1155+-- entities. The first element identifies a _root entity_, the second
1156+-- element identifies a _child_ of the root entity, the third element
1157+-- identifies a child of the second entity, and so forth. The entities
1158+-- identified by all prefixes of the path are called the element\'s
1159+-- _ancestors_. An entity path is always fully complete: *all* of the
1160+-- entity\'s ancestors are required to be in the path along with the entity
1161+-- identifier itself. The only exception is that in some documented cases,
1162+-- the identifier in the last path element (for the entity) itself may be
1163+-- omitted. For example, the last path element of the key of
1164+-- \`Mutation.insert\` may have no identifier. A path can never be empty,
1165+-- and a path can have at most 100 elements.
1166+kPath :: Lens' Key [PathElement]
14461167kPath
14471168 = lens _kPath (\ s a -> s{_kPath = a}) . _Default .
14481169 _Coerce
@@ -1466,7 +1187,7 @@ instance ToJSON Key where
14661187-- /See:/ 'propertyFilter' smart constructor.
14671188data PropertyFilter = PropertyFilter'
14681189 { _pfProperty :: !(Maybe PropertyReference)
1469− , _pfOperator :: !(Maybe PropertyFilterOperator)
1190+ , _pfOp :: !(Maybe PropertyFilterOp)
14701191 , _pfValue :: !(Maybe Value)
14711192 } deriving (Eq,Show,Data,Typeable,Generic)
14721193
@@ -1476,7 +1197,7 @@ data PropertyFilter = PropertyFilter'
14761197--
14771198-- * 'pfProperty'
14781199--
1479−-- * 'pfOperator'
1200+-- * 'pfOp'
14801201--
14811202-- * 'pfValue'
14821203propertyFilter
@@ -1484,7 +1205,7 @@ propertyFilter
14841205propertyFilter =
14851206 PropertyFilter'
14861207 { _pfProperty = Nothing
1487− , _pfOperator = Nothing
1208+ , _pfOp = Nothing
14881209 , _pfValue = Nothing
14891210 }
14901211
@@ -1493,11 +1214,9 @@ pfProperty :: Lens' PropertyFilter (Maybe PropertyReference)
14931214pfProperty
14941215 = lens _pfProperty (\ s a -> s{_pfProperty = a})
14951216
1496−-- | The operator to filter by. One of lessThan, lessThanOrEqual,
1497−-- greaterThan, greaterThanOrEqual, equal, or hasAncestor.
1498−pfOperator :: Lens' PropertyFilter (Maybe PropertyFilterOperator)
1499−pfOperator
1500− = lens _pfOperator (\ s a -> s{_pfOperator = a})
1217+-- | The operator to filter by.
1218+pfOp :: Lens' PropertyFilter (Maybe PropertyFilterOp)
1219+pfOp = lens _pfOp (\ s a -> s{_pfOp = a})
15011220
15021221-- | The value to compare the property to.
15031222pfValue :: Lens' PropertyFilter (Maybe Value)
@@ -1508,7 +1227,7 @@ instance FromJSON PropertyFilter where
15081227 = withObject "PropertyFilter"
15091228 (\ o ->
15101229 PropertyFilter' <$>
1511− (o .:? "property") <*> (o .:? "operator") <*>
1230+ (o .:? "property") <*> (o .:? "op") <*>
15121231 (o .:? "value"))
15131232
15141233instance ToJSON PropertyFilter where
@@ -1516,21 +1235,20 @@ instance ToJSON PropertyFilter where
15161235 = object
15171236 (catMaybes
15181237 [("property" .=) <$> _pfProperty,
1519− ("operator" .=) <$> _pfOperator,
1520− ("value" .=) <$> _pfValue])
1238+ ("op" .=) <$> _pfOp, ("value" .=) <$> _pfValue])
15211239
1522−-- | A query.
1240+-- | A query for entities.
15231241--
15241242-- /See:/ 'query' smart constructor.
15251243data Query = Query'
1526− { _qGroupBy :: !(Maybe [PropertyReference])
1527− , _qStartCursor :: !(Maybe (Textual Word8))
1244+ { _qStartCursor :: !(Maybe (Textual Word8))
15281245 , _qOffSet :: !(Maybe (Textual Int32))
1246+ , _qKind :: !(Maybe [KindExpression])
1247+ , _qDistinctOn :: !(Maybe [PropertyReference])
15291248 , _qEndCursor :: !(Maybe (Textual Word8))
15301249 , _qLimit :: !(Maybe (Textual Int32))
1531− , _qProjection :: !(Maybe [PropertyExpression])
1250+ , _qProjection :: !(Maybe [Projection])
15321251 , _qFilter :: !(Maybe Filter)
1533− , _qKinds :: !(Maybe [KindExpression])
15341252 , _qOrder :: !(Maybe [PropertyOrder])
15351253 } deriving (Eq,Show,Data,Typeable,Generic)
15361254
@@ -1538,12 +1256,14 @@ data Query = Query'
15381256--
15391257-- Use one of the following lenses to modify other fields as desired:
15401258--
1541−-- * 'qGroupBy'
1542−--
15431259-- * 'qStartCursor'
15441260--
15451261-- * 'qOffSet'
15461262--
1263+-- * 'qKind'
1264+--
1265+-- * 'qDistinctOn'
1266+--
15471267-- * 'qEndCursor'
15481268--
15491269-- * 'qLimit'
@@ -1552,77 +1272,78 @@ data Query = Query'
15521272--
15531273-- * 'qFilter'
15541274--
1555−-- * 'qKinds'
1556−--
15571275-- * 'qOrder'
15581276query
15591277 :: Query
15601278query =
15611279 Query'
1562− { _qGroupBy = Nothing
1563− , _qStartCursor = Nothing
1280+ { _qStartCursor = Nothing
15641281 , _qOffSet = Nothing
1282+ , _qKind = Nothing
1283+ , _qDistinctOn = Nothing
15651284 , _qEndCursor = Nothing
15661285 , _qLimit = Nothing
15671286 , _qProjection = Nothing
15681287 , _qFilter = Nothing
1569− , _qKinds = Nothing
15701288 , _qOrder = Nothing
15711289 }
15721290
1573−-- | The properties to group by (if empty, no grouping is applied to the
1574−-- result set).
1575−qGroupBy :: Lens' Query [PropertyReference]
1576−qGroupBy
1577− = lens _qGroupBy (\ s a -> s{_qGroupBy = a}) .
1578− _Default
1579− . _Coerce
1580−
1581−-- | A starting point for the query results. Optional. Query cursors are
1582−-- returned in query result batches.
1291+-- | A starting point for the query results. Query cursors are returned in
1292+-- query result batches.
15831293qStartCursor :: Lens' Query (Maybe Word8)
15841294qStartCursor
15851295 = lens _qStartCursor (\ s a -> s{_qStartCursor = a})
15861296 . mapping _Coerce
15871297
15881298-- | The number of results to skip. Applies before limit, but after all other
1589−-- constraints (optional, defaults to 0).
1299+-- constraints. Optional. Must be >= 0 if specified.
15901300qOffSet :: Lens' Query (Maybe Int32)
15911301qOffSet
15921302 = lens _qOffSet (\ s a -> s{_qOffSet = a}) .
15931303 mapping _Coerce
15941304
1595−-- | An ending point for the query results. Optional. Query cursors are
1596−-- returned in query result batches.
1305+-- | The kinds to query (if empty, returns entities of all kinds). Currently
1306+-- at most 1 kind may be specified.
1307+qKind :: Lens' Query [KindExpression]
1308+qKind
1309+ = lens _qKind (\ s a -> s{_qKind = a}) . _Default .
1310+ _Coerce
1311+
1312+-- | The properties to make distinct. The query results will contain the
1313+-- first result for each distinct combination of values for the given
1314+-- properties (if empty, all results are returned).
1315+qDistinctOn :: Lens' Query [PropertyReference]
1316+qDistinctOn
1317+ = lens _qDistinctOn (\ s a -> s{_qDistinctOn = a}) .
1318+ _Default
1319+ . _Coerce
1320+
1321+-- | An ending point for the query results. Query cursors are returned in
1322+-- query result batches.
15971323qEndCursor :: Lens' Query (Maybe Word8)
15981324qEndCursor
15991325 = lens _qEndCursor (\ s a -> s{_qEndCursor = a}) .
16001326 mapping _Coerce
16011327
16021328-- | The maximum number of results to return. Applies after all other
1603−-- constraints. Optional.
1329+-- constraints. Optional. Unspecified is interpreted as no limit. Must be
1330+-- >= 0 if specified.
16041331qLimit :: Lens' Query (Maybe Int32)
16051332qLimit
16061333 = lens _qLimit (\ s a -> s{_qLimit = a}) .
16071334 mapping _Coerce
16081335
1609−-- | The projection to return. If not set the entire entity is returned.
1610−qProjection :: Lens' Query [PropertyExpression]
1336+-- | The projection to return. Defaults to returning all properties.
1337+qProjection :: Lens' Query [Projection]
16111338qProjection
16121339 = lens _qProjection (\ s a -> s{_qProjection = a}) .
16131340 _Default
16141341 . _Coerce
16151342
1616−-- | The filter to apply (optional).
1343+-- | The filter to apply.
16171344qFilter :: Lens' Query (Maybe Filter)
16181345qFilter = lens _qFilter (\ s a -> s{_qFilter = a})
16191346
1620−-- | The kinds to query (if empty, returns entities from all kinds).
1621−qKinds :: Lens' Query [KindExpression]
1622−qKinds
1623− = lens _qKinds (\ s a -> s{_qKinds = a}) . _Default .
1624− _Coerce
1625−
16261347-- | The order to apply to the query results (if empty, order is
16271348-- unspecified).
16281349qOrder :: Lens' Query [PropertyOrder]
@@ -1635,48 +1356,94 @@ instance FromJSON Query where
16351356 = withObject "Query"
16361357 (\ o ->
16371358 Query' <$>
1638− (o .:? "groupBy" .!= mempty) <*>
1639− (o .:? "startCursor")
1640− <*> (o .:? "offset")
1359+ (o .:? "startCursor") <*> (o .:? "offset") <*>
1360+ (o .:? "kind" .!= mempty)
1361+ <*> (o .:? "distinctOn" .!= mempty)
16411362 <*> (o .:? "endCursor")
16421363 <*> (o .:? "limit")
16431364 <*> (o .:? "projection" .!= mempty)
16441365 <*> (o .:? "filter")
1645− <*> (o .:? "kinds" .!= mempty)
16461366 <*> (o .:? "order" .!= mempty))
16471367
16481368instance ToJSON Query where
16491369 toJSON Query'{..}
16501370 = object
16511371 (catMaybes
1652− [("groupBy" .=) <$> _qGroupBy,
1653− ("startCursor" .=) <$> _qStartCursor,
1654− ("offset" .=) <$> _qOffSet,
1372+ [("startCursor" .=) <$> _qStartCursor,
1373+ ("offset" .=) <$> _qOffSet, ("kind" .=) <$> _qKind,
1374+ ("distinctOn" .=) <$> _qDistinctOn,
16551375 ("endCursor" .=) <$> _qEndCursor,
16561376 ("limit" .=) <$> _qLimit,
16571377 ("projection" .=) <$> _qProjection,
1658− ("filter" .=) <$> _qFilter, ("kinds" .=) <$> _qKinds,
1378+ ("filter" .=) <$> _qFilter,
16591379 ("order" .=) <$> _qOrder])
16601380
1661−-- | The result of fetching an entity from the datastore.
1381+-- | An array value.
1382+--
1383+-- /See:/ 'arrayValue' smart constructor.
1384+newtype ArrayValue = ArrayValue'
1385+ { _avValues :: Maybe [Value]
1386+ } deriving (Eq,Show,Data,Typeable,Generic)
1387+
1388+-- | Creates a value of 'ArrayValue' with the minimum fields required to make a request.
1389+--
1390+-- Use one of the following lenses to modify other fields as desired:
1391+--
1392+-- * 'avValues'
1393+arrayValue
1394+ :: ArrayValue
1395+arrayValue =
1396+ ArrayValue'
1397+ { _avValues = Nothing
1398+ }
1399+
1400+-- | Values in the array. The order of this array may not be preserved if it
1401+-- contains a mix of indexed and unindexed values.
1402+avValues :: Lens' ArrayValue [Value]
1403+avValues
1404+ = lens _avValues (\ s a -> s{_avValues = a}) .
1405+ _Default
1406+ . _Coerce
1407+
1408+instance FromJSON ArrayValue where
1409+ parseJSON
1410+ = withObject "ArrayValue"
1411+ (\ o -> ArrayValue' <$> (o .:? "values" .!= mempty))
1412+
1413+instance ToJSON ArrayValue where
1414+ toJSON ArrayValue'{..}
1415+ = object (catMaybes [("values" .=) <$> _avValues])
1416+
1417+-- | The result of fetching an entity from Datastore.
16621418--
16631419-- /See:/ 'entityResult' smart constructor.
1664−newtype EntityResult = EntityResult'
1665− { _erEntity :: Maybe Entity
1420+data EntityResult = EntityResult'
1421+ { _erCursor :: !(Maybe (Textual Word8))
1422+ , _erEntity :: !(Maybe Entity)
16661423 } deriving (Eq,Show,Data,Typeable,Generic)
16671424
16681425-- | Creates a value of 'EntityResult' with the minimum fields required to make a request.
16691426--
16701427-- Use one of the following lenses to modify other fields as desired:
16711428--
1429+-- * 'erCursor'
1430+--
16721431-- * 'erEntity'
16731432entityResult
16741433 :: EntityResult
16751434entityResult =
16761435 EntityResult'
1677− { _erEntity = Nothing
1436+ { _erCursor = Nothing
1437+ , _erEntity = Nothing
16781438 }
16791439
1440+-- | A cursor that points to the position after the result entity. Set only
1441+-- when the \`EntityResult\` is part of a \`QueryResultBatch\` message.
1442+erCursor :: Lens' EntityResult (Maybe Word8)
1443+erCursor
1444+ = lens _erCursor (\ s a -> s{_erCursor = a}) .
1445+ mapping _Coerce
1446+
16801447-- | The resulting entity.
16811448erEntity :: Lens' EntityResult (Maybe Entity)
16821449erEntity = lens _erEntity (\ s a -> s{_erEntity = a})
@@ -1684,56 +1451,71 @@ erEntity = lens _erEntity (\ s a -> s{_erEntity = a})
16841451instance FromJSON EntityResult where
16851452 parseJSON
16861453 = withObject "EntityResult"
1687− (\ o -> EntityResult' <$> (o .:? "entity"))
1454+ (\ o ->
1455+ EntityResult' <$>
1456+ (o .:? "cursor") <*> (o .:? "entity"))
16881457
16891458instance ToJSON EntityResult where
16901459 toJSON EntityResult'{..}
1691− = object (catMaybes [("entity" .=) <$> _erEntity])
1460+ = object
1461+ (catMaybes
1462+ [("cursor" .=) <$> _erCursor,
1463+ ("entity" .=) <$> _erEntity])
16921464
1465+-- | The response for google.datastore.v1beta3.Datastore.Commit.
16931466--
16941467-- /See:/ 'commitResponse' smart constructor.
16951468data CommitResponse = CommitResponse'
1696− { _crMutationResult :: !(Maybe MutationResult)
1697− , _crHeader :: !(Maybe ResponseHeader)
1469+ { _crIndexUpdates :: !(Maybe (Textual Int32))
1470+ , _crMutationResults :: !(Maybe [MutationResult])
16981471 } deriving (Eq,Show,Data,Typeable,Generic)
16991472
17001473-- | Creates a value of 'CommitResponse' with the minimum fields required to make a request.
17011474--
17021475-- Use one of the following lenses to modify other fields as desired:
17031476--
1704−-- * 'crMutationResult'
1477+-- * 'crIndexUpdates'
17051478--
1706−-- * 'crHeader'
1479+-- * 'crMutationResults'
17071480commitResponse
17081481 :: CommitResponse
17091482commitResponse =
17101483 CommitResponse'
1711− { _crMutationResult = Nothing
1712− , _crHeader = Nothing
1484+ { _crIndexUpdates = Nothing
1485+ , _crMutationResults = Nothing
17131486 }
17141487
1715−-- | The result of performing the mutation (if any).
1716−crMutationResult :: Lens' CommitResponse (Maybe MutationResult)
1717−crMutationResult
1718− = lens _crMutationResult
1719− (\ s a -> s{_crMutationResult = a})
1488+-- | The number of index entries updated during the commit, or zero if none
1489+-- were updated.
1490+crIndexUpdates :: Lens' CommitResponse (Maybe Int32)
1491+crIndexUpdates
1492+ = lens _crIndexUpdates
1493+ (\ s a -> s{_crIndexUpdates = a})
1494+ . mapping _Coerce
17201495
1721−crHeader :: Lens' CommitResponse (Maybe ResponseHeader)
1722−crHeader = lens _crHeader (\ s a -> s{_crHeader = a})
1496+-- | The result of performing the mutations. The i-th mutation result
1497+-- corresponds to the i-th mutation in the request.
1498+crMutationResults :: Lens' CommitResponse [MutationResult]
1499+crMutationResults
1500+ = lens _crMutationResults
1501+ (\ s a -> s{_crMutationResults = a})
1502+ . _Default
1503+ . _Coerce
17231504
17241505instance FromJSON CommitResponse where
17251506 parseJSON
17261507 = withObject "CommitResponse"
17271508 (\ o ->
17281509 CommitResponse' <$>
1729− (o .:? "mutationResult") <*> (o .:? "header"))
1510+ (o .:? "indexUpdates") <*>
1511+ (o .:? "mutationResults" .!= mempty))
17301512
17311513instance ToJSON CommitResponse where
17321514 toJSON CommitResponse'{..}
17331515 = object
17341516 (catMaybes
1735− [("mutationResult" .=) <$> _crMutationResult,
1736− ("header" .=) <$> _crHeader])
1517+ [("indexUpdates" .=) <$> _crIndexUpdates,
1518+ ("mutationResults" .=) <$> _crMutationResults])
17371519
17381520-- | A representation of a kind.
17391521--
@@ -1767,6 +1549,7 @@ instance ToJSON KindExpression where
17671549 toJSON KindExpression'{..}
17681550 = object (catMaybes [("name" .=) <$> _keName])
17691551
1552+-- | The options shared by read requests.
17701553--
17711554-- /See:/ 'readOptions' smart constructor.
17721555data ReadOptions = ReadOptions'
@@ -1789,16 +1572,14 @@ readOptions =
17891572 , _roTransaction = Nothing
17901573 }
17911574
1792−-- | The read consistency to use. One of default, strong, or eventual. Cannot
1793−-- be set when transaction is set. Lookup and ancestor queries default to
1794−-- strong, global queries default to eventual and cannot be set to strong.
1795−-- Optional. Default is default.
1575+-- | The non-transactional read consistency to use. Cannot be set to
1576+-- \`STRONG\` for global queries.
17961577roReadConsistency :: Lens' ReadOptions (Maybe ReadOptionsReadConsistency)
17971578roReadConsistency
17981579 = lens _roReadConsistency
17991580 (\ s a -> s{_roReadConsistency = a})
18001581
1801−-- | The transaction to use. Optional.
1582+-- | The transaction in which to read.
18021583roTransaction :: Lens' ReadOptions (Maybe Word8)
18031584roTransaction
18041585 = lens _roTransaction
@@ -1819,90 +1600,62 @@ instance ToJSON ReadOptions where
18191600 [("readConsistency" .=) <$> _roReadConsistency,
18201601 ("transaction" .=) <$> _roTransaction])
18211602
1603+-- | The response for google.datastore.v1beta3.Datastore.Rollback (an empty
1604+-- message).
18221605--
18231606-- /See:/ 'rollbackResponse' smart constructor.
1824−newtype RollbackResponse = RollbackResponse'
1825− { _rrHeader :: Maybe ResponseHeader
1826− } deriving (Eq,Show,Data,Typeable,Generic)
1607+data RollbackResponse =
1608+ RollbackResponse'
1609+ deriving (Eq,Show,Data,Typeable,Generic)
18271610
18281611-- | Creates a value of 'RollbackResponse' with the minimum fields required to make a request.
18291612--
1830−-- Use one of the following lenses to modify other fields as desired:
1831−--
1832−-- * 'rrHeader'
18331613rollbackResponse
18341614 :: RollbackResponse
1835−rollbackResponse =
1836− RollbackResponse'
1837− { _rrHeader = Nothing
1838− }
1839−
1840−rrHeader :: Lens' RollbackResponse (Maybe ResponseHeader)
1841−rrHeader = lens _rrHeader (\ s a -> s{_rrHeader = a})
1615+rollbackResponse = RollbackResponse'
18421616
18431617instance FromJSON RollbackResponse where
18441618 parseJSON
18451619 = withObject "RollbackResponse"
1846− (\ o -> RollbackResponse' <$> (o .:? "header"))
1620+ (\ o -> pure RollbackResponse')
18471621
18481622instance ToJSON RollbackResponse where
1849− toJSON RollbackResponse'{..}
1850− = object (catMaybes [("header" .=) <$> _rrHeader])
1623+ toJSON = const emptyObject
18511624
18521625-- | A representation of a property in a projection.
18531626--
1854−-- /See:/ 'propertyExpression' smart constructor.
1855−data PropertyExpression = PropertyExpression'
1856− { _peProperty :: !(Maybe PropertyReference)
1857− , _peAggregationFunction :: !(Maybe PropertyExpressionAggregationFunction)
1627+-- /See:/ 'projection' smart constructor.
1628+newtype Projection = Projection'
1629+ { _pProperty :: Maybe PropertyReference
18581630 } deriving (Eq,Show,Data,Typeable,Generic)
18591631
1860−-- | Creates a value of 'PropertyExpression' with the minimum fields required to make a request.
1632+-- | Creates a value of 'Projection' with the minimum fields required to make a request.
18611633--
18621634-- Use one of the following lenses to modify other fields as desired:
18631635--
1864−-- * 'peProperty'
1865−--
1866−-- * 'peAggregationFunction'
1867−propertyExpression
1868− :: PropertyExpression
1869−propertyExpression =
1870− PropertyExpression'
1871− { _peProperty = Nothing
1872− , _peAggregationFunction = Nothing
1636+-- * 'pProperty'
1637+projection
1638+ :: Projection
1639+projection =
1640+ Projection'
1641+ { _pProperty = Nothing
18731642 }
18741643
18751644-- | The property to project.
1876−peProperty :: Lens' PropertyExpression (Maybe PropertyReference)
1877−peProperty
1878− = lens _peProperty (\ s a -> s{_peProperty = a})
1879−
1880−-- | The aggregation function to apply to the property. Optional. Can only be
1881−-- used when grouping by at least one property. Must then be set on all
1882−-- properties in the projection that are not being grouped by. Aggregation
1883−-- functions: first selects the first result as determined by the query\'s
1884−-- order.
1885−peAggregationFunction :: Lens' PropertyExpression (Maybe PropertyExpressionAggregationFunction)
1886−peAggregationFunction
1887− = lens _peAggregationFunction
1888− (\ s a -> s{_peAggregationFunction = a})
1889−
1890−instance FromJSON PropertyExpression where
1645+pProperty :: Lens' Projection (Maybe PropertyReference)
1646+pProperty
1647+ = lens _pProperty (\ s a -> s{_pProperty = a})
1648+
1649+instance FromJSON Projection where
18911650 parseJSON
1892− = withObject "PropertyExpression"
1893− (\ o ->
1894− PropertyExpression' <$>
1895− (o .:? "property") <*> (o .:? "aggregationFunction"))
1651+ = withObject "Projection"
1652+ (\ o -> Projection' <$> (o .:? "property"))
18961653
1897−instance ToJSON PropertyExpression where
1898− toJSON PropertyExpression'{..}
1899− = object
1900− (catMaybes
1901− [("property" .=) <$> _peProperty,
1902− ("aggregationFunction" .=) <$>
1903− _peAggregationFunction])
1654+instance ToJSON Projection where
1655+ toJSON Projection'{..}
1656+ = object (catMaybes [("property" .=) <$> _pProperty])
19041657
1905−-- | A holder for any type of filter. Exactly one field should be specified.
1658+-- | A holder for any type of filter.
19061659--
19071660-- /See:/ 'filter'' smart constructor.
19081661data Filter = Filter'
@@ -1952,78 +1705,139 @@ instance ToJSON Filter where
19521705 [("compositeFilter" .=) <$> _fCompositeFilter,
19531706 ("propertyFilter" .=) <$> _fPropertyFilter])
19541707
1708+-- | The request for google.datastore.v1beta3.Datastore.Commit.
19551709--
19561710-- /See:/ 'commitRequest' smart constructor.
19571711data CommitRequest = CommitRequest'
1958− { _crMode :: !(Maybe CommitRequestMode)
1959− , _crMutation :: !(Maybe Mutation)
1960− , _crTransaction :: !(Maybe (Textual Word8))
1961− , _crIgnoreReadOnly :: !(Maybe Bool)
1712+ { _crMutations :: !(Maybe [Mutation])
1713+ , _crMode :: !(Maybe CommitRequestMode)
1714+ , _crTransaction :: !(Maybe (Textual Word8))
19621715 } deriving (Eq,Show,Data,Typeable,Generic)
19631716
19641717-- | Creates a value of 'CommitRequest' with the minimum fields required to make a request.
19651718--
19661719-- Use one of the following lenses to modify other fields as desired:
19671720--
1968−-- * 'crMode'
1721+-- * 'crMutations'
19691722--
1970−-- * 'crMutation'
1723+-- * 'crMode'
19711724--
19721725-- * 'crTransaction'
1973−--
1974−-- * 'crIgnoreReadOnly'
19751726commitRequest
19761727 :: CommitRequest
19771728commitRequest =
19781729 CommitRequest'
1979− { _crMode = Nothing
1980− , _crMutation = Nothing
1730+ { _crMutations = Nothing
1731+ , _crMode = Nothing
19811732 , _crTransaction = Nothing
1982− , _crIgnoreReadOnly = Nothing
19831733 }
19841734
1985−-- | The type of commit to perform. Either TRANSACTIONAL or
1986−-- NON_TRANSACTIONAL.
1735+-- | The mutations to perform. When mode is \`TRANSACTIONAL\`, mutations
1736+-- affecting a single entity are applied in order. The following sequences
1737+-- of mutations affecting a single entity are not permitted in a single
1738+-- \`Commit\` request: - \`insert\` followed by \`insert\` - \`update\`
1739+-- followed by \`insert\` - \`upsert\` followed by \`insert\` - \`delete\`
1740+-- followed by \`update\` When mode is \`NON_TRANSACTIONAL\`, no two
1741+-- mutations may affect a single entity.
1742+crMutations :: Lens' CommitRequest [Mutation]
1743+crMutations
1744+ = lens _crMutations (\ s a -> s{_crMutations = a}) .
1745+ _Default
1746+ . _Coerce
1747+
1748+-- | The type of commit to perform. Defaults to \`TRANSACTIONAL\`.
19871749crMode :: Lens' CommitRequest (Maybe CommitRequestMode)
19881750crMode = lens _crMode (\ s a -> s{_crMode = a})
19891751
1990−-- | The mutation to perform. Optional.
1991−crMutation :: Lens' CommitRequest (Maybe Mutation)
1992−crMutation
1993− = lens _crMutation (\ s a -> s{_crMutation = a})
1994−
1995−-- | The transaction identifier, returned by a call to beginTransaction. Must
1996−-- be set when mode is TRANSACTIONAL.
1752+-- | The identifier of the transaction associated with the commit. A
1753+-- transaction identifier is returned by a call to BeginTransaction.
19971754crTransaction :: Lens' CommitRequest (Maybe Word8)
19981755crTransaction
19991756 = lens _crTransaction
20001757 (\ s a -> s{_crTransaction = a})
20011758 . mapping _Coerce
20021759
2003−crIgnoreReadOnly :: Lens' CommitRequest (Maybe Bool)
2004−crIgnoreReadOnly
2005− = lens _crIgnoreReadOnly
2006− (\ s a -> s{_crIgnoreReadOnly = a})
2007−
20081760instance FromJSON CommitRequest where
20091761 parseJSON
20101762 = withObject "CommitRequest"
20111763 (\ o ->
20121764 CommitRequest' <$>
2013− (o .:? "mode") <*> (o .:? "mutation") <*>
2014− (o .:? "transaction")
2015− <*> (o .:? "ignoreReadOnly"))
1765+ (o .:? "mutations" .!= mempty) <*> (o .:? "mode") <*>
1766+ (o .:? "transaction"))
20161767
20171768instance ToJSON CommitRequest where
20181769 toJSON CommitRequest'{..}
20191770 = object
20201771 (catMaybes
2021− [("mode" .=) <$> _crMode,
2022− ("mutation" .=) <$> _crMutation,
2023− ("transaction" .=) <$> _crTransaction,
2024− ("ignoreReadOnly" .=) <$> _crIgnoreReadOnly])
1772+ [("mutations" .=) <$> _crMutations,
1773+ ("mode" .=) <$> _crMode,
1774+ ("transaction" .=) <$> _crTransaction])
1775+
1776+-- | A (kind, ID\/name) pair used to construct a key path. If either name or
1777+-- ID is set, the element is complete. If neither is set, the element is
1778+-- incomplete.
1779+--
1780+-- /See:/ 'pathElement' smart constructor.
1781+data PathElement = PathElement'
1782+ { _peKind :: !(Maybe Text)
1783+ , _peName :: !(Maybe Text)
1784+ , _peId :: !(Maybe (Textual Int64))
1785+ } deriving (Eq,Show,Data,Typeable,Generic)
20251786
2026−-- | An entity.
1787+-- | Creates a value of 'PathElement' with the minimum fields required to make a request.
1788+--
1789+-- Use one of the following lenses to modify other fields as desired:
1790+--
1791+-- * 'peKind'
1792+--
1793+-- * 'peName'
1794+--
1795+-- * 'peId'
1796+pathElement
1797+ :: PathElement
1798+pathElement =
1799+ PathElement'
1800+ { _peKind = Nothing
1801+ , _peName = Nothing
1802+ , _peId = Nothing
1803+ }
1804+
1805+-- | The kind of the entity. A kind matching regex \`__.*__\` is
1806+-- reserved\/read-only. A kind must not contain more than 1500 bytes when
1807+-- UTF-8 encoded. Cannot be \`\"\"\`.
1808+peKind :: Lens' PathElement (Maybe Text)
1809+peKind = lens _peKind (\ s a -> s{_peKind = a})
1810+
1811+-- | The name of the entity. A name matching regex \`__.*__\` is
1812+-- reserved\/read-only. A name must not be more than 1500 bytes when UTF-8
1813+-- encoded. Cannot be \`\"\"\`.
1814+peName :: Lens' PathElement (Maybe Text)
1815+peName = lens _peName (\ s a -> s{_peName = a})
1816+
1817+-- | The auto-allocated ID of the entity. Never equal to zero. Values less
1818+-- than zero are discouraged and may not be supported in the future.
1819+peId :: Lens' PathElement (Maybe Int64)
1820+peId
1821+ = lens _peId (\ s a -> s{_peId = a}) .
1822+ mapping _Coerce
1823+
1824+instance FromJSON PathElement where
1825+ parseJSON
1826+ = withObject "PathElement"
1827+ (\ o ->
1828+ PathElement' <$>
1829+ (o .:? "kind") <*> (o .:? "name") <*> (o .:? "id"))
1830+
1831+instance ToJSON PathElement where
1832+ toJSON PathElement'{..}
1833+ = object
1834+ (catMaybes
1835+ [("kind" .=) <$> _peKind, ("name" .=) <$> _peName,
1836+ ("id" .=) <$> _peId])
1837+
1838+-- | A Datastore data object. An entity is limited to 1 megabyte when stored.
1839+-- That _roughly_ corresponds to a limit of 1 megabyte for the serialized
1840+-- form of this message.
20271841--
20281842-- /See:/ 'entity' smart constructor.
20291843data Entity = Entity'
@@ -2047,13 +1861,16 @@ entity =
20471861 }
20481862
20491863-- | The entity\'s key. An entity must have a key, unless otherwise
2050−-- documented (for example, an entity in Value.entityValue may have no
2051−-- key). An entity\'s kind is its key\'s path\'s last element\'s kind, or
2052−-- null if it has no key.
1864+-- documented (for example, an entity in \`Value.entity_value\` may have no
1865+-- key). An entity\'s kind is its key path\'s last element\'s kind, or null
1866+-- if it has no key.
20531867eKey :: Lens' Entity (Maybe Key)
20541868eKey = lens _eKey (\ s a -> s{_eKey = a})
20551869
2056−-- | The entity\'s properties.
1870+-- | The entity\'s properties. The map\'s keys are property names. A property
1871+-- name matching regex \`__.*__\` is reserved. A reserved property name is
1872+-- forbidden in certain documented contexts. The name must not contain more
1873+-- than 500 characters. The name cannot be \`\"\"\`.
20571874eProperties :: Lens' Entity (Maybe EntityProperties)
20581875eProperties
20591876 = lens _eProperties (\ s a -> s{_eProperties = a})
@@ -2071,13 +1888,13 @@ instance ToJSON Entity where
20711888 [("key" .=) <$> _eKey,
20721889 ("properties" .=) <$> _eProperties])
20731890
1891+-- | The response for google.datastore.v1beta3.Datastore.Lookup.
20741892--
20751893-- /See:/ 'lookupResponse' smart constructor.
20761894data LookupResponse = LookupResponse'
20771895 { _lrDeferred :: !(Maybe [Key])
20781896 , _lrFound :: !(Maybe [EntityResult])
20791897 , _lrMissing :: !(Maybe [EntityResult])
2080− , _lrHeader :: !(Maybe ResponseHeader)
20811898 } deriving (Eq,Show,Data,Typeable,Generic)
20821899
20831900-- | Creates a value of 'LookupResponse' with the minimum fields required to make a request.
@@ -2089,8 +1906,6 @@ data LookupResponse = LookupResponse'
20891906-- * 'lrFound'
20901907--
20911908-- * 'lrMissing'
2092−--
2093−-- * 'lrHeader'
20941909lookupResponse
20951910 :: LookupResponse
20961911lookupResponse =
@@ -2098,32 +1913,34 @@ lookupResponse =
20981913 { _lrDeferred = Nothing
20991914 , _lrFound = Nothing
21001915 , _lrMissing = Nothing
2101− , _lrHeader = Nothing
21021916 }
21031917
2104−-- | A list of keys that were not looked up due to resource constraints.
1918+-- | A list of keys that were not looked up due to resource constraints. The
1919+-- order of results in this field is undefined and has no relation to the
1920+-- order of the keys in the input.
21051921lrDeferred :: Lens' LookupResponse [Key]
21061922lrDeferred
21071923 = lens _lrDeferred (\ s a -> s{_lrDeferred = a}) .
21081924 _Default
21091925 . _Coerce
21101926
2111−-- | Entities found.
1927+-- | Entities found as \`ResultType.FULL\` entities. The order of results in
1928+-- this field is undefined and has no relation to the order of the keys in
1929+-- the input.
21121930lrFound :: Lens' LookupResponse [EntityResult]
21131931lrFound
21141932 = lens _lrFound (\ s a -> s{_lrFound = a}) . _Default
21151933 . _Coerce
21161934
2117−-- | Entities not found, with only the key populated.
1935+-- | Entities not found as \`ResultType.KEY_ONLY\` entities. The order of
1936+-- results in this field is undefined and has no relation to the order of
1937+-- the keys in the input.
21181938lrMissing :: Lens' LookupResponse [EntityResult]
21191939lrMissing
21201940 = lens _lrMissing (\ s a -> s{_lrMissing = a}) .
21211941 _Default
21221942 . _Coerce
21231943
2124−lrHeader :: Lens' LookupResponse (Maybe ResponseHeader)
2125−lrHeader = lens _lrHeader (\ s a -> s{_lrHeader = a})
2126−
21271944instance FromJSON LookupResponse where
21281945 parseJSON
21291946 = withObject "LookupResponse"
@@ -2131,8 +1948,7 @@ instance FromJSON LookupResponse where
21311948 LookupResponse' <$>
21321949 (o .:? "deferred" .!= mempty) <*>
21331950 (o .:? "found" .!= mempty)
2134− <*> (o .:? "missing" .!= mempty)
2135− <*> (o .:? "header"))
1951+ <*> (o .:? "missing" .!= mempty))
21361952
21371953instance ToJSON LookupResponse where
21381954 toJSON LookupResponse'{..}
@@ -2140,8 +1956,7 @@ instance ToJSON LookupResponse where
21401956 (catMaybes
21411957 [("deferred" .=) <$> _lrDeferred,
21421958 ("found" .=) <$> _lrFound,
2143− ("missing" .=) <$> _lrMissing,
2144− ("header" .=) <$> _lrHeader])
1959+ ("missing" .=) <$> _lrMissing])
21451960
21461961-- | The desired order for a specific property.
21471962--
@@ -2171,8 +1986,7 @@ poProperty :: Lens' PropertyOrder (Maybe PropertyReference)
21711986poProperty
21721987 = lens _poProperty (\ s a -> s{_poProperty = a})
21731988
2174−-- | The direction to order by. One of ascending or descending. Optional,
2175−-- defaults to ascending.
1989+-- | The direction to order by. Defaults to \`ASCENDING\`.
21761990poDirection :: Lens' PropertyOrder (Maybe PropertyOrderDirection)
21771991poDirection
21781992 = lens _poDirection (\ s a -> s{_poDirection = a})
@@ -2190,3 +2004,50 @@ instance ToJSON PropertyOrder where
21902004 (catMaybes
21912005 [("property" .=) <$> _poProperty,
21922006 ("direction" .=) <$> _poDirection])
2007+
2008+-- | A binding parameter for a GQL query.
2009+--
2010+-- /See:/ 'gqlQueryParameter' smart constructor.
2011+data GqlQueryParameter = GqlQueryParameter'
2012+ { _gqpCursor :: !(Maybe (Textual Word8))
2013+ , _gqpValue :: !(Maybe Value)
2014+ } deriving (Eq,Show,Data,Typeable,Generic)
2015+
2016+-- | Creates a value of 'GqlQueryParameter' with the minimum fields required to make a request.
2017+--
2018+-- Use one of the following lenses to modify other fields as desired:
2019+--
2020+-- * 'gqpCursor'
2021+--
2022+-- * 'gqpValue'
2023+gqlQueryParameter
2024+ :: GqlQueryParameter
2025+gqlQueryParameter =
2026+ GqlQueryParameter'
2027+ { _gqpCursor = Nothing
2028+ , _gqpValue = Nothing
2029+ }
2030+
2031+-- | A query cursor. Query cursors are returned in query result batches.
2032+gqpCursor :: Lens' GqlQueryParameter (Maybe Word8)
2033+gqpCursor
2034+ = lens _gqpCursor (\ s a -> s{_gqpCursor = a}) .
2035+ mapping _Coerce
2036+
2037+-- | A value parameter.
2038+gqpValue :: Lens' GqlQueryParameter (Maybe Value)
2039+gqpValue = lens _gqpValue (\ s a -> s{_gqpValue = a})
2040+
2041+instance FromJSON GqlQueryParameter where
2042+ parseJSON
2043+ = withObject "GqlQueryParameter"
2044+ (\ o ->
2045+ GqlQueryParameter' <$>
2046+ (o .:? "cursor") <*> (o .:? "value"))
2047+
2048+instance ToJSON GqlQueryParameter where
2049+ toJSON GqlQueryParameter'{..}
2050+ = object
2051+ (catMaybes
2052+ [("cursor" .=) <$> _gqpCursor,
2053+ ("value" .=) <$> _gqpValue])