@@ -20,6 +20,80 @@ module Network.Google.Datastore.Types.Product where
20import Network.Google.Datastore.Types.Sum
20import Network.Google.Datastore.Types.Sum
21import Network.Google.Prelude
21import Network.Google.Prelude
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)
49+-- /See:/ 'latLng' smart constructor.
51+ { _llLatitude :: !(Maybe (Textual Double))
52+ , _llLongitude :: !(Maybe (Textual Double))
53+ } deriving (Eq,Show,Data,Typeable,Generic)
55+-- | Creates a value of 'LatLng' with the minimum fields required to make a request.
57+-- Use one of the following lenses to modify other fields as desired:
66+ { _llLatitude = Nothing
67+ , _llLongitude = Nothing
70+-- | The latitude in degrees. It must be in the range [-90.0, +90.0].
71+llLatitude :: Lens' LatLng (Maybe Double)
73+ = lens _llLatitude (\ s a -> s{_llLatitude = a}) .
76+-- | The longitude in degrees. It must be in the range [-180.0, +180.0].
77+llLongitude :: Lens' LatLng (Maybe Double)
79+ = lens _llLongitude (\ s a -> s{_llLongitude = a}) .
82+instance FromJSON LatLng where
84+ = withObject "LatLng"
87+ (o .:? "latitude") <*> (o .:? "longitude"))
89+instance ToJSON LatLng where
93+ [("latitude" .=) <$> _llLatitude,
94+ ("longitude" .=) <$> _llLongitude])
96+-- | The request for google.datastore.v1beta3.Datastore.Rollback.
24-- /See:/ 'rollbackRequest' smart constructor.
98-- /See:/ 'rollbackRequest' smart constructor.
25newtype RollbackRequest = RollbackRequest'
99newtype RollbackRequest = RollbackRequest'
@@ -38,7 +112,8 @@ rollbackRequest =
38 { _rrTransaction = Nothing
112 { _rrTransaction = Nothing
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.
42rrTransaction :: Lens' RollbackRequest (Maybe Word8)
117rrTransaction :: Lens' RollbackRequest (Maybe Word8)
43rrTransaction
118rrTransaction
44 = lens _rrTransaction
119 = lens _rrTransaction
@@ -55,237 +130,70 @@ instance ToJSON RollbackRequest where
56 (catMaybes [("transaction" .=) <$> _rrTransaction])
131 (catMaybes [("transaction" .=) <$> _rrTransaction])
58−-- | An entity property.
133+-- | A partition ID identifies a grouping of entities. The grouping is always
59−--
134+-- by project and namespace, however the namespace ID may be empty. A
60−-- /See:/ 'property' smart constructor.
135+-- partition ID contains several dimensions: project ID and namespace ID.
61−data Property = Property'
136+-- Partition dimensions: - May be \`\"\"\`. - Must be valid UTF-8 bytes. -
62− { _pKeyValue :: !(Maybe Key)
137+-- Must have values that match regex \`[A-Za-z\\d\\.\\-_]{1,100}\` If the
63− , _pBlobKeyValue :: !(Maybe Text)
138+-- value of any dimension matches regex \`__.*__\`, the partition is
64− , _pDateTimeValue :: !(Maybe DateTime')
139+-- reserved\/read-only. A reserved\/read-only partition ID is forbidden in
65− , _pIntegerValue :: !(Maybe (Textual Int64))
140+-- certain documented contexts. Foreign partition IDs (in which the project
66− , _pEntityValue :: !(Maybe Entity)
141+-- ID does not match the context project ID ) are discouraged. Reads and
67− , _pDoubleValue :: !(Maybe (Textual Double))
142+-- writes of foreign partition IDs may fail if the project is not in an
68− , _pStringValue :: !(Maybe Text)
143+-- active state.
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)
76−-- | Creates a value of 'Property' with the minimum fields required to make a request.
78−-- Use one of the following lenses to modify other fields as desired:
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
122−pKeyValue :: Lens' Property (Maybe Key)
124− = lens _pKeyValue (\ s a -> s{_pKeyValue = a})
126−-- | A blob key value.
127−pBlobKeyValue :: Lens' Property (Maybe Text)
129− = lens _pBlobKeyValue
130− (\ s a -> s{_pBlobKeyValue = a})
132−-- | A timestamp value.
133−pDateTimeValue :: Lens' Property (Maybe UTCTime)
135− = lens _pDateTimeValue
136− (\ s a -> s{_pDateTimeValue = a})
139−-- | An integer value.
140−pIntegerValue :: Lens' Property (Maybe Int64)
142− = lens _pIntegerValue
143− (\ s a -> s{_pIntegerValue = a})
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)
150− = lens _pEntityValue (\ s a -> s{_pEntityValue = a})
153−pDoubleValue :: Lens' Property (Maybe Double)
155− = lens _pDoubleValue (\ s a -> s{_pDoubleValue = a})
158−-- | A UTF-8 encoded string value. When indexed is true, may have at most 500
160−pStringValue :: Lens' Property (Maybe Text)
162− = lens _pStringValue (\ s a -> s{_pStringValue = a})
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]
168− = lens _pListValue (\ s a -> s{_pListValue = a}) .
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})
182−-- | A boolean value.
183−pBooleanValue :: Lens' Property (Maybe Bool)
185− = lens _pBooleanValue
186− (\ s a -> s{_pBooleanValue = a})
188−-- | The meaning field is reserved and should not be used.
189−pMeaning :: Lens' Property (Maybe Int32)
191− = lens _pMeaning (\ s a -> s{_pMeaning = a}) .
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)
198− = lens _pBlobValue (\ s a -> s{_pBlobValue = a}) .
201−instance FromJSON Property where
203− = withObject "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"))
218−instance ToJSON Property where
219− toJSON Property'{..}
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])
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.
239-- /See:/ 'partitionId' smart constructor.
145-- /See:/ 'partitionId' smart constructor.
240data PartitionId = PartitionId'
146data PartitionId = PartitionId'
241− { _piNamespace :: !(Maybe Text)
147+ { _piNamespaceId :: !(Maybe Text)
242− , _piDataSetId :: !(Maybe Text)
148+ , _piProjectId :: !(Maybe Text)
243 } deriving (Eq,Show,Data,Typeable,Generic)
149 } deriving (Eq,Show,Data,Typeable,Generic)
245-- | Creates a value of 'PartitionId' with the minimum fields required to make a request.
151-- | Creates a value of 'PartitionId' with the minimum fields required to make a request.
247-- Use one of the following lenses to modify other fields as desired:
153-- Use one of the following lenses to modify other fields as desired:
249−-- * 'piNamespace'
155+-- * 'piNamespaceId'
251−-- * 'piDataSetId'
157+-- * 'piProjectId'
252partitionId
158partitionId
253 :: PartitionId
159 :: PartitionId
254partitionId =
160partitionId =
255 PartitionId'
161 PartitionId'
256− { _piNamespace = Nothing
162+ { _piNamespaceId = Nothing
257− , _piDataSetId = Nothing
163+ , _piProjectId = Nothing
260−-- | The namespace.
166+-- | If not empty, the ID of the namespace to which the entities belong.
261−piNamespace :: Lens' PartitionId (Maybe Text)
167+piNamespaceId :: Lens' PartitionId (Maybe Text)
262−piNamespace
168+piNamespaceId
263− = lens _piNamespace (\ s a -> s{_piNamespace = a})
169+ = lens _piNamespaceId
170+ (\ s a -> s{_piNamespaceId = a})
265−-- | The dataset ID.
172+-- | The ID of the project to which the entities belong.
266−piDataSetId :: Lens' PartitionId (Maybe Text)
173+piProjectId :: Lens' PartitionId (Maybe Text)
267−piDataSetId
174+piProjectId
268− = lens _piDataSetId (\ s a -> s{_piDataSetId = a})
175+ = lens _piProjectId (\ s a -> s{_piProjectId = a})
270instance FromJSON PartitionId where
177instance FromJSON PartitionId where
271 parseJSON
178 parseJSON
272 = withObject "PartitionId"
179 = withObject "PartitionId"
274 PartitionId' <$>
181 PartitionId' <$>
275− (o .:? "namespace") <*> (o .:? "datasetId"))
182+ (o .:? "namespaceId") <*> (o .:? "projectId"))
277instance ToJSON PartitionId where
184instance ToJSON PartitionId where
278 toJSON PartitionId'{..}
185 toJSON PartitionId'{..}
280 (catMaybes
187 (catMaybes
281− [("namespace" .=) <$> _piNamespace,
188+ [("namespaceId" .=) <$> _piNamespaceId,
282− ("datasetId" .=) <$> _piDataSetId])
189+ ("projectId" .=) <$> _piProjectId])
284-- | A batch of results produced by a query.
191-- | A batch of results produced by a query.
286-- /See:/ 'queryResultBatch' smart constructor.
193-- /See:/ 'queryResultBatch' smart constructor.
287data QueryResultBatch = QueryResultBatch'
194data QueryResultBatch = QueryResultBatch'
288 { _qrbSkippedResults :: !(Maybe (Textual Int32))
195 { _qrbSkippedResults :: !(Maybe (Textual Int32))
196+ , _qrbSkippedCursor :: !(Maybe (Textual Word8))
289 , _qrbEntityResultType :: !(Maybe QueryResultBatchEntityResultType)
197 , _qrbEntityResultType :: !(Maybe QueryResultBatchEntityResultType)
290 , _qrbEntityResults :: !(Maybe [EntityResult])
198 , _qrbEntityResults :: !(Maybe [EntityResult])
291 , _qrbMoreResults :: !(Maybe QueryResultBatchMoreResults)
199 , _qrbMoreResults :: !(Maybe QueryResultBatchMoreResults)
@@ -298,6 +206,8 @@ data QueryResultBatch = QueryResultBatch'
299-- * 'qrbSkippedResults'
207-- * 'qrbSkippedResults'
209+-- * 'qrbSkippedCursor'
301-- * 'qrbEntityResultType'
211-- * 'qrbEntityResultType'
303-- * 'qrbEntityResults'
213-- * 'qrbEntityResults'
@@ -310,22 +220,29 @@ queryResultBatch
310queryResultBatch =
220queryResultBatch =
311 QueryResultBatch'
221 QueryResultBatch'
312 { _qrbSkippedResults = Nothing
222 { _qrbSkippedResults = Nothing
223+ , _qrbSkippedCursor = Nothing
313 , _qrbEntityResultType = Nothing
224 , _qrbEntityResultType = Nothing
314 , _qrbEntityResults = Nothing
225 , _qrbEntityResults = Nothing
315 , _qrbMoreResults = Nothing
226 , _qrbMoreResults = Nothing
316 , _qrbEndCursor = Nothing
227 , _qrbEndCursor = Nothing
319−-- | The number of results skipped because of Query.offset.
230+-- | The number of results skipped, typically because of an offset.
320qrbSkippedResults :: Lens' QueryResultBatch (Maybe Int32)
231qrbSkippedResults :: Lens' QueryResultBatch (Maybe Int32)
321qrbSkippedResults
232qrbSkippedResults
322 = lens _qrbSkippedResults
233 = lens _qrbSkippedResults
323 (\ s a -> s{_qrbSkippedResults = a})
234 (\ s a -> s{_qrbSkippedResults = a})
324 . mapping _Coerce
235 . mapping _Coerce
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)
241+ = lens _qrbSkippedCursor
242+ (\ s a -> s{_qrbSkippedCursor = a})
326−-- | The result type for every entity in entityResults. full for full
245+-- | The result type for every entity in \`entity_results\`.
327−-- entities, projection for entities with only projected properties,
328−-- keyOnly for entities with only a key.
329qrbEntityResultType :: Lens' QueryResultBatch (Maybe QueryResultBatchEntityResultType)
246qrbEntityResultType :: Lens' QueryResultBatch (Maybe QueryResultBatchEntityResultType)
330qrbEntityResultType
247qrbEntityResultType
331 = lens _qrbEntityResultType
248 = lens _qrbEntityResultType
@@ -339,16 +256,13 @@ qrbEntityResults
339 . _Default
256 . _Default
340 . _Coerce
257 . _Coerce
342−-- | The state of the query after the current batch. One of notFinished,
259+-- | The state of the query after the current batch.
343−-- moreResultsAfterLimit, noMoreResults.
344qrbMoreResults :: Lens' QueryResultBatch (Maybe QueryResultBatchMoreResults)
260qrbMoreResults :: Lens' QueryResultBatch (Maybe QueryResultBatchMoreResults)
345qrbMoreResults
261qrbMoreResults
346 = lens _qrbMoreResults
262 = lens _qrbMoreResults
347 (\ s a -> s{_qrbMoreResults = a})
263 (\ s a -> s{_qrbMoreResults = a})
349-- | A cursor that points to the position after the last result in the batch.
265-- | 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.
352qrbEndCursor :: Lens' QueryResultBatch (Maybe Word8)
266qrbEndCursor :: Lens' QueryResultBatch (Maybe Word8)
353qrbEndCursor
267qrbEndCursor
354 = lens _qrbEndCursor (\ s a -> s{_qrbEndCursor = a})
268 = lens _qrbEndCursor (\ s a -> s{_qrbEndCursor = a})
@@ -359,8 +273,8 @@ instance FromJSON QueryResultBatch where
359 = withObject "QueryResultBatch"
273 = withObject "QueryResultBatch"
361 QueryResultBatch' <$>
275 QueryResultBatch' <$>
362− (o .:? "skippedResults") <*>
276+ (o .:? "skippedResults") <*> (o .:? "skippedCursor")
363− (o .:? "entityResultType")
277+ <*> (o .:? "entityResultType")
364 <*> (o .:? "entityResults" .!= mempty)
278 <*> (o .:? "entityResults" .!= mempty)
365 <*> (o .:? "moreResults")
279 <*> (o .:? "moreResults")
366 <*> (o .:? "endCursor"))
280 <*> (o .:? "endCursor"))
@@ -370,16 +284,20 @@ instance ToJSON QueryResultBatch where
371 (catMaybes
285 (catMaybes
372 [("skippedResults" .=) <$> _qrbSkippedResults,
286 [("skippedResults" .=) <$> _qrbSkippedResults,
287+ ("skippedCursor" .=) <$> _qrbSkippedCursor,
373 ("entityResultType" .=) <$> _qrbEntityResultType,
288 ("entityResultType" .=) <$> _qrbEntityResultType,
374 ("entityResults" .=) <$> _qrbEntityResults,
289 ("entityResults" .=) <$> _qrbEntityResults,
375 ("moreResults" .=) <$> _qrbMoreResults,
290 ("moreResults" .=) <$> _qrbMoreResults,
376 ("endCursor" .=) <$> _qrbEndCursor])
291 ("endCursor" .=) <$> _qrbEndCursor])
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 \`\"\"\`.
380-- /See:/ 'entityProperties' smart constructor.
298-- /See:/ 'entityProperties' smart constructor.
381newtype EntityProperties = EntityProperties'
299newtype EntityProperties = EntityProperties'
382− { _epAddtional :: HashMap Text Property
300+ { _epAddtional :: HashMap Text Value
383 } deriving (Eq,Show,Data,Typeable,Generic)
301 } deriving (Eq,Show,Data,Typeable,Generic)
385-- | Creates a value of 'EntityProperties' with the minimum fields required to make a request.
303-- | Creates a value of 'EntityProperties' with the minimum fields required to make a request.
@@ -388,18 +306,14 @@ newtype EntityProperties = EntityProperties'
389-- * 'epAddtional'
307-- * 'epAddtional'
390entityProperties
308entityProperties
391− :: HashMap Text Property -- ^ 'epAddtional'
309+ :: HashMap Text Value -- ^ 'epAddtional'
392 -> EntityProperties
310 -> EntityProperties
393entityProperties pEpAddtional_ =
311entityProperties pEpAddtional_ =
394 EntityProperties'
312 EntityProperties'
395 { _epAddtional = _Coerce # pEpAddtional_
313 { _epAddtional = _Coerce # pEpAddtional_
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
402−epAddtional :: Lens' EntityProperties (HashMap Text Property)
316+epAddtional :: Lens' EntityProperties (HashMap Text Value)
403epAddtional
317epAddtional
404 = lens _epAddtional (\ s a -> s{_epAddtional = a}) .
318 = lens _epAddtional (\ s a -> s{_epAddtional = a}) .
@@ -412,48 +326,28 @@ instance FromJSON EntityProperties where
412instance ToJSON EntityProperties where
326instance ToJSON EntityProperties where
413 toJSON = toJSON . _epAddtional
327 toJSON = toJSON . _epAddtional
329+-- | The request for google.datastore.v1beta3.Datastore.BeginTransaction.
416-- /See:/ 'beginTransactionRequest' smart constructor.
331-- /See:/ 'beginTransactionRequest' smart constructor.
332+data BeginTransactionRequest =
417−newtype BeginTransactionRequest = BeginTransactionRequest'
333+ BeginTransactionRequest'
418− { _btrIsolationLevel :: Maybe BeginTransactionRequestIsolationLevel
419− } deriving (Eq,Show,Data,Typeable,Generic)
334+ deriving (Eq,Show,Data,Typeable,Generic)
421-- | Creates a value of 'BeginTransactionRequest' with the minimum fields required to make a request.
336-- | Creates a value of 'BeginTransactionRequest' with the minimum fields required to make a request.
423−-- Use one of the following lenses to modify other fields as desired:
425−-- * 'btrIsolationLevel'
426beginTransactionRequest
338beginTransactionRequest
427 :: BeginTransactionRequest
339 :: BeginTransactionRequest
428−beginTransactionRequest =
340+beginTransactionRequest = BeginTransactionRequest'
429− BeginTransactionRequest'
430− { _btrIsolationLevel = Nothing
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)
441− = lens _btrIsolationLevel
442− (\ s a -> s{_btrIsolationLevel = a})
444instance FromJSON BeginTransactionRequest where
342instance FromJSON BeginTransactionRequest where
445 parseJSON
343 parseJSON
446 = withObject "BeginTransactionRequest"
344 = withObject "BeginTransactionRequest"
448− BeginTransactionRequest' <$>
345+ (\ o -> pure BeginTransactionRequest')
449− (o .:? "isolationLevel"))
451instance ToJSON BeginTransactionRequest where
347instance ToJSON BeginTransactionRequest where
452− toJSON BeginTransactionRequest'{..}
348+ toJSON = const emptyObject
455− [("isolationLevel" .=) <$> _btrIsolationLevel])
350+-- | The request for google.datastore.v1beta3.Datastore.RunQuery.
458-- /See:/ 'runQueryRequest' smart constructor.
352-- /See:/ 'runQueryRequest' smart constructor.
459data RunQueryRequest = RunQueryRequest'
353data RunQueryRequest = RunQueryRequest'
@@ -484,25 +378,20 @@ runQueryRequest =
484 , _rqrReadOptions = Nothing
378 , _rqrReadOptions = Nothing
487−-- | Entities are partitioned into subsets, identified by a dataset (usually
381+-- | Entities are partitioned into subsets, identified by a partition ID.
488−-- implicitly specified by the project) and namespace ID. Queries are
489−-- scoped to a single partition. This partition ID is normalized with the
382+-- Queries are scoped to a single partition. This partition ID is
490−-- standard default context partition ID, but all other partition IDs in
383+-- normalized with the standard default context partition ID.
491−-- RunQueryRequest are normalized with this partition ID as the context
493rqrPartitionId :: Lens' RunQueryRequest (Maybe PartitionId)
384rqrPartitionId :: Lens' RunQueryRequest (Maybe PartitionId)
494rqrPartitionId
385rqrPartitionId
495 = lens _rqrPartitionId
386 = lens _rqrPartitionId
496 (\ s a -> s{_rqrPartitionId = a})
387 (\ s a -> s{_rqrPartitionId = a})
498−-- | The GQL query to run. Either this field or field query must be set, but
389+-- | The GQL query to run.
500rqrGqlQuery :: Lens' RunQueryRequest (Maybe GqlQuery)
390rqrGqlQuery :: Lens' RunQueryRequest (Maybe GqlQuery)
501rqrGqlQuery
391rqrGqlQuery
502 = lens _rqrGqlQuery (\ s a -> s{_rqrGqlQuery = a})
392 = lens _rqrGqlQuery (\ s a -> s{_rqrGqlQuery = a})
504−-- | The query to run. Either this field or field gql_query must be set, but
394+-- | The query to run.
506rqrQuery :: Lens' RunQueryRequest (Maybe Query)
395rqrQuery :: Lens' RunQueryRequest (Maybe Query)
507rqrQuery = lens _rqrQuery (\ s a -> s{_rqrQuery = a})
396rqrQuery = lens _rqrQuery (\ s a -> s{_rqrQuery = a})
@@ -530,6 +419,7 @@ instance ToJSON RunQueryRequest where
530 ("query" .=) <$> _rqrQuery,
419 ("query" .=) <$> _rqrQuery,
531 ("readOptions" .=) <$> _rqrReadOptions])
420 ("readOptions" .=) <$> _rqrReadOptions])
422+-- | The request for google.datastore.v1beta3.Datastore.AllocateIds.
534-- /See:/ 'allocateIdsRequest' smart constructor.
424-- /See:/ 'allocateIdsRequest' smart constructor.
535newtype AllocateIdsRequest = AllocateIdsRequest'
425newtype AllocateIdsRequest = AllocateIdsRequest'
@@ -548,8 +438,8 @@ allocateIdsRequest =
548 { _airKeys = Nothing
438 { _airKeys = Nothing
551−-- | A list of keys with incomplete key paths to allocate IDs for. No key may
441+-- | A list of keys with incomplete key paths for which to allocate IDs. No
552−-- be reserved\/read-only.
442+-- key may be reserved\/read-only.
553airKeys :: Lens' AllocateIdsRequest [Key]
443airKeys :: Lens' AllocateIdsRequest [Key]
555 = lens _airKeys (\ s a -> s{_airKeys = a}) . _Default
445 = lens _airKeys (\ s a -> s{_airKeys = a}) . _Default
@@ -565,35 +455,32 @@ instance ToJSON AllocateIdsRequest where
565 toJSON AllocateIdsRequest'{..}
455 toJSON AllocateIdsRequest'{..}
566 = object (catMaybes [("keys" .=) <$> _airKeys])
456 = object (catMaybes [("keys" .=) <$> _airKeys])
568−-- | A filter that merges the multiple other filters using the given
458+-- | A filter that merges multiple other filters using the given operator.
571-- /See:/ 'compositeFilter' smart constructor.
460-- /See:/ 'compositeFilter' smart constructor.
572data CompositeFilter = CompositeFilter'
461data CompositeFilter = CompositeFilter'
573− { _cfOperator :: !(Maybe CompositeFilterOperator)
462+ { _cfOp :: !(Maybe CompositeFilterOp)
574− , _cfFilters :: !(Maybe [Filter])
463+ , _cfFilters :: !(Maybe [Filter])
575 } deriving (Eq,Show,Data,Typeable,Generic)
464 } deriving (Eq,Show,Data,Typeable,Generic)
577-- | Creates a value of 'CompositeFilter' with the minimum fields required to make a request.
466-- | Creates a value of 'CompositeFilter' with the minimum fields required to make a request.
579-- Use one of the following lenses to modify other fields as desired:
468-- Use one of the following lenses to modify other fields as desired:
581−-- * 'cfOperator'
470+-- * 'cfOp'
583-- * 'cfFilters'
472-- * 'cfFilters'
584compositeFilter
473compositeFilter
585 :: CompositeFilter
474 :: CompositeFilter
586compositeFilter =
475compositeFilter =
587 CompositeFilter'
476 CompositeFilter'
588− { _cfOperator = Nothing
477+ { _cfOp = Nothing
589 , _cfFilters = Nothing
478 , _cfFilters = Nothing
592−-- | The operator for combining multiple filters. Only \"and\" is currently
481+-- | The operator for combining multiple filters.
594−cfOperator :: Lens' CompositeFilter (Maybe CompositeFilterOperator)
482+cfOp :: Lens' CompositeFilter (Maybe CompositeFilterOp)
595−cfOperator
483+cfOp = lens _cfOp (\ s a -> s{_cfOp = a})
596− = lens _cfOperator (\ s a -> s{_cfOperator = a})
598-- | The list of filters to combine. Must contain at least one filter.
485-- | The list of filters to combine. Must contain at least one filter.
599cfFilters :: Lens' CompositeFilter [Filter]
486cfFilters :: Lens' CompositeFilter [Filter]
@@ -607,20 +494,19 @@ instance FromJSON CompositeFilter where
607 = withObject "CompositeFilter"
494 = withObject "CompositeFilter"
609 CompositeFilter' <$>
496 CompositeFilter' <$>
610− (o .:? "operator") <*> (o .:? "filters" .!= mempty))
497+ (o .:? "op") <*> (o .:? "filters" .!= mempty))
612instance ToJSON CompositeFilter where
499instance ToJSON CompositeFilter where
613 toJSON CompositeFilter'{..}
500 toJSON CompositeFilter'{..}
615 (catMaybes
502 (catMaybes
616− [("operator" .=) <$> _cfOperator,
617− ("filters" .=) <$> _cfFilters])
503+ [("op" .=) <$> _cfOp, ("filters" .=) <$> _cfFilters])
505+-- | The response for google.datastore.v1beta3.Datastore.BeginTransaction.
620-- /See:/ 'beginTransactionResponse' smart constructor.
507-- /See:/ 'beginTransactionResponse' smart constructor.
621−data BeginTransactionResponse = BeginTransactionResponse'
508+newtype BeginTransactionResponse = BeginTransactionResponse'
622− { _btrTransaction :: !(Maybe (Textual Word8))
509+ { _btrTransaction :: Maybe (Textual Word8)
623− , _btrHeader :: !(Maybe ResponseHeader)
624 } deriving (Eq,Show,Data,Typeable,Generic)
510 } deriving (Eq,Show,Data,Typeable,Generic)
626-- | Creates a value of 'BeginTransactionResponse' with the minimum fields required to make a request.
512-- | Creates a value of 'BeginTransactionResponse' with the minimum fields required to make a request.
@@ -628,14 +514,11 @@ data BeginTransactionResponse = BeginTransactionResponse'
628-- Use one of the following lenses to modify other fields as desired:
514-- Use one of the following lenses to modify other fields as desired:
630-- * 'btrTransaction'
516-- * 'btrTransaction'
633beginTransactionResponse
517beginTransactionResponse
634 :: BeginTransactionResponse
518 :: BeginTransactionResponse
635beginTransactionResponse =
519beginTransactionResponse =
636 BeginTransactionResponse'
520 BeginTransactionResponse'
637 { _btrTransaction = Nothing
521 { _btrTransaction = Nothing
638− , _btrHeader = Nothing
641-- | The transaction identifier (always present).
524-- | The transaction identifier (always present).
@@ -645,82 +528,55 @@ btrTransaction
645 (\ s a -> s{_btrTransaction = a})
528 (\ s a -> s{_btrTransaction = a})
646 . mapping _Coerce
529 . mapping _Coerce
648−btrHeader :: Lens' BeginTransactionResponse (Maybe ResponseHeader)
650− = lens _btrHeader (\ s a -> s{_btrHeader = a})
652instance FromJSON BeginTransactionResponse where
531instance FromJSON BeginTransactionResponse where
653 parseJSON
532 parseJSON
654 = withObject "BeginTransactionResponse"
533 = withObject "BeginTransactionResponse"
656− BeginTransactionResponse' <$>
535+ BeginTransactionResponse' <$> (o .:? "transaction"))
657− (o .:? "transaction") <*> (o .:? "header"))
659instance ToJSON BeginTransactionResponse where
537instance ToJSON BeginTransactionResponse where
660 toJSON BeginTransactionResponse'{..}
538 toJSON BeginTransactionResponse'{..}
663− [("transaction" .=) <$> _btrTransaction,
540+ (catMaybes [("transaction" .=) <$> _btrTransaction])
664− ("header" .=) <$> _btrHeader])
542+-- | The result of applying a mutation.
667-- /See:/ 'mutationResult' smart constructor.
544-- /See:/ 'mutationResult' smart constructor.
668−data MutationResult = MutationResult'
545+newtype MutationResult = MutationResult'
669− { _mrInsertAutoIdKeys :: !(Maybe [Key])
546+ { _mrKey :: Maybe Key
670− , _mrIndexUpdates :: !(Maybe (Textual Int32))
671 } deriving (Eq,Show,Data,Typeable,Generic)
547 } deriving (Eq,Show,Data,Typeable,Generic)
673-- | Creates a value of 'MutationResult' with the minimum fields required to make a request.
549-- | Creates a value of 'MutationResult' with the minimum fields required to make a request.
675-- Use one of the following lenses to modify other fields as desired:
551-- Use one of the following lenses to modify other fields as desired:
677−-- * 'mrInsertAutoIdKeys'
553+-- * 'mrKey'
679−-- * 'mrIndexUpdates'
680mutationResult
554mutationResult
681 :: MutationResult
555 :: MutationResult
682mutationResult =
556mutationResult =
683 MutationResult'
557 MutationResult'
684− { _mrInsertAutoIdKeys = Nothing
685− , _mrIndexUpdates = Nothing
558+ { _mrKey = Nothing
688−-- | Keys for insertAutoId entities. One per entity from the request, in the
561+-- | The automatically allocated key. Set only when the mutation allocated a
689−-- same order.
562+-- key.
690−mrInsertAutoIdKeys :: Lens' MutationResult [Key]
692− = lens _mrInsertAutoIdKeys
693− (\ s a -> s{_mrInsertAutoIdKeys = a})
697−-- | Number of index writes.
698−mrIndexUpdates :: Lens' MutationResult (Maybe Int32)
563+mrKey :: Lens' MutationResult (Maybe Key)
699−mrIndexUpdates
564+mrKey = lens _mrKey (\ s a -> s{_mrKey = a})
700− = lens _mrIndexUpdates
701− (\ s a -> s{_mrIndexUpdates = a})
704instance FromJSON MutationResult where
566instance FromJSON MutationResult where
705 parseJSON
567 parseJSON
706 = withObject "MutationResult"
568 = withObject "MutationResult"
708− MutationResult' <$>
569+ (\ o -> MutationResult' <$> (o .:? "key"))
709− (o .:? "insertAutoIdKeys" .!= mempty) <*>
710− (o .:? "indexUpdates"))
712instance ToJSON MutationResult where
571instance ToJSON MutationResult where
713 toJSON MutationResult'{..}
572 toJSON MutationResult'{..}
715− (catMaybes
573+ = object (catMaybes [("key" .=) <$> _mrKey])
716− [("insertAutoIdKeys" .=) <$> _mrInsertAutoIdKeys,
717− ("indexUpdates" .=) <$> _mrIndexUpdates])
575+-- | The response for google.datastore.v1beta3.Datastore.AllocateIds.
720-- /See:/ 'allocateIdsResponse' smart constructor.
577-- /See:/ 'allocateIdsResponse' smart constructor.
721−data AllocateIdsResponse = AllocateIdsResponse'
578+newtype AllocateIdsResponse = AllocateIdsResponse'
722− { _aKeys :: !(Maybe [Key])
579+ { _aKeys :: Maybe [Key]
723− , _aHeader :: !(Maybe ResponseHeader)
724 } deriving (Eq,Show,Data,Typeable,Generic)
580 } deriving (Eq,Show,Data,Typeable,Generic)
726-- | Creates a value of 'AllocateIdsResponse' with the minimum fields required to make a request.
582-- | Creates a value of 'AllocateIdsResponse' with the minimum fields required to make a request.
@@ -728,14 +584,11 @@ data AllocateIdsResponse = AllocateIdsResponse'
728-- Use one of the following lenses to modify other fields as desired:
584-- Use one of the following lenses to modify other fields as desired:
730-- * 'aKeys'
586-- * 'aKeys'
733allocateIdsResponse
587allocateIdsResponse
734 :: AllocateIdsResponse
588 :: AllocateIdsResponse
735allocateIdsResponse =
589allocateIdsResponse =
736 AllocateIdsResponse'
590 AllocateIdsResponse'
737 { _aKeys = Nothing
591 { _aKeys = Nothing
738− , _aHeader = Nothing
741-- | The keys specified in the request (in the same order), each with its key
594-- | The keys specified in the request (in the same order), each with its key
@@ -745,166 +598,165 @@ aKeys
745 = lens _aKeys (\ s a -> s{_aKeys = a}) . _Default .
598 = lens _aKeys (\ s a -> s{_aKeys = a}) . _Default .
748−aHeader :: Lens' AllocateIdsResponse (Maybe ResponseHeader)
749−aHeader = lens _aHeader (\ s a -> s{_aHeader = a})
751instance FromJSON AllocateIdsResponse where
601instance FromJSON AllocateIdsResponse where
752 parseJSON
602 parseJSON
753 = withObject "AllocateIdsResponse"
603 = withObject "AllocateIdsResponse"
755− AllocateIdsResponse' <$>
605+ AllocateIdsResponse' <$> (o .:? "keys" .!= mempty))
756− (o .:? "keys" .!= mempty) <*> (o .:? "header"))
758instance ToJSON AllocateIdsResponse where
607instance ToJSON AllocateIdsResponse where
759 toJSON AllocateIdsResponse'{..}
608 toJSON AllocateIdsResponse'{..}
761− (catMaybes
609+ = object (catMaybes [("keys" .=) <$> _aKeys])
762− [("keys" .=) <$> _aKeys, ("header" .=) <$> _aHeader])
764−-- | A GQL query.
611+-- | A [GQL
612+-- query](https:\/\/cloud.google.com\/datastore\/docs\/apis\/gql\/gql_reference).
766-- /See:/ 'gqlQuery' smart constructor.
614-- /See:/ 'gqlQuery' smart constructor.
767data GqlQuery = GqlQuery'
615data GqlQuery = GqlQuery'
768− { _gqAllowLiteral :: !(Maybe Bool)
616+ { _gqPositionalBindings :: !(Maybe [GqlQueryParameter])
769− , _gqNumberArgs :: !(Maybe [GqlQueryArg])
617+ , _gqNamedBindings :: !(Maybe GqlQueryNamedBindings)
770− , _gqQueryString :: !(Maybe Text)
618+ , _gqQueryString :: !(Maybe Text)
771− , _gqNameArgs :: !(Maybe [GqlQueryArg])
619+ , _gqAllowLiterals :: !(Maybe Bool)
772 } deriving (Eq,Show,Data,Typeable,Generic)
620 } deriving (Eq,Show,Data,Typeable,Generic)
774-- | Creates a value of 'GqlQuery' with the minimum fields required to make a request.
622-- | Creates a value of 'GqlQuery' with the minimum fields required to make a request.
776-- Use one of the following lenses to modify other fields as desired:
624-- Use one of the following lenses to modify other fields as desired:
778−-- * 'gqAllowLiteral'
626+-- * 'gqPositionalBindings'
780−-- * 'gqNumberArgs'
628+-- * 'gqNamedBindings'
782-- * 'gqQueryString'
630-- * 'gqQueryString'
784−-- * 'gqNameArgs'
632+-- * 'gqAllowLiterals'
786 :: GqlQuery
634 :: GqlQuery
787gqlQuery =
635gqlQuery =
788 GqlQuery'
636 GqlQuery'
789− { _gqAllowLiteral = Nothing
637+ { _gqPositionalBindings = Nothing
790− , _gqNumberArgs = Nothing
638+ , _gqNamedBindings = Nothing
791 , _gqQueryString = Nothing
639 , _gqQueryString = Nothing
792− , _gqNameArgs = Nothing
640+ , _gqAllowLiterals = Nothing
795−-- | When false, the query string must not contain a literal.
796−gqAllowLiteral :: Lens' GqlQuery (Maybe Bool)
798− = lens _gqAllowLiteral
799− (\ s a -> s{_gqAllowLiteral = a})
801−-- | Numbered binding site \'1 references the first numbered argument,
643+-- | Numbered binding site \'1 references the first numbered parameter,
802−-- effectively using 1-based indexing, rather than the usual 0. A numbered
644+-- effectively using 1-based indexing, rather than the usual 0. For each
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
645+-- binding site numbered i in \`query_string\`, there must be an i-th
805−-- inverse must also be true.
646+-- numbered parameter. The inverse must also be true.
806−gqNumberArgs :: Lens' GqlQuery [GqlQueryArg]
647+gqPositionalBindings :: Lens' GqlQuery [GqlQueryParameter]
807−gqNumberArgs
648+gqPositionalBindings
808− = lens _gqNumberArgs (\ s a -> s{_gqNumberArgs = a})
649+ = lens _gqPositionalBindings
650+ (\ s a -> s{_gqPositionalBindings = a})
809 . _Default
651 . _Default
810 . _Coerce
652 . _Coerce
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)
660+ = lens _gqNamedBindings
661+ (\ s a -> s{_gqNamedBindings = a})
663+-- | A string of the format described
664+-- [here](https:\/\/cloud.google.com\/datastore\/docs\/apis\/gql\/gql_reference).
813gqQueryString :: Lens' GqlQuery (Maybe Text)
665gqQueryString :: Lens' GqlQuery (Maybe Text)
814gqQueryString
666gqQueryString
815 = lens _gqQueryString
667 = lens _gqQueryString
816 (\ s a -> s{_gqQueryString = a})
668 (\ s a -> s{_gqQueryString = a})
818−-- | A named argument must set field GqlQueryArg.name. No two named arguments
670+-- | When false, the query string must not contain any literals and instead
819−-- may have the same name. For each non-reserved named binding site in the
671+-- must bind all values. For example, \`SELECT * FROM Kind WHERE a =
820−-- query string, there must be a named argument with that name, but not
672+-- \'string literal\'\` is not allowed, while \`SELECT * FROM Kind WHERE a
821−-- necessarily the inverse.
673+-- = \'value\` is.
822−gqNameArgs :: Lens' GqlQuery [GqlQueryArg]
674+gqAllowLiterals :: Lens' GqlQuery (Maybe Bool)
823−gqNameArgs
675+gqAllowLiterals
824− = lens _gqNameArgs (\ s a -> s{_gqNameArgs = a}) .
676+ = lens _gqAllowLiterals
825− _Default
677+ (\ s a -> s{_gqAllowLiterals = a})
828instance FromJSON GqlQuery where
679instance FromJSON GqlQuery where
829 parseJSON
680 parseJSON
830 = withObject "GqlQuery"
681 = withObject "GqlQuery"
832 GqlQuery' <$>
683 GqlQuery' <$>
833− (o .:? "allowLiteral") <*>
684+ (o .:? "positionalBindings" .!= mempty) <*>
834− (o .:? "numberArgs" .!= mempty)
685+ (o .:? "namedBindings")
835 <*> (o .:? "queryString")
686 <*> (o .:? "queryString")
836− <*> (o .:? "nameArgs" .!= mempty))
687+ <*> (o .:? "allowLiterals"))
838instance ToJSON GqlQuery where
689instance ToJSON GqlQuery where
839 toJSON GqlQuery'{..}
690 toJSON GqlQuery'{..}
841 (catMaybes
692 (catMaybes
842− [("allowLiteral" .=) <$> _gqAllowLiteral,
693+ [("positionalBindings" .=) <$> _gqPositionalBindings,
843− ("numberArgs" .=) <$> _gqNumberArgs,
694+ ("namedBindings" .=) <$> _gqNamedBindings,
844 ("queryString" .=) <$> _gqQueryString,
695 ("queryString" .=) <$> _gqQueryString,
845− ("nameArgs" .=) <$> _gqNameArgs])
696+ ("allowLiterals" .=) <$> _gqAllowLiterals])
698+-- | The response for google.datastore.v1beta3.Datastore.RunQuery.
848-- /See:/ 'runQueryResponse' smart constructor.
700-- /See:/ 'runQueryResponse' smart constructor.
849data RunQueryResponse = RunQueryResponse'
701data RunQueryResponse = RunQueryResponse'
850− { _rqrBatch :: !(Maybe QueryResultBatch)
702+ { _rBatch :: !(Maybe QueryResultBatch)
851− , _rqrHeader :: !(Maybe ResponseHeader)
703+ , _rQuery :: !(Maybe Query)
852 } deriving (Eq,Show,Data,Typeable,Generic)
704 } deriving (Eq,Show,Data,Typeable,Generic)
854-- | Creates a value of 'RunQueryResponse' with the minimum fields required to make a request.
706-- | Creates a value of 'RunQueryResponse' with the minimum fields required to make a request.
856-- Use one of the following lenses to modify other fields as desired:
708-- Use one of the following lenses to modify other fields as desired:
858−-- * 'rqrBatch'
710+-- * 'rBatch'
860−-- * 'rqrHeader'
712+-- * 'rQuery'
861runQueryResponse
713runQueryResponse
862 :: RunQueryResponse
714 :: RunQueryResponse
863runQueryResponse =
715runQueryResponse =
864 RunQueryResponse'
716 RunQueryResponse'
865− { _rqrBatch = Nothing
717+ { _rBatch = Nothing
866− , _rqrHeader = Nothing
718+ , _rQuery = Nothing
869-- | A batch of query results (always present).
721-- | A batch of query results (always present).
870−rqrBatch :: Lens' RunQueryResponse (Maybe QueryResultBatch)
722+rBatch :: Lens' RunQueryResponse (Maybe QueryResultBatch)
871−rqrBatch = lens _rqrBatch (\ s a -> s{_rqrBatch = a})
723+rBatch = lens _rBatch (\ s a -> s{_rBatch = a})
725+-- | The parsed form of the \`GqlQuery\` from the request, if it was set.
873−rqrHeader :: Lens' RunQueryResponse (Maybe ResponseHeader)
726+rQuery :: Lens' RunQueryResponse (Maybe Query)
874−rqrHeader
727+rQuery = lens _rQuery (\ s a -> s{_rQuery = a})
875− = lens _rqrHeader (\ s a -> s{_rqrHeader = a})
877instance FromJSON RunQueryResponse where
729instance FromJSON RunQueryResponse where
878 parseJSON
730 parseJSON
879 = withObject "RunQueryResponse"
731 = withObject "RunQueryResponse"
881 RunQueryResponse' <$>
733 RunQueryResponse' <$>
882− (o .:? "batch") <*> (o .:? "header"))
734+ (o .:? "batch") <*> (o .:? "query"))
884instance ToJSON RunQueryResponse where
736instance ToJSON RunQueryResponse where
885 toJSON RunQueryResponse'{..}
737 toJSON RunQueryResponse'{..}
887 (catMaybes
739 (catMaybes
888− [("batch" .=) <$> _rqrBatch,
740+ [("batch" .=) <$> _rBatch, ("query" .=) <$> _rQuery])
889− ("header" .=) <$> _rqrHeader])
891-- | A message that can hold any of the supported value types and associated
742-- | A message that can hold any of the supported value types and associated
892-- metadata.
743-- metadata.
894-- /See:/ 'value' smart constructor.
745-- /See:/ 'value' smart constructor.
895data Value = Value'
746data Value = Value'
896− { _vKeyValue :: !(Maybe Key)
747+ { _vKeyValue :: !(Maybe Key)
897− , _vBlobKeyValue :: !(Maybe Text)
748+ , _vGeoPointValue :: !(Maybe LatLng)
898− , _vDateTimeValue :: !(Maybe DateTime')
899− , _vIntegerValue :: !(Maybe (Textual Int64))
749+ , _vIntegerValue :: !(Maybe (Textual Int64))
750+ , _vTimestampValue :: !(Maybe DateTime')
900− , _vEntityValue :: !(Maybe Entity)
751+ , _vEntityValue :: !(Maybe Entity)
752+ , _vExcludeFromIndexes :: !(Maybe Bool)
901− , _vDoubleValue :: !(Maybe (Textual Double))
753+ , _vDoubleValue :: !(Maybe (Textual Double))
902− , _vStringValue :: !(Maybe Text)
754+ , _vStringValue :: !(Maybe Text)
903− , _vListValue :: !(Maybe [Value])
904− , _vIndexed :: !(Maybe Bool)
905− , _vBooleanValue :: !(Maybe Bool)
755+ , _vBooleanValue :: !(Maybe Bool)
906− , _vMeaning :: !(Maybe (Textual Int32))
756+ , _vMeaning :: !(Maybe (Textual Int32))
757+ , _vArrayValue :: !(Maybe ArrayValue)
758+ , _vNullValue :: !(Maybe ValueNullValue)
907− , _vBlobValue :: !(Maybe (Textual Word8))
759+ , _vBlobValue :: !(Maybe (Textual Word8))
908 } deriving (Eq,Show,Data,Typeable,Generic)
760 } deriving (Eq,Show,Data,Typeable,Generic)
910-- | Creates a value of 'Value' with the minimum fields required to make a request.
762-- | Creates a value of 'Value' with the minimum fields required to make a request.
@@ -913,42 +765,45 @@ data Value = Value'
914-- * 'vKeyValue'
766-- * 'vKeyValue'
916−-- * 'vBlobKeyValue'
768+-- * 'vGeoPointValue'
918−-- * 'vDateTimeValue'
920-- * 'vIntegerValue'
770-- * 'vIntegerValue'
772+-- * 'vTimestampValue'
922-- * 'vEntityValue'
774-- * 'vEntityValue'
776+-- * 'vExcludeFromIndexes'
924-- * 'vDoubleValue'
778-- * 'vDoubleValue'
926-- * 'vStringValue'
780-- * 'vStringValue'
932-- * 'vBooleanValue'
782-- * 'vBooleanValue'
934-- * 'vMeaning'
784-- * 'vMeaning'
936-- * 'vBlobValue'
790-- * 'vBlobValue'
941 { _vKeyValue = Nothing
795 { _vKeyValue = Nothing
942− , _vBlobKeyValue = Nothing
796+ , _vGeoPointValue = Nothing
943− , _vDateTimeValue = Nothing
944 , _vIntegerValue = Nothing
797 , _vIntegerValue = Nothing
798+ , _vTimestampValue = Nothing
945 , _vEntityValue = Nothing
799 , _vEntityValue = Nothing
800+ , _vExcludeFromIndexes = Nothing
946 , _vDoubleValue = Nothing
801 , _vDoubleValue = Nothing
947 , _vStringValue = Nothing
802 , _vStringValue = Nothing
948− , _vListValue = Nothing
949− , _vIndexed = Nothing
950 , _vBooleanValue = Nothing
803 , _vBooleanValue = Nothing
951 , _vMeaning = Nothing
804 , _vMeaning = Nothing
805+ , _vArrayValue = Nothing
806+ , _vNullValue = Nothing
952 , _vBlobValue = Nothing
807 , _vBlobValue = Nothing
@@ -957,18 +812,11 @@ vKeyValue :: Lens' Value (Maybe Key)
958 = lens _vKeyValue (\ s a -> s{_vKeyValue = a})
813 = lens _vKeyValue (\ s a -> s{_vKeyValue = a})
960−-- | A blob key value.
815+-- | A geo point value representing a point on the surface of Earth.
961−vBlobKeyValue :: Lens' Value (Maybe Text)
963− = lens _vBlobKeyValue
964− (\ s a -> s{_vBlobKeyValue = a})
966−-- | A timestamp value.
967−vDateTimeValue :: Lens' Value (Maybe UTCTime)
816+vGeoPointValue :: Lens' Value (Maybe LatLng)
968−vDateTimeValue
817+vGeoPointValue
969− = lens _vDateTimeValue
818+ = lens _vGeoPointValue
970− (\ s a -> s{_vDateTimeValue = a})
819+ (\ s a -> s{_vGeoPointValue = a})
973-- | An integer value.
821-- | An integer value.
974vIntegerValue :: Lens' Value (Maybe Int64)
822vIntegerValue :: Lens' Value (Maybe Int64)
@@ -977,56 +825,68 @@ vIntegerValue
977 (\ s a -> s{_vIntegerValue = a})
825 (\ s a -> s{_vIntegerValue = a})
978 . mapping _Coerce
826 . mapping _Coerce
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)
832+ = lens _vTimestampValue
833+ (\ s a -> s{_vTimestampValue = a})
980−-- | An entity value. May have no key. May have a key with an incomplete key
836+-- | An entity value. - May have no key. - May have a key with an incomplete
981−-- path. May have a reserved\/read-only key.
837+-- key path. - May have a reserved\/read-only key.
982vEntityValue :: Lens' Value (Maybe Entity)
838vEntityValue :: Lens' Value (Maybe Entity)
983vEntityValue
839vEntityValue
984 = lens _vEntityValue (\ s a -> s{_vEntityValue = a})
840 = lens _vEntityValue (\ s a -> s{_vEntityValue = a})
842+-- | If the value should be excluded from all indexes including those defined
844+vExcludeFromIndexes :: Lens' Value (Maybe Bool)
846+ = lens _vExcludeFromIndexes
847+ (\ s a -> s{_vExcludeFromIndexes = a})
986-- | A double value.
849-- | A double value.
987vDoubleValue :: Lens' Value (Maybe Double)
850vDoubleValue :: Lens' Value (Maybe Double)
988vDoubleValue
851vDoubleValue
989 = lens _vDoubleValue (\ s a -> s{_vDoubleValue = a})
852 = lens _vDoubleValue (\ s a -> s{_vDoubleValue = a})
990 . mapping _Coerce
853 . mapping _Coerce
992−-- | A UTF-8 encoded string value. When indexed is true, may have at most 500
855+-- | A UTF-8 encoded string value. When \`exclude_from_indexes\` is false (it
993−-- characters.
856+-- is indexed) , may have at most 1500 bytes. Otherwise, may be set to at
857+-- least 1,000,000 bytes.
994vStringValue :: Lens' Value (Maybe Text)
858vStringValue :: Lens' Value (Maybe Text)
995vStringValue
859vStringValue
996 = lens _vStringValue (\ s a -> s{_vStringValue = a})
860 = lens _vStringValue (\ s a -> s{_vStringValue = a})
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]
1002− = lens _vListValue (\ s a -> s{_vListValue = a}) .
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})
1016-- | A boolean value.
862-- | A boolean value.
1017vBooleanValue :: Lens' Value (Maybe Bool)
863vBooleanValue :: Lens' Value (Maybe Bool)
1018vBooleanValue
864vBooleanValue
1019 = lens _vBooleanValue
865 = lens _vBooleanValue
1020 (\ s a -> s{_vBooleanValue = a})
866 (\ s a -> s{_vBooleanValue = a})
1022−-- | The meaning field is reserved and should not be used.
868+-- | The \`meaning\` field should only be populated for backwards
1023vMeaning :: Lens' Value (Maybe Int32)
870vMeaning :: Lens' Value (Maybe Int32)
1025 = lens _vMeaning (\ s a -> s{_vMeaning = a}) .
872 = lens _vMeaning (\ s a -> s{_vMeaning = a}) .
1026 mapping _Coerce
873 mapping _Coerce
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)
880+ = lens _vArrayValue (\ s a -> s{_vArrayValue = a})
883+vNullValue :: Lens' Value (Maybe ValueNullValue)
885+ = lens _vNullValue (\ s a -> s{_vNullValue = a})
1028−-- | A blob value. May be a maximum of 1,000,000 bytes. When indexed is true,
887+-- | A blob value. May have at most 1,000,000 bytes. When
1029−-- may have at most 500 bytes.
888+-- \`exclude_from_indexes\` is false, may have at most 1500 bytes. In JSON
889+-- requests, must be base64-encoded.
1030vBlobValue :: Lens' Value (Maybe Word8)
890vBlobValue :: Lens' Value (Maybe Word8)
1031vBlobValue
891vBlobValue
1032 = lens _vBlobValue (\ s a -> s{_vBlobValue = a}) .
892 = lens _vBlobValue (\ s a -> s{_vBlobValue = a}) .
@@ -1037,16 +897,17 @@ instance FromJSON Value where
1037 = withObject "Value"
897 = withObject "Value"
1039 Value' <$>
899 Value' <$>
1040− (o .:? "keyValue") <*> (o .:? "blobKeyValue") <*>
900+ (o .:? "keyValue") <*> (o .:? "geoPointValue") <*>
1041− (o .:? "dateTimeValue")
1042− <*> (o .:? "integerValue")
901+ (o .:? "integerValue")
902+ <*> (o .:? "timestampValue")
1043 <*> (o .:? "entityValue")
903 <*> (o .:? "entityValue")
904+ <*> (o .:? "excludeFromIndexes")
1044 <*> (o .:? "doubleValue")
905 <*> (o .:? "doubleValue")
1045 <*> (o .:? "stringValue")
906 <*> (o .:? "stringValue")
1046− <*> (o .:? "listValue" .!= mempty)
1047− <*> (o .:? "indexed")
1048 <*> (o .:? "booleanValue")
907 <*> (o .:? "booleanValue")
1049 <*> (o .:? "meaning")
908 <*> (o .:? "meaning")
909+ <*> (o .:? "arrayValue")
910+ <*> (o .:? "nullValue")
1050 <*> (o .:? "blobValue"))
911 <*> (o .:? "blobValue"))
1052instance ToJSON Value where
913instance ToJSON Value where
@@ -1054,18 +915,20 @@ instance ToJSON Value where
1054 = object
915 = object
1055 (catMaybes
916 (catMaybes
1056 [("keyValue" .=) <$> _vKeyValue,
917 [("keyValue" .=) <$> _vKeyValue,
1057− ("blobKeyValue" .=) <$> _vBlobKeyValue,
918+ ("geoPointValue" .=) <$> _vGeoPointValue,
1058− ("dateTimeValue" .=) <$> _vDateTimeValue,
1059 ("integerValue" .=) <$> _vIntegerValue,
919 ("integerValue" .=) <$> _vIntegerValue,
920+ ("timestampValue" .=) <$> _vTimestampValue,
1060 ("entityValue" .=) <$> _vEntityValue,
921 ("entityValue" .=) <$> _vEntityValue,
922+ ("excludeFromIndexes" .=) <$> _vExcludeFromIndexes,
1061 ("doubleValue" .=) <$> _vDoubleValue,
923 ("doubleValue" .=) <$> _vDoubleValue,
1062 ("stringValue" .=) <$> _vStringValue,
924 ("stringValue" .=) <$> _vStringValue,
1063− ("listValue" .=) <$> _vListValue,
1064− ("indexed" .=) <$> _vIndexed,
1065 ("booleanValue" .=) <$> _vBooleanValue,
925 ("booleanValue" .=) <$> _vBooleanValue,
1066 ("meaning" .=) <$> _vMeaning,
926 ("meaning" .=) <$> _vMeaning,
927+ ("arrayValue" .=) <$> _vArrayValue,
928+ ("nullValue" .=) <$> _vNullValue,
1067 ("blobValue" .=) <$> _vBlobValue])
929 ("blobValue" .=) <$> _vBlobValue])
931+-- | The request for google.datastore.v1beta3.Datastore.Lookup.
1070-- /See:/ 'lookupRequest' smart constructor.
933-- /See:/ 'lookupRequest' smart constructor.
1071data LookupRequest = LookupRequest'
934data LookupRequest = LookupRequest'
@@ -1088,13 +951,13 @@ lookupRequest =
1088 , _lrReadOptions = Nothing
951 , _lrReadOptions = Nothing
1091−-- | Keys of entities to look up from the datastore.
954+-- | Keys of entities to look up.
1092lrKeys :: Lens' LookupRequest [Key]
955lrKeys :: Lens' LookupRequest [Key]
1094 = lens _lrKeys (\ s a -> s{_lrKeys = a}) . _Default .
957 = lens _lrKeys (\ s a -> s{_lrKeys = a}) . _Default .
1097−-- | Options for this lookup request. Optional.
960+-- | The options for this lookup request.
1098lrReadOptions :: Lens' LookupRequest (Maybe ReadOptions)
961lrReadOptions :: Lens' LookupRequest (Maybe ReadOptions)
1099lrReadOptions
962lrReadOptions
1100 = lens _lrReadOptions
963 = lens _lrReadOptions
@@ -1114,16 +977,14 @@ instance ToJSON LookupRequest where
1114 [("keys" .=) <$> _lrKeys,
977 [("keys" .=) <$> _lrKeys,
1115 ("readOptions" .=) <$> _lrReadOptions])
978 ("readOptions" .=) <$> _lrReadOptions])
1117−-- | A set of changes to apply.
980+-- | A mutation to apply to an entity.
1119-- /See:/ 'mutation' smart constructor.
982-- /See:/ 'mutation' smart constructor.
1120data Mutation = Mutation'
983data Mutation = Mutation'
1121− { _mInsert :: !(Maybe [Entity])
1122− , _mForce :: !(Maybe Bool)
1123− , _mInsertAutoId :: !(Maybe [Entity])
984+ { _mInsert :: !(Maybe Entity)
1124− , _mUpsert :: !(Maybe [Entity])
985+ , _mUpsert :: !(Maybe Entity)
1125− , _mDelete :: !(Maybe [Key])
986+ , _mDelete :: !(Maybe Key)
1126− , _mUpdate :: !(Maybe [Entity])
987+ , _mUpdate :: !(Maybe Entity)
1127 } deriving (Eq,Show,Data,Typeable,Generic)
988 } deriving (Eq,Show,Data,Typeable,Generic)
1129-- | Creates a value of 'Mutation' with the minimum fields required to make a request.
990-- | Creates a value of 'Mutation' with the minimum fields required to make a request.
@@ -1132,10 +993,6 @@ data Mutation = Mutation'
1133-- * 'mInsert'
994-- * 'mInsert'
1137−-- * 'mInsertAutoId'
1139-- * 'mUpsert'
996-- * 'mUpsert'
1141-- * 'mDelete'
998-- * 'mDelete'
@@ -1146,172 +1003,87 @@ mutation
1146mutation =
1003mutation =
1147 Mutation'
1004 Mutation'
1148 { _mInsert = Nothing
1005 { _mInsert = Nothing
1149− , _mForce = Nothing
1150− , _mInsertAutoId = Nothing
1151 , _mUpsert = Nothing
1006 , _mUpsert = Nothing
1152 , _mDelete = Nothing
1007 , _mDelete = Nothing
1153 , _mUpdate = Nothing
1008 , _mUpdate = Nothing
1156−-- | Entities to insert. Each inserted entity\'s key must have a complete
1011+-- | The entity to insert. The entity must not already exist. The entity
1157−-- path and must not be reserved\/read-only.
1012+-- key\'s final path element may be incomplete.
1158−mInsert :: Lens' Mutation [Entity]
1013+mInsert :: Lens' Mutation (Maybe Entity)
1160− = lens _mInsert (\ s a -> s{_mInsert = a}) . _Default
1014+mInsert = lens _mInsert (\ s a -> s{_mInsert = a})
1163−-- | Ignore a user specified read-only period. Optional.
1016+-- | The entity to upsert. The entity may or may not already exist. The
1017+-- entity key\'s final path element may be incomplete.
1164−mForce :: Lens' Mutation (Maybe Bool)
1018+mUpsert :: Lens' Mutation (Maybe Entity)
1165−mForce = lens _mForce (\ s a -> s{_mForce = a})
1019+mUpsert = lens _mUpsert (\ s a -> s{_mUpsert = a})
1167−-- | Insert entities with a newly allocated ID. Each inserted entity\'s key
1021+-- | The key of the entity to delete. The entity may or may not already
1168−-- must omit the final identifier in its path and must not be
1022+-- exist. Must have a complete key path and must not be
1169-- reserved\/read-only.
1023-- reserved\/read-only.
1170−mInsertAutoId :: Lens' Mutation [Entity]
1024+mDelete :: Lens' Mutation (Maybe Key)
1171−mInsertAutoId
1025+mDelete = lens _mDelete (\ s a -> s{_mDelete = a})
1172− = lens _mInsertAutoId
1173− (\ s a -> s{_mInsertAutoId = a})
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]
1181− = lens _mUpsert (\ s a -> s{_mUpsert = a}) . _Default
1184−-- | Keys of entities to delete. Each key must have a complete key path and
1027+-- | The entity to update. The entity must already exist. Must have a
1185−-- must not be reserved\/read-only.
1028+-- complete key path.
1186−mDelete :: Lens' Mutation [Key]
1188− = lens _mDelete (\ s a -> s{_mDelete = a}) . _Default
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]
1029+mUpdate :: Lens' Mutation (Maybe Entity)
1195− = lens _mUpdate (\ s a -> s{_mUpdate = a}) . _Default
1030+mUpdate = lens _mUpdate (\ s a -> s{_mUpdate = a})
1198instance FromJSON Mutation where
1032instance FromJSON Mutation where
1199 parseJSON
1033 parseJSON
1200 = withObject "Mutation"
1034 = withObject "Mutation"
1202 Mutation' <$>
1036 Mutation' <$>
1203− (o .:? "insert" .!= mempty) <*> (o .:? "force") <*>
1204− (o .:? "insertAutoId" .!= mempty)
1205− <*> (o .:? "upsert" .!= mempty)
1037+ (o .:? "insert") <*> (o .:? "upsert") <*>
1206− <*> (o .:? "delete" .!= mempty)
1038+ (o .:? "delete")
1207− <*> (o .:? "update" .!= mempty))
1039+ <*> (o .:? "update"))
1209instance ToJSON Mutation where
1041instance ToJSON Mutation where
1210 toJSON Mutation'{..}
1042 toJSON Mutation'{..}
1211 = object
1043 = object
1212 (catMaybes
1044 (catMaybes
1213 [("insert" .=) <$> _mInsert,
1045 [("insert" .=) <$> _mInsert,
1214− ("force" .=) <$> _mForce,
1215− ("insertAutoId" .=) <$> _mInsertAutoId,
1216 ("upsert" .=) <$> _mUpsert,
1046 ("upsert" .=) <$> _mUpsert,
1217 ("delete" .=) <$> _mDelete,
1047 ("delete" .=) <$> _mDelete,
1218 ("update" .=) <$> _mUpdate])
1048 ("update" .=) <$> _mUpdate])
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 \`\"\"\`.
1221−-- /See:/ 'responseHeader' smart constructor.
1055+-- /See:/ 'gqlQueryNamedBindings' smart constructor.
1222−newtype ResponseHeader = ResponseHeader'
1056+newtype GqlQueryNamedBindings = GqlQueryNamedBindings'
1223− { _rhKind :: Text
1057+ { _gqnbAddtional :: HashMap Text GqlQueryParameter
1224− } deriving (Eq,Show,Data,Typeable,Generic)
1226−-- | Creates a value of 'ResponseHeader' with the minimum fields required to make a request.
1228−-- Use one of the following lenses to modify other fields as desired:
1235− { _rhKind = "datastore#responseHeader"
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})
1243−instance FromJSON ResponseHeader where
1245− = withObject "ResponseHeader"
1247− ResponseHeader' <$>
1248− (o .:? "kind" .!= "datastore#responseHeader"))
1250−instance ToJSON ResponseHeader where
1251− toJSON ResponseHeader'{..}
1252− = object (catMaybes [Just ("kind" .= _rhKind)])
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.
1258−-- /See:/ 'keyPathElement' smart constructor.
1259−data KeyPathElement = KeyPathElement'
1260− { _kpeKind :: !(Maybe Text)
1261− , _kpeName :: !(Maybe Text)
1262− , _kpeId :: !(Maybe (Textual Int64))
1263 } deriving (Eq,Show,Data,Typeable,Generic)
1058 } deriving (Eq,Show,Data,Typeable,Generic)
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.
1267-- Use one of the following lenses to modify other fields as desired:
1062-- Use one of the following lenses to modify other fields as desired:
1269−-- * 'kpeKind'
1064+-- * 'gqnbAddtional'
1270−--
1065+gqlQueryNamedBindings
1271−-- * 'kpeName'
1066+ :: HashMap Text GqlQueryParameter -- ^ 'gqnbAddtional'
1272−--
1067+ -> GqlQueryNamedBindings
1273−-- * 'kpeId'
1068+gqlQueryNamedBindings pGqnbAddtional_ =
1274−keyPathElement
1069+ GqlQueryNamedBindings'
1275− :: KeyPathElement
1070+ { _gqnbAddtional = _Coerce # pGqnbAddtional_
1278− { _kpeKind = Nothing
1279− , _kpeName = Nothing
1283−-- | The kind of the entity. A kind matching regex \"__.*__\" is
1073+gqnbAddtional :: Lens' GqlQueryNamedBindings (HashMap Text GqlQueryParameter)
1284−-- reserved\/read-only. A kind must not contain more than 500 characters.
1074+gqnbAddtional
1285−-- Cannot be \"\".
1075+ = lens _gqnbAddtional
1286−kpeKind :: Lens' KeyPathElement (Maybe Text)
1076+ (\ s a -> s{_gqnbAddtional = a})
1287−kpeKind = lens _kpeKind (\ s a -> s{_kpeKind = a})
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
1292−kpeName :: Lens' KeyPathElement (Maybe Text)
1293−kpeName = lens _kpeName (\ s a -> s{_kpeName = a})
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)
1299− = lens _kpeId (\ s a -> s{_kpeId = a}) .
1300− mapping _Coerce
1077+ . _Coerce
1302−instance FromJSON KeyPathElement where
1079+instance FromJSON GqlQueryNamedBindings where
1303 parseJSON
1080 parseJSON
1304− = withObject "KeyPathElement"
1081+ = withObject "GqlQueryNamedBindings"
1306− KeyPathElement' <$>
1083+ GqlQueryNamedBindings' <$> (parseJSONObject o))
1307− (o .:? "kind") <*> (o .:? "name") <*> (o .:? "id"))
1309−instance ToJSON KeyPathElement where
1085+instance ToJSON GqlQueryNamedBindings where
1310− toJSON KeyPathElement'{..}
1086+ toJSON = toJSON . _gqnbAddtional
1313− [("kind" .=) <$> _kpeKind, ("name" .=) <$> _kpeName,
1314− ("id" .=) <$> _kpeId])
1316-- | A reference to a property relative to the kind expressions.
1088-- | A reference to a property relative to the kind expressions.
@@ -1332,7 +1104,8 @@ propertyReference =
1332 { _prName = Nothing
1104 { _prName = Nothing
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.
1336prName :: Lens' PropertyReference (Maybe Text)
1109prName :: Lens' PropertyReference (Maybe Text)
1337prName = lens _prName (\ s a -> s{_prName = a})
1110prName = lens _prName (\ s a -> s{_prName = a})
@@ -1345,68 +1118,15 @@ instance ToJSON PropertyReference where
1345 toJSON PropertyReference'{..}
1118 toJSON PropertyReference'{..}
1346 = object (catMaybes [("name" .=) <$> _prName])
1119 = object (catMaybes [("name" .=) <$> _prName])
1348−-- | A binding argument for a GQL query.
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)
1357−-- | Creates a value of 'GqlQueryArg' with the minimum fields required to make a request.
1359−-- Use one of the following lenses to modify other fields as desired:
1370− { _gqaCursor = Nothing
1371− , _gqaValue = Nothing
1372− , _gqaName = Nothing
1375−gqaCursor :: Lens' GqlQueryArg (Maybe Word8)
1377− = lens _gqaCursor (\ s a -> s{_gqaCursor = a}) .
1380−gqaValue :: Lens' GqlQueryArg (Maybe Value)
1381−gqaValue = lens _gqaValue (\ s a -> s{_gqaValue = a})
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})
1388−instance FromJSON GqlQueryArg where
1390− = withObject "GqlQueryArg"
1393− (o .:? "cursor") <*> (o .:? "value") <*>
1396−instance ToJSON GqlQueryArg where
1397− toJSON GqlQueryArg'{..}
1400− [("cursor" .=) <$> _gqaCursor,
1401− ("value" .=) <$> _gqaValue,
1402− ("name" .=) <$> _gqaName])
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.
1406-- /See:/ 'key' smart constructor.
1126-- /See:/ 'key' smart constructor.
1407data Key = Key'
1127data Key = Key'
1408 { _kPartitionId :: !(Maybe PartitionId)
1128 { _kPartitionId :: !(Maybe PartitionId)
1409− , _kPath :: !(Maybe [KeyPathElement])
1129+ , _kPath :: !(Maybe [PathElement])
1410 } deriving (Eq,Show,Data,Typeable,Generic)
1130 } deriving (Eq,Show,Data,Typeable,Generic)
1412-- | Creates a value of 'Key' with the minimum fields required to make a request.
1132-- | Creates a value of 'Key' with the minimum fields required to make a request.
@@ -1424,25 +1144,26 @@ key =
1424 , _kPath = Nothing
1144 , _kPath = Nothing
1427−-- | Entities are partitioned into subsets, currently identified by a dataset
1147+-- | Entities are partitioned into subsets, currently identified by a project
1428−-- (usually implicitly specified by the project) and namespace ID. Queries
1429−-- are scoped to a single partition.
1148+-- ID and namespace ID. Queries are scoped to a single partition.
1430kPartitionId :: Lens' Key (Maybe PartitionId)
1149kPartitionId :: Lens' Key (Maybe PartitionId)
1431kPartitionId
1150kPartitionId
1432 = lens _kPartitionId (\ s a -> s{_kPartitionId = a})
1151 = lens _kPartitionId (\ s a -> s{_kPartitionId = a})
1434-- | The entity path. An entity path consists of one or more elements
1153-- | The entity path. An entity path consists of one or more elements
1435-- composed of a kind and a string or numerical identifier, which identify
1154-- composed of a kind and a string or numerical identifier, which identify
1436−-- entities. The first element identifies a root entity, the second element
1155+-- entities. The first element identifies a _root entity_, the second
1437−-- identifies a child of the root entity, the third element a child of the
1156+-- element identifies a _child_ of the root entity, the third element
1438−-- second entity, and so forth. The entities identified by all prefixes of
1157+-- identifies a child of the second entity, and so forth. The entities
1439−-- the path are called the element\'s ancestors. An entity path is always
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
1440−-- fully complete: ALL of the entity\'s ancestors are required to be in the
1160+-- entity\'s ancestors are required to be in the path along with the entity
1441−-- path along with the entity identifier itself. The only exception is that
1161+-- identifier itself. The only exception is that in some documented cases,
1442−-- in some documented cases, the identifier in the last path element (for
1162+-- the identifier in the last path element (for the entity) itself may be
1443−-- the entity) itself may be omitted. A path can never be empty. The path
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,
1444−-- can have at most 100 elements.
1165+-- and a path can have at most 100 elements.
1445−kPath :: Lens' Key [KeyPathElement]
1166+kPath :: Lens' Key [PathElement]
1447 = lens _kPath (\ s a -> s{_kPath = a}) . _Default .
1168 = lens _kPath (\ s a -> s{_kPath = a}) . _Default .
@@ -1466,7 +1187,7 @@ instance ToJSON Key where
1466-- /See:/ 'propertyFilter' smart constructor.
1187-- /See:/ 'propertyFilter' smart constructor.
1467data PropertyFilter = PropertyFilter'
1188data PropertyFilter = PropertyFilter'
1468 { _pfProperty :: !(Maybe PropertyReference)
1189 { _pfProperty :: !(Maybe PropertyReference)
1469− , _pfOperator :: !(Maybe PropertyFilterOperator)
1190+ , _pfOp :: !(Maybe PropertyFilterOp)
1470 , _pfValue :: !(Maybe Value)
1191 , _pfValue :: !(Maybe Value)
1471 } deriving (Eq,Show,Data,Typeable,Generic)
1192 } deriving (Eq,Show,Data,Typeable,Generic)
@@ -1476,7 +1197,7 @@ data PropertyFilter = PropertyFilter'
1477-- * 'pfProperty'
1198-- * 'pfProperty'
1479−-- * 'pfOperator'
1200+-- * 'pfOp'
1481-- * 'pfValue'
1202-- * 'pfValue'
1482propertyFilter
1203propertyFilter
@@ -1484,7 +1205,7 @@ propertyFilter
1484propertyFilter =
1205propertyFilter =
1485 PropertyFilter'
1206 PropertyFilter'
1486 { _pfProperty = Nothing
1207 { _pfProperty = Nothing
1487− , _pfOperator = Nothing
1208+ , _pfOp = Nothing
1488 , _pfValue = Nothing
1209 , _pfValue = Nothing
@@ -1493,11 +1214,9 @@ pfProperty :: Lens' PropertyFilter (Maybe PropertyReference)
1493pfProperty
1214pfProperty
1494 = lens _pfProperty (\ s a -> s{_pfProperty = a})
1215 = lens _pfProperty (\ s a -> s{_pfProperty = a})
1496−-- | The operator to filter by. One of lessThan, lessThanOrEqual,
1217+-- | The operator to filter by.
1497−-- greaterThan, greaterThanOrEqual, equal, or hasAncestor.
1498−pfOperator :: Lens' PropertyFilter (Maybe PropertyFilterOperator)
1218+pfOp :: Lens' PropertyFilter (Maybe PropertyFilterOp)
1499−pfOperator
1219+pfOp = lens _pfOp (\ s a -> s{_pfOp = a})
1500− = lens _pfOperator (\ s a -> s{_pfOperator = a})
1502-- | The value to compare the property to.
1221-- | The value to compare the property to.
1503pfValue :: Lens' PropertyFilter (Maybe Value)
1222pfValue :: Lens' PropertyFilter (Maybe Value)
@@ -1508,7 +1227,7 @@ instance FromJSON PropertyFilter where
1508 = withObject "PropertyFilter"
1227 = withObject "PropertyFilter"
1510 PropertyFilter' <$>
1229 PropertyFilter' <$>
1511− (o .:? "property") <*> (o .:? "operator") <*>
1230+ (o .:? "property") <*> (o .:? "op") <*>
1512 (o .:? "value"))
1231 (o .:? "value"))
1514instance ToJSON PropertyFilter where
1233instance ToJSON PropertyFilter where
@@ -1516,21 +1235,20 @@ instance ToJSON PropertyFilter where
1516 = object
1235 = object
1517 (catMaybes
1236 (catMaybes
1518 [("property" .=) <$> _pfProperty,
1237 [("property" .=) <$> _pfProperty,
1519− ("operator" .=) <$> _pfOperator,
1520− ("value" .=) <$> _pfValue])
1238+ ("op" .=) <$> _pfOp, ("value" .=) <$> _pfValue])
1522−-- | A query.
1240+-- | A query for entities.
1524-- /See:/ 'query' smart constructor.
1242-- /See:/ 'query' smart constructor.
1525data Query = Query'
1243data Query = Query'
1526− { _qGroupBy :: !(Maybe [PropertyReference])
1527− , _qStartCursor :: !(Maybe (Textual Word8))
1244+ { _qStartCursor :: !(Maybe (Textual Word8))
1528 , _qOffSet :: !(Maybe (Textual Int32))
1245 , _qOffSet :: !(Maybe (Textual Int32))
1246+ , _qKind :: !(Maybe [KindExpression])
1247+ , _qDistinctOn :: !(Maybe [PropertyReference])
1529 , _qEndCursor :: !(Maybe (Textual Word8))
1248 , _qEndCursor :: !(Maybe (Textual Word8))
1530 , _qLimit :: !(Maybe (Textual Int32))
1249 , _qLimit :: !(Maybe (Textual Int32))
1531− , _qProjection :: !(Maybe [PropertyExpression])
1250+ , _qProjection :: !(Maybe [Projection])
1532 , _qFilter :: !(Maybe Filter)
1251 , _qFilter :: !(Maybe Filter)
1533− , _qKinds :: !(Maybe [KindExpression])
1534 , _qOrder :: !(Maybe [PropertyOrder])
1252 , _qOrder :: !(Maybe [PropertyOrder])
1535 } deriving (Eq,Show,Data,Typeable,Generic)
1253 } deriving (Eq,Show,Data,Typeable,Generic)
@@ -1538,12 +1256,14 @@ data Query = Query'
1539-- Use one of the following lenses to modify other fields as desired:
1257-- Use one of the following lenses to modify other fields as desired:
1543-- * 'qStartCursor'
1259-- * 'qStartCursor'
1545-- * 'qOffSet'
1261-- * 'qOffSet'
1547-- * 'qEndCursor'
1267-- * 'qEndCursor'
1549-- * 'qLimit'
1269-- * 'qLimit'
@@ -1552,77 +1272,78 @@ data Query = Query'
1553-- * 'qFilter'
1273-- * 'qFilter'
1557-- * 'qOrder'
1275-- * 'qOrder'
1559 :: Query
1277 :: Query
1562− { _qGroupBy = Nothing
1563− , _qStartCursor = Nothing
1280+ { _qStartCursor = Nothing
1564 , _qOffSet = Nothing
1281 , _qOffSet = Nothing
1283+ , _qDistinctOn = Nothing
1565 , _qEndCursor = Nothing
1284 , _qEndCursor = Nothing
1566 , _qLimit = Nothing
1285 , _qLimit = Nothing
1567 , _qProjection = Nothing
1286 , _qProjection = Nothing
1568 , _qFilter = Nothing
1287 , _qFilter = Nothing
1569− , _qKinds = Nothing
1570 , _qOrder = Nothing
1288 , _qOrder = Nothing
1573−-- | The properties to group by (if empty, no grouping is applied to the
1575−qGroupBy :: Lens' Query [PropertyReference]
1577− = lens _qGroupBy (\ s a -> s{_qGroupBy = a}) .
1581−-- | A starting point for the query results. Optional. Query cursors are
1291+-- | A starting point for the query results. Query cursors are returned in
1582−-- returned in query result batches.
1292+-- query result batches.
1583qStartCursor :: Lens' Query (Maybe Word8)
1293qStartCursor :: Lens' Query (Maybe Word8)
1584qStartCursor
1294qStartCursor
1585 = lens _qStartCursor (\ s a -> s{_qStartCursor = a})
1295 = lens _qStartCursor (\ s a -> s{_qStartCursor = a})
1586 . mapping _Coerce
1296 . mapping _Coerce
1588-- | The number of results to skip. Applies before limit, but after all other
1298-- | 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.
1590qOffSet :: Lens' Query (Maybe Int32)
1300qOffSet :: Lens' Query (Maybe Int32)
1592 = lens _qOffSet (\ s a -> s{_qOffSet = a}) .
1302 = lens _qOffSet (\ s a -> s{_qOffSet = a}) .
1593 mapping _Coerce
1303 mapping _Coerce
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]
1309+ = lens _qKind (\ s a -> s{_qKind = a}) . _Default .
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]
1317+ = lens _qDistinctOn (\ s a -> s{_qDistinctOn = a}) .
1595−-- | An ending point for the query results. Optional. Query cursors are
1321+-- | An ending point for the query results. Query cursors are returned in
1596−-- returned in query result batches.
1322+-- query result batches.
1597qEndCursor :: Lens' Query (Maybe Word8)
1323qEndCursor :: Lens' Query (Maybe Word8)
1598qEndCursor
1324qEndCursor
1599 = lens _qEndCursor (\ s a -> s{_qEndCursor = a}) .
1325 = lens _qEndCursor (\ s a -> s{_qEndCursor = a}) .
1600 mapping _Coerce
1326 mapping _Coerce
1602-- | The maximum number of results to return. Applies after all other
1328-- | 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.
1604qLimit :: Lens' Query (Maybe Int32)
1331qLimit :: Lens' Query (Maybe Int32)
1606 = lens _qLimit (\ s a -> s{_qLimit = a}) .
1333 = lens _qLimit (\ s a -> s{_qLimit = a}) .
1607 mapping _Coerce
1334 mapping _Coerce
1609−-- | The projection to return. If not set the entire entity is returned.
1336+-- | The projection to return. Defaults to returning all properties.
1610−qProjection :: Lens' Query [PropertyExpression]
1337+qProjection :: Lens' Query [Projection]
1611qProjection
1338qProjection
1612 = lens _qProjection (\ s a -> s{_qProjection = a}) .
1339 = lens _qProjection (\ s a -> s{_qProjection = a}) .
1613 _Default
1340 _Default
1614 . _Coerce
1341 . _Coerce
1616−-- | The filter to apply (optional).
1343+-- | The filter to apply.
1617qFilter :: Lens' Query (Maybe Filter)
1344qFilter :: Lens' Query (Maybe Filter)
1618qFilter = lens _qFilter (\ s a -> s{_qFilter = a})
1345qFilter = lens _qFilter (\ s a -> s{_qFilter = a})
1620−-- | The kinds to query (if empty, returns entities from all kinds).
1621−qKinds :: Lens' Query [KindExpression]
1623− = lens _qKinds (\ s a -> s{_qKinds = a}) . _Default .
1626-- | The order to apply to the query results (if empty, order is
1347-- | The order to apply to the query results (if empty, order is
1627-- unspecified).
1348-- unspecified).
1628qOrder :: Lens' Query [PropertyOrder]
1349qOrder :: Lens' Query [PropertyOrder]
@@ -1635,48 +1356,94 @@ instance FromJSON Query where
1635 = withObject "Query"
1356 = withObject "Query"
1637 Query' <$>
1358 Query' <$>
1638− (o .:? "groupBy" .!= mempty) <*>
1639− (o .:? "startCursor")
1359+ (o .:? "startCursor") <*> (o .:? "offset") <*>
1640− <*> (o .:? "offset")
1360+ (o .:? "kind" .!= mempty)
1361+ <*> (o .:? "distinctOn" .!= mempty)
1641 <*> (o .:? "endCursor")
1362 <*> (o .:? "endCursor")
1642 <*> (o .:? "limit")
1363 <*> (o .:? "limit")
1643 <*> (o .:? "projection" .!= mempty)
1364 <*> (o .:? "projection" .!= mempty)
1644 <*> (o .:? "filter")
1365 <*> (o .:? "filter")
1645− <*> (o .:? "kinds" .!= mempty)
1646 <*> (o .:? "order" .!= mempty))
1366 <*> (o .:? "order" .!= mempty))
1648instance ToJSON Query where
1368instance ToJSON Query where
1649 toJSON Query'{..}
1369 toJSON Query'{..}
1650 = object
1370 = object
1651 (catMaybes
1371 (catMaybes
1652− [("groupBy" .=) <$> _qGroupBy,
1653− ("startCursor" .=) <$> _qStartCursor,
1372+ [("startCursor" .=) <$> _qStartCursor,
1654− ("offset" .=) <$> _qOffSet,
1373+ ("offset" .=) <$> _qOffSet, ("kind" .=) <$> _qKind,
1374+ ("distinctOn" .=) <$> _qDistinctOn,
1655 ("endCursor" .=) <$> _qEndCursor,
1375 ("endCursor" .=) <$> _qEndCursor,
1656 ("limit" .=) <$> _qLimit,
1376 ("limit" .=) <$> _qLimit,
1657 ("projection" .=) <$> _qProjection,
1377 ("projection" .=) <$> _qProjection,
1658− ("filter" .=) <$> _qFilter, ("kinds" .=) <$> _qKinds,
1378+ ("filter" .=) <$> _qFilter,
1659 ("order" .=) <$> _qOrder])
1379 ("order" .=) <$> _qOrder])
1381+-- | An array value.
1383+-- /See:/ 'arrayValue' smart constructor.
1384+newtype ArrayValue = ArrayValue'
1385+ { _avValues :: Maybe [Value]
1386+ } deriving (Eq,Show,Data,Typeable,Generic)
1388+-- | Creates a value of 'ArrayValue' with the minimum fields required to make a request.
1390+-- Use one of the following lenses to modify other fields as desired:
1397+ { _avValues = Nothing
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]
1404+ = lens _avValues (\ s a -> s{_avValues = a}) .
1408+instance FromJSON ArrayValue where
1410+ = withObject "ArrayValue"
1411+ (\ o -> ArrayValue' <$> (o .:? "values" .!= mempty))
1413+instance ToJSON ArrayValue where
1414+ toJSON ArrayValue'{..}
1415+ = object (catMaybes [("values" .=) <$> _avValues])
1661−-- | The result of fetching an entity from the datastore.
1417+-- | The result of fetching an entity from Datastore.
1663-- /See:/ 'entityResult' smart constructor.
1419-- /See:/ 'entityResult' smart constructor.
1664−newtype EntityResult = EntityResult'
1420+data EntityResult = EntityResult'
1421+ { _erCursor :: !(Maybe (Textual Word8))
1665− { _erEntity :: Maybe Entity
1422+ , _erEntity :: !(Maybe Entity)
1666 } deriving (Eq,Show,Data,Typeable,Generic)
1423 } deriving (Eq,Show,Data,Typeable,Generic)
1668-- | Creates a value of 'EntityResult' with the minimum fields required to make a request.
1425-- | Creates a value of 'EntityResult' with the minimum fields required to make a request.
1670-- Use one of the following lenses to modify other fields as desired:
1427-- Use one of the following lenses to modify other fields as desired:
1672-- * 'erEntity'
1431-- * 'erEntity'
1673entityResult
1432entityResult
1674 :: EntityResult
1433 :: EntityResult
1675entityResult =
1434entityResult =
1676 EntityResult'
1435 EntityResult'
1436+ { _erCursor = Nothing
1677− { _erEntity = Nothing
1437+ , _erEntity = Nothing
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)
1444+ = lens _erCursor (\ s a -> s{_erCursor = a}) .
1680-- | The resulting entity.
1447-- | The resulting entity.
1681erEntity :: Lens' EntityResult (Maybe Entity)
1448erEntity :: Lens' EntityResult (Maybe Entity)
1682erEntity = lens _erEntity (\ s a -> s{_erEntity = a})
1449erEntity = lens _erEntity (\ s a -> s{_erEntity = a})
@@ -1684,56 +1451,71 @@ erEntity = lens _erEntity (\ s a -> s{_erEntity = a})
1684instance FromJSON EntityResult where
1451instance FromJSON EntityResult where
1685 parseJSON
1452 parseJSON
1686 = withObject "EntityResult"
1453 = withObject "EntityResult"
1687− (\ o -> EntityResult' <$> (o .:? "entity"))
1455+ EntityResult' <$>
1456+ (o .:? "cursor") <*> (o .:? "entity"))
1689instance ToJSON EntityResult where
1458instance ToJSON EntityResult where
1690 toJSON EntityResult'{..}
1459 toJSON EntityResult'{..}
1462+ [("cursor" .=) <$> _erCursor,
1691− = object (catMaybes [("entity" .=) <$> _erEntity])
1463+ ("entity" .=) <$> _erEntity])
1465+-- | The response for google.datastore.v1beta3.Datastore.Commit.
1694-- /See:/ 'commitResponse' smart constructor.
1467-- /See:/ 'commitResponse' smart constructor.
1695data CommitResponse = CommitResponse'
1468data CommitResponse = CommitResponse'
1696− { _crMutationResult :: !(Maybe MutationResult)
1469+ { _crIndexUpdates :: !(Maybe (Textual Int32))
1697− , _crHeader :: !(Maybe ResponseHeader)
1470+ , _crMutationResults :: !(Maybe [MutationResult])
1698 } deriving (Eq,Show,Data,Typeable,Generic)
1471 } deriving (Eq,Show,Data,Typeable,Generic)
1700-- | Creates a value of 'CommitResponse' with the minimum fields required to make a request.
1473-- | Creates a value of 'CommitResponse' with the minimum fields required to make a request.
1702-- Use one of the following lenses to modify other fields as desired:
1475-- Use one of the following lenses to modify other fields as desired:
1704−-- * 'crMutationResult'
1477+-- * 'crIndexUpdates'
1706−-- * 'crHeader'
1479+-- * 'crMutationResults'
1707commitResponse
1480commitResponse
1708 :: CommitResponse
1481 :: CommitResponse
1709commitResponse =
1482commitResponse =
1710 CommitResponse'
1483 CommitResponse'
1711− { _crMutationResult = Nothing
1484+ { _crIndexUpdates = Nothing
1712− , _crHeader = Nothing
1485+ , _crMutationResults = Nothing
1715−-- | The result of performing the mutation (if any).
1488+-- | The number of index entries updated during the commit, or zero if none
1716−crMutationResult :: Lens' CommitResponse (Maybe MutationResult)
1490+crIndexUpdates :: Lens' CommitResponse (Maybe Int32)
1717−crMutationResult
1491+crIndexUpdates
1718− = lens _crMutationResult
1492+ = lens _crIndexUpdates
1719− (\ s a -> s{_crMutationResult = a})
1493+ (\ s a -> s{_crIndexUpdates = a})
1721−crHeader :: Lens' CommitResponse (Maybe ResponseHeader)
1496+-- | The result of performing the mutations. The i-th mutation result
1722−crHeader = lens _crHeader (\ s a -> s{_crHeader = a})
1497+-- corresponds to the i-th mutation in the request.
1498+crMutationResults :: Lens' CommitResponse [MutationResult]
1500+ = lens _crMutationResults
1501+ (\ s a -> s{_crMutationResults = a})
1724instance FromJSON CommitResponse where
1505instance FromJSON CommitResponse where
1725 parseJSON
1506 parseJSON
1726 = withObject "CommitResponse"
1507 = withObject "CommitResponse"
1728 CommitResponse' <$>
1509 CommitResponse' <$>
1729− (o .:? "mutationResult") <*> (o .:? "header"))
1510+ (o .:? "indexUpdates") <*>
1511+ (o .:? "mutationResults" .!= mempty))
1731instance ToJSON CommitResponse where
1513instance ToJSON CommitResponse where
1732 toJSON CommitResponse'{..}
1514 toJSON CommitResponse'{..}
1733 = object
1515 = object
1734 (catMaybes
1516 (catMaybes
1735− [("mutationResult" .=) <$> _crMutationResult,
1517+ [("indexUpdates" .=) <$> _crIndexUpdates,
1736− ("header" .=) <$> _crHeader])
1518+ ("mutationResults" .=) <$> _crMutationResults])
1738-- | A representation of a kind.
1520-- | A representation of a kind.
@@ -1767,6 +1549,7 @@ instance ToJSON KindExpression where
1767 toJSON KindExpression'{..}
1549 toJSON KindExpression'{..}
1768 = object (catMaybes [("name" .=) <$> _keName])
1550 = object (catMaybes [("name" .=) <$> _keName])
1552+-- | The options shared by read requests.
1771-- /See:/ 'readOptions' smart constructor.
1554-- /See:/ 'readOptions' smart constructor.
1772data ReadOptions = ReadOptions'
1555data ReadOptions = ReadOptions'
@@ -1789,16 +1572,14 @@ readOptions =
1789 , _roTransaction = Nothing
1572 , _roTransaction = Nothing
1792−-- | The read consistency to use. One of default, strong, or eventual. Cannot
1575+-- | The non-transactional read consistency to use. Cannot be set to
1793−-- be set when transaction is set. Lookup and ancestor queries default to
1576+-- \`STRONG\` for global queries.
1794−-- strong, global queries default to eventual and cannot be set to strong.
1795−-- Optional. Default is default.
1796roReadConsistency :: Lens' ReadOptions (Maybe ReadOptionsReadConsistency)
1577roReadConsistency :: Lens' ReadOptions (Maybe ReadOptionsReadConsistency)
1797roReadConsistency
1578roReadConsistency
1798 = lens _roReadConsistency
1579 = lens _roReadConsistency
1799 (\ s a -> s{_roReadConsistency = a})
1580 (\ s a -> s{_roReadConsistency = a})
1801−-- | The transaction to use. Optional.
1582+-- | The transaction in which to read.
1802roTransaction :: Lens' ReadOptions (Maybe Word8)
1583roTransaction :: Lens' ReadOptions (Maybe Word8)
1803roTransaction
1584roTransaction
1804 = lens _roTransaction
1585 = lens _roTransaction
@@ -1819,90 +1600,62 @@ instance ToJSON ReadOptions where
1819 [("readConsistency" .=) <$> _roReadConsistency,
1600 [("readConsistency" .=) <$> _roReadConsistency,
1820 ("transaction" .=) <$> _roTransaction])
1601 ("transaction" .=) <$> _roTransaction])
1603+-- | The response for google.datastore.v1beta3.Datastore.Rollback (an empty
1823-- /See:/ 'rollbackResponse' smart constructor.
1606-- /See:/ 'rollbackResponse' smart constructor.
1607+data RollbackResponse =
1824−newtype RollbackResponse = RollbackResponse'
1608+ RollbackResponse'
1825− { _rrHeader :: Maybe ResponseHeader
1826− } deriving (Eq,Show,Data,Typeable,Generic)
1609+ deriving (Eq,Show,Data,Typeable,Generic)
1828-- | Creates a value of 'RollbackResponse' with the minimum fields required to make a request.
1611-- | Creates a value of 'RollbackResponse' with the minimum fields required to make a request.
1830−-- Use one of the following lenses to modify other fields as desired:
1833rollbackResponse
1613rollbackResponse
1834 :: RollbackResponse
1614 :: RollbackResponse
1835−rollbackResponse =
1615+rollbackResponse = RollbackResponse'
1837− { _rrHeader = Nothing
1840−rrHeader :: Lens' RollbackResponse (Maybe ResponseHeader)
1841−rrHeader = lens _rrHeader (\ s a -> s{_rrHeader = a})
1843instance FromJSON RollbackResponse where
1617instance FromJSON RollbackResponse where
1844 parseJSON
1618 parseJSON
1845 = withObject "RollbackResponse"
1619 = withObject "RollbackResponse"
1846− (\ o -> RollbackResponse' <$> (o .:? "header"))
1620+ (\ o -> pure RollbackResponse')
1848instance ToJSON RollbackResponse where
1622instance ToJSON RollbackResponse where
1849− toJSON RollbackResponse'{..}
1623+ toJSON = const emptyObject
1850− = object (catMaybes [("header" .=) <$> _rrHeader])
1852-- | A representation of a property in a projection.
1625-- | A representation of a property in a projection.
1854−-- /See:/ 'propertyExpression' smart constructor.
1627+-- /See:/ 'projection' smart constructor.
1855−data PropertyExpression = PropertyExpression'
1628+newtype Projection = Projection'
1856− { _peProperty :: !(Maybe PropertyReference)
1629+ { _pProperty :: Maybe PropertyReference
1857− , _peAggregationFunction :: !(Maybe PropertyExpressionAggregationFunction)
1858 } deriving (Eq,Show,Data,Typeable,Generic)
1630 } deriving (Eq,Show,Data,Typeable,Generic)
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.
1862-- Use one of the following lenses to modify other fields as desired:
1634-- Use one of the following lenses to modify other fields as desired:
1864−-- * 'peProperty'
1636+-- * 'pProperty'
1866−-- * 'peAggregationFunction'
1638+ :: Projection
1867−propertyExpression
1639+projection =
1868− :: PropertyExpression
1640+ Projection'
1869−propertyExpression =
1641+ { _pProperty = Nothing
1870− PropertyExpression'
1871− { _peProperty = Nothing
1872− , _peAggregationFunction = Nothing
1875-- | The property to project.
1644-- | The property to project.
1876−peProperty :: Lens' PropertyExpression (Maybe PropertyReference)
1645+pProperty :: Lens' Projection (Maybe PropertyReference)
1877−peProperty
1646+pProperty
1878− = lens _peProperty (\ s a -> s{_peProperty = a})
1647+ = lens _pProperty (\ s a -> s{_pProperty = a})
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
1885−peAggregationFunction :: Lens' PropertyExpression (Maybe PropertyExpressionAggregationFunction)
1886−peAggregationFunction
1887− = lens _peAggregationFunction
1888− (\ s a -> s{_peAggregationFunction = a})
1890−instance FromJSON PropertyExpression where
1649+instance FromJSON Projection where
1891 parseJSON
1650 parseJSON
1892− = withObject "PropertyExpression"
1651+ = withObject "Projection"
1893− (\ o ->
1652+ (\ o -> Projection' <$> (o .:? "property"))
1894− PropertyExpression' <$>
1895− (o .:? "property") <*> (o .:? "aggregationFunction"))
1897−instance ToJSON PropertyExpression where
1654+instance ToJSON Projection where
1898− toJSON PropertyExpression'{..}
1655+ toJSON Projection'{..}
1900− (catMaybes
1656+ = object (catMaybes [("property" .=) <$> _pProperty])
1901− [("property" .=) <$> _peProperty,
1902− ("aggregationFunction" .=) <$>
1903− _peAggregationFunction])
1905−-- | A holder for any type of filter. Exactly one field should be specified.
1658+-- | A holder for any type of filter.
1907-- /See:/ 'filter'' smart constructor.
1660-- /See:/ 'filter'' smart constructor.
1908data Filter = Filter'
1661data Filter = Filter'
@@ -1952,78 +1705,139 @@ instance ToJSON Filter where
1952 [("compositeFilter" .=) <$> _fCompositeFilter,
1705 [("compositeFilter" .=) <$> _fCompositeFilter,
1953 ("propertyFilter" .=) <$> _fPropertyFilter])
1706 ("propertyFilter" .=) <$> _fPropertyFilter])
1708+-- | The request for google.datastore.v1beta3.Datastore.Commit.
1956-- /See:/ 'commitRequest' smart constructor.
1710-- /See:/ 'commitRequest' smart constructor.
1957data CommitRequest = CommitRequest'
1711data CommitRequest = CommitRequest'
1712+ { _crMutations :: !(Maybe [Mutation])
1958− { _crMode :: !(Maybe CommitRequestMode)
1713+ , _crMode :: !(Maybe CommitRequestMode)
1959− , _crMutation :: !(Maybe Mutation)
1960− , _crTransaction :: !(Maybe (Textual Word8))
1714+ , _crTransaction :: !(Maybe (Textual Word8))
1961− , _crIgnoreReadOnly :: !(Maybe Bool)
1962 } deriving (Eq,Show,Data,Typeable,Generic)
1715 } deriving (Eq,Show,Data,Typeable,Generic)
1964-- | Creates a value of 'CommitRequest' with the minimum fields required to make a request.
1717-- | Creates a value of 'CommitRequest' with the minimum fields required to make a request.
1966-- Use one of the following lenses to modify other fields as desired:
1719-- Use one of the following lenses to modify other fields as desired:
1968−-- * 'crMode'
1721+-- * 'crMutations'
1970−-- * 'crMutation'
1723+-- * 'crMode'
1972-- * 'crTransaction'
1725-- * 'crTransaction'
1974−-- * 'crIgnoreReadOnly'
1975commitRequest
1726commitRequest
1976 :: CommitRequest
1727 :: CommitRequest
1977commitRequest =
1728commitRequest =
1978 CommitRequest'
1729 CommitRequest'
1979− { _crMode = Nothing
1730+ { _crMutations = Nothing
1980− , _crMutation = Nothing
1731+ , _crMode = Nothing
1981 , _crTransaction = Nothing
1732 , _crTransaction = Nothing
1982− , _crIgnoreReadOnly = Nothing
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]
1744+ = lens _crMutations (\ s a -> s{_crMutations = a}) .
1985−-- | The type of commit to perform. Either TRANSACTIONAL or
1748+-- | The type of commit to perform. Defaults to \`TRANSACTIONAL\`.
1986−-- NON_TRANSACTIONAL.
1987crMode :: Lens' CommitRequest (Maybe CommitRequestMode)
1749crMode :: Lens' CommitRequest (Maybe CommitRequestMode)
1988crMode = lens _crMode (\ s a -> s{_crMode = a})
1750crMode = lens _crMode (\ s a -> s{_crMode = a})
1990−-- | The mutation to perform. Optional.
1752+-- | The identifier of the transaction associated with the commit. A
1991−crMutation :: Lens' CommitRequest (Maybe Mutation)
1993− = lens _crMutation (\ s a -> s{_crMutation = a})
1995−-- | The transaction identifier, returned by a call to beginTransaction. Must
1753+-- transaction identifier is returned by a call to BeginTransaction.
1996−-- be set when mode is TRANSACTIONAL.
1997crTransaction :: Lens' CommitRequest (Maybe Word8)
1754crTransaction :: Lens' CommitRequest (Maybe Word8)
1998crTransaction
1755crTransaction
1999 = lens _crTransaction
1756 = lens _crTransaction
2000 (\ s a -> s{_crTransaction = a})
1757 (\ s a -> s{_crTransaction = a})
2001 . mapping _Coerce
1758 . mapping _Coerce
2003−crIgnoreReadOnly :: Lens' CommitRequest (Maybe Bool)
2005− = lens _crIgnoreReadOnly
2006− (\ s a -> s{_crIgnoreReadOnly = a})
2008instance FromJSON CommitRequest where
1760instance FromJSON CommitRequest where
2009 parseJSON
1761 parseJSON
2010 = withObject "CommitRequest"
1762 = withObject "CommitRequest"
2012 CommitRequest' <$>
1764 CommitRequest' <$>
2013− (o .:? "mode") <*> (o .:? "mutation") <*>
1765+ (o .:? "mutations" .!= mempty) <*> (o .:? "mode") <*>
2014− (o .:? "transaction")
1766+ (o .:? "transaction"))
2015− <*> (o .:? "ignoreReadOnly"))
2017instance ToJSON CommitRequest where
1768instance ToJSON CommitRequest where
2018 toJSON CommitRequest'{..}
1769 toJSON CommitRequest'{..}
2019 = object
1770 = object
2020 (catMaybes
1771 (catMaybes
1772+ [("mutations" .=) <$> _crMutations,
2021− [("mode" .=) <$> _crMode,
1773+ ("mode" .=) <$> _crMode,
2022− ("mutation" .=) <$> _crMutation,
2023− ("transaction" .=) <$> _crTransaction,
1774+ ("transaction" .=) <$> _crTransaction])
2024− ("ignoreReadOnly" .=) <$> _crIgnoreReadOnly])
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
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)
2026−-- | An entity.
1787+-- | Creates a value of 'PathElement' with the minimum fields required to make a request.
1789+-- Use one of the following lenses to modify other fields as desired:
1800+ { _peKind = Nothing
1801+ , _peName = Nothing
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})
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})
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)
1821+ = lens _peId (\ s a -> s{_peId = a}) .
1824+instance FromJSON PathElement where
1826+ = withObject "PathElement"
1829+ (o .:? "kind") <*> (o .:? "name") <*> (o .:? "id"))
1831+instance ToJSON PathElement where
1832+ toJSON PathElement'{..}
1835+ [("kind" .=) <$> _peKind, ("name" .=) <$> _peName,
1836+ ("id" .=) <$> _peId])
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.
2028-- /See:/ 'entity' smart constructor.
1842-- /See:/ 'entity' smart constructor.
2029data Entity = Entity'
1843data Entity = Entity'
@@ -2047,13 +1861,16 @@ entity =
2049-- | The entity\'s key. An entity must have a key, unless otherwise
1863-- | The entity\'s key. An entity must have a key, unless otherwise
2050−-- documented (for example, an entity in Value.entityValue may have no
1864+-- documented (for example, an entity in \`Value.entity_value\` may have no
2051−-- key). An entity\'s kind is its key\'s path\'s last element\'s kind, or
1865+-- key). An entity\'s kind is its key path\'s last element\'s kind, or null
2052−-- null if it has no key.
1866+-- if it has no key.
2053eKey :: Lens' Entity (Maybe Key)
1867eKey :: Lens' Entity (Maybe Key)
2054eKey = lens _eKey (\ s a -> s{_eKey = a})
1868eKey = lens _eKey (\ s a -> s{_eKey = a})
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 \`\"\"\`.
2057eProperties :: Lens' Entity (Maybe EntityProperties)
1874eProperties :: Lens' Entity (Maybe EntityProperties)
2058eProperties
1875eProperties
2059 = lens _eProperties (\ s a -> s{_eProperties = a})
1876 = lens _eProperties (\ s a -> s{_eProperties = a})
@@ -2071,13 +1888,13 @@ instance ToJSON Entity where
2071 [("key" .=) <$> _eKey,
1888 [("key" .=) <$> _eKey,
2072 ("properties" .=) <$> _eProperties])
1889 ("properties" .=) <$> _eProperties])
1891+-- | The response for google.datastore.v1beta3.Datastore.Lookup.
2075-- /See:/ 'lookupResponse' smart constructor.
1893-- /See:/ 'lookupResponse' smart constructor.
2076data LookupResponse = LookupResponse'
1894data LookupResponse = LookupResponse'
2077 { _lrDeferred :: !(Maybe [Key])
1895 { _lrDeferred :: !(Maybe [Key])
2078 , _lrFound :: !(Maybe [EntityResult])
1896 , _lrFound :: !(Maybe [EntityResult])
2079 , _lrMissing :: !(Maybe [EntityResult])
1897 , _lrMissing :: !(Maybe [EntityResult])
2080− , _lrHeader :: !(Maybe ResponseHeader)
2081 } deriving (Eq,Show,Data,Typeable,Generic)
1898 } deriving (Eq,Show,Data,Typeable,Generic)
2083-- | Creates a value of 'LookupResponse' with the minimum fields required to make a request.
1900-- | Creates a value of 'LookupResponse' with the minimum fields required to make a request.
@@ -2089,8 +1906,6 @@ data LookupResponse = LookupResponse'
2089-- * 'lrFound'
1906-- * 'lrFound'
2091-- * 'lrMissing'
1908-- * 'lrMissing'
2094lookupResponse
1909lookupResponse
2095 :: LookupResponse
1910 :: LookupResponse
2096lookupResponse =
1911lookupResponse =
@@ -2098,32 +1913,34 @@ lookupResponse =
2098 { _lrDeferred = Nothing
1913 { _lrDeferred = Nothing
2099 , _lrFound = Nothing
1914 , _lrFound = Nothing
2100 , _lrMissing = Nothing
1915 , _lrMissing = Nothing
2101− , _lrHeader = Nothing
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.
2105lrDeferred :: Lens' LookupResponse [Key]
1921lrDeferred :: Lens' LookupResponse [Key]
2106lrDeferred
1922lrDeferred
2107 = lens _lrDeferred (\ s a -> s{_lrDeferred = a}) .
1923 = lens _lrDeferred (\ s a -> s{_lrDeferred = a}) .
2108 _Default
1924 _Default
2109 . _Coerce
1925 . _Coerce
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
2112lrFound :: Lens' LookupResponse [EntityResult]
1930lrFound :: Lens' LookupResponse [EntityResult]
2114 = lens _lrFound (\ s a -> s{_lrFound = a}) . _Default
1932 = lens _lrFound (\ s a -> s{_lrFound = a}) . _Default
2115 . _Coerce
1933 . _Coerce
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.
2118lrMissing :: Lens' LookupResponse [EntityResult]
1938lrMissing :: Lens' LookupResponse [EntityResult]
2119lrMissing
1939lrMissing
2120 = lens _lrMissing (\ s a -> s{_lrMissing = a}) .
1940 = lens _lrMissing (\ s a -> s{_lrMissing = a}) .
2121 _Default
1941 _Default
2122 . _Coerce
1942 . _Coerce
2124−lrHeader :: Lens' LookupResponse (Maybe ResponseHeader)
2125−lrHeader = lens _lrHeader (\ s a -> s{_lrHeader = a})
2127instance FromJSON LookupResponse where
1944instance FromJSON LookupResponse where
2128 parseJSON
1945 parseJSON
2129 = withObject "LookupResponse"
1946 = withObject "LookupResponse"
@@ -2131,8 +1948,7 @@ instance FromJSON LookupResponse where
2131 LookupResponse' <$>
1948 LookupResponse' <$>
2132 (o .:? "deferred" .!= mempty) <*>
1949 (o .:? "deferred" .!= mempty) <*>
2133 (o .:? "found" .!= mempty)
1950 (o .:? "found" .!= mempty)
2134− <*> (o .:? "missing" .!= mempty)
1951+ <*> (o .:? "missing" .!= mempty))
2135− <*> (o .:? "header"))
2137instance ToJSON LookupResponse where
1953instance ToJSON LookupResponse where
2138 toJSON LookupResponse'{..}
1954 toJSON LookupResponse'{..}
@@ -2140,8 +1956,7 @@ instance ToJSON LookupResponse where
2140 (catMaybes
1956 (catMaybes
2141 [("deferred" .=) <$> _lrDeferred,
1957 [("deferred" .=) <$> _lrDeferred,
2142 ("found" .=) <$> _lrFound,
1958 ("found" .=) <$> _lrFound,
2143− ("missing" .=) <$> _lrMissing,
1959+ ("missing" .=) <$> _lrMissing])
2144− ("header" .=) <$> _lrHeader])
2146-- | The desired order for a specific property.
1961-- | The desired order for a specific property.
@@ -2171,8 +1986,7 @@ poProperty :: Lens' PropertyOrder (Maybe PropertyReference)
2171poProperty
1986poProperty
2172 = lens _poProperty (\ s a -> s{_poProperty = a})
1987 = lens _poProperty (\ s a -> s{_poProperty = a})
2174−-- | The direction to order by. One of ascending or descending. Optional,
1989+-- | The direction to order by. Defaults to \`ASCENDING\`.
2175−-- defaults to ascending.
2176poDirection :: Lens' PropertyOrder (Maybe PropertyOrderDirection)
1990poDirection :: Lens' PropertyOrder (Maybe PropertyOrderDirection)
2177poDirection
1991poDirection
2178 = lens _poDirection (\ s a -> s{_poDirection = a})
1992 = lens _poDirection (\ s a -> s{_poDirection = a})
@@ -2190,3 +2004,50 @@ instance ToJSON PropertyOrder where
2190 (catMaybes
2004 (catMaybes
2191 [("property" .=) <$> _poProperty,
2005 [("property" .=) <$> _poProperty,
2192 ("direction" .=) <$> _poDirection])
2006 ("direction" .=) <$> _poDirection])
2008+-- | A binding parameter for a GQL query.
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)
2016+-- | Creates a value of 'GqlQueryParameter' with the minimum fields required to make a request.
2018+-- Use one of the following lenses to modify other fields as desired:
2024+ :: GqlQueryParameter
2027+ { _gqpCursor = Nothing
2028+ , _gqpValue = Nothing
2031+-- | A query cursor. Query cursors are returned in query result batches.
2032+gqpCursor :: Lens' GqlQueryParameter (Maybe Word8)
2034+ = lens _gqpCursor (\ s a -> s{_gqpCursor = a}) .
2037+-- | A value parameter.
2038+gqpValue :: Lens' GqlQueryParameter (Maybe Value)
2039+gqpValue = lens _gqpValue (\ s a -> s{_gqpValue = a})
2041+instance FromJSON GqlQueryParameter where
2043+ = withObject "GqlQueryParameter"
2045+ GqlQueryParameter' <$>
2046+ (o .:? "cursor") <*> (o .:? "value"))
2048+instance ToJSON GqlQueryParameter where
2049+ toJSON GqlQueryParameter'{..}
2052+ [("cursor" .=) <$> _gqpCursor,
2053+ ("value" .=) <$> _gqpValue])