{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.FireStore.Types.Product where
import Network.Google.FireStore.Types.Sum
import Network.Google.Prelude
data WriteRequest = WriteRequest'
{ _wrStreamToken :: !(Maybe Bytes)
, _wrLabels :: !(Maybe WriteRequestLabels)
, _wrWrites :: !(Maybe [Write])
, _wrStreamId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
writeRequest
:: WriteRequest
writeRequest =
WriteRequest'
{ _wrStreamToken = Nothing
, _wrLabels = Nothing
, _wrWrites = Nothing
, _wrStreamId = Nothing
}
wrStreamToken :: Lens' WriteRequest (Maybe ByteString)
wrStreamToken
= lens _wrStreamToken
(\ s a -> s{_wrStreamToken = a})
. mapping _Bytes
wrLabels :: Lens' WriteRequest (Maybe WriteRequestLabels)
wrLabels = lens _wrLabels (\ s a -> s{_wrLabels = a})
wrWrites :: Lens' WriteRequest [Write]
wrWrites
= lens _wrWrites (\ s a -> s{_wrWrites = a}) .
_Default
. _Coerce
wrStreamId :: Lens' WriteRequest (Maybe Text)
wrStreamId
= lens _wrStreamId (\ s a -> s{_wrStreamId = a})
instance FromJSON WriteRequest where
parseJSON
= withObject "WriteRequest"
(\ o ->
WriteRequest' <$>
(o .:? "streamToken") <*> (o .:? "labels") <*>
(o .:? "writes" .!= mempty)
<*> (o .:? "streamId"))
instance ToJSON WriteRequest where
toJSON WriteRequest'{..}
= object
(catMaybes
[("streamToken" .=) <$> _wrStreamToken,
("labels" .=) <$> _wrLabels,
("writes" .=) <$> _wrWrites,
("streamId" .=) <$> _wrStreamId])
data LatLng = LatLng'
{ _llLatitude :: !(Maybe (Textual Double))
, _llLongitude :: !(Maybe (Textual Double))
} deriving (Eq,Show,Data,Typeable,Generic)
latLng
:: LatLng
latLng =
LatLng'
{ _llLatitude = Nothing
, _llLongitude = Nothing
}
llLatitude :: Lens' LatLng (Maybe Double)
llLatitude
= lens _llLatitude (\ s a -> s{_llLatitude = a}) .
mapping _Coerce
llLongitude :: Lens' LatLng (Maybe Double)
llLongitude
= lens _llLongitude (\ s a -> s{_llLongitude = a}) .
mapping _Coerce
instance FromJSON LatLng where
parseJSON
= withObject "LatLng"
(\ o ->
LatLng' <$>
(o .:? "latitude") <*> (o .:? "longitude"))
instance ToJSON LatLng where
toJSON LatLng'{..}
= object
(catMaybes
[("latitude" .=) <$> _llLatitude,
("longitude" .=) <$> _llLongitude])
data WriteResult = WriteResult'
{ _wrUpdateTime :: !(Maybe DateTime')
, _wrTransformResults :: !(Maybe [Value])
} deriving (Eq,Show,Data,Typeable,Generic)
writeResult
:: WriteResult
writeResult =
WriteResult'
{ _wrUpdateTime = Nothing
, _wrTransformResults = Nothing
}
wrUpdateTime :: Lens' WriteResult (Maybe UTCTime)
wrUpdateTime
= lens _wrUpdateTime (\ s a -> s{_wrUpdateTime = a})
. mapping _DateTime
wrTransformResults :: Lens' WriteResult [Value]
wrTransformResults
= lens _wrTransformResults
(\ s a -> s{_wrTransformResults = a})
. _Default
. _Coerce
instance FromJSON WriteResult where
parseJSON
= withObject "WriteResult"
(\ o ->
WriteResult' <$>
(o .:? "updateTime") <*>
(o .:? "transformResults" .!= mempty))
instance ToJSON WriteResult where
toJSON WriteResult'{..}
= object
(catMaybes
[("updateTime" .=) <$> _wrUpdateTime,
("transformResults" .=) <$> _wrTransformResults])
data GoogleFirestoreAdminV1Field = GoogleFirestoreAdminV1Field'
{ _gfavfIndexConfig :: !(Maybe GoogleFirestoreAdminV1IndexConfig)
, _gfavfName :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
googleFirestoreAdminV1Field
:: GoogleFirestoreAdminV1Field
googleFirestoreAdminV1Field =
GoogleFirestoreAdminV1Field'
{ _gfavfIndexConfig = Nothing
, _gfavfName = Nothing
}
gfavfIndexConfig :: Lens' GoogleFirestoreAdminV1Field (Maybe GoogleFirestoreAdminV1IndexConfig)
gfavfIndexConfig
= lens _gfavfIndexConfig
(\ s a -> s{_gfavfIndexConfig = a})
gfavfName :: Lens' GoogleFirestoreAdminV1Field (Maybe Text)
gfavfName
= lens _gfavfName (\ s a -> s{_gfavfName = a})
instance FromJSON GoogleFirestoreAdminV1Field where
parseJSON
= withObject "GoogleFirestoreAdminV1Field"
(\ o ->
GoogleFirestoreAdminV1Field' <$>
(o .:? "indexConfig") <*> (o .:? "name"))
instance ToJSON GoogleFirestoreAdminV1Field where
toJSON GoogleFirestoreAdminV1Field'{..}
= object
(catMaybes
[("indexConfig" .=) <$> _gfavfIndexConfig,
("name" .=) <$> _gfavfName])
data TransactionOptions = TransactionOptions'
{ _toReadWrite :: !(Maybe ReadWrite)
, _toReadOnly :: !(Maybe ReadOnly)
} deriving (Eq,Show,Data,Typeable,Generic)
transactionOptions
:: TransactionOptions
transactionOptions =
TransactionOptions'
{ _toReadWrite = Nothing
, _toReadOnly = Nothing
}
toReadWrite :: Lens' TransactionOptions (Maybe ReadWrite)
toReadWrite
= lens _toReadWrite (\ s a -> s{_toReadWrite = a})
toReadOnly :: Lens' TransactionOptions (Maybe ReadOnly)
toReadOnly
= lens _toReadOnly (\ s a -> s{_toReadOnly = a})
instance FromJSON TransactionOptions where
parseJSON
= withObject "TransactionOptions"
(\ o ->
TransactionOptions' <$>
(o .:? "readWrite") <*> (o .:? "readOnly"))
instance ToJSON TransactionOptions where
toJSON TransactionOptions'{..}
= object
(catMaybes
[("readWrite" .=) <$> _toReadWrite,
("readOnly" .=) <$> _toReadOnly])
data Status = Status'
{ _sDetails :: !(Maybe [StatusDetailsItem])
, _sCode :: !(Maybe (Textual Int32))
, _sMessage :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
status
:: Status
status =
Status'
{ _sDetails = Nothing
, _sCode = Nothing
, _sMessage = Nothing
}
sDetails :: Lens' Status [StatusDetailsItem]
sDetails
= lens _sDetails (\ s a -> s{_sDetails = a}) .
_Default
. _Coerce
sCode :: Lens' Status (Maybe Int32)
sCode
= lens _sCode (\ s a -> s{_sCode = a}) .
mapping _Coerce
sMessage :: Lens' Status (Maybe Text)
sMessage = lens _sMessage (\ s a -> s{_sMessage = a})
instance FromJSON Status where
parseJSON
= withObject "Status"
(\ o ->
Status' <$>
(o .:? "details" .!= mempty) <*> (o .:? "code") <*>
(o .:? "message"))
instance ToJSON Status where
toJSON Status'{..}
= object
(catMaybes
[("details" .=) <$> _sDetails,
("code" .=) <$> _sCode,
("message" .=) <$> _sMessage])
newtype GoogleLongrunningOperationMetadata = GoogleLongrunningOperationMetadata'
{ _glomAddtional :: HashMap Text JSONValue
} deriving (Eq,Show,Data,Typeable,Generic)
googleLongrunningOperationMetadata
:: HashMap Text JSONValue
-> GoogleLongrunningOperationMetadata
googleLongrunningOperationMetadata pGlomAddtional_ =
GoogleLongrunningOperationMetadata'
{ _glomAddtional = _Coerce # pGlomAddtional_
}
glomAddtional :: Lens' GoogleLongrunningOperationMetadata (HashMap Text JSONValue)
glomAddtional
= lens _glomAddtional
(\ s a -> s{_glomAddtional = a})
. _Coerce
instance FromJSON GoogleLongrunningOperationMetadata
where
parseJSON
= withObject "GoogleLongrunningOperationMetadata"
(\ o ->
GoogleLongrunningOperationMetadata' <$>
(parseJSONObject o))
instance ToJSON GoogleLongrunningOperationMetadata
where
toJSON = toJSON . _glomAddtional
data Precondition = Precondition'
{ _pExists :: !(Maybe Bool)
, _pUpdateTime :: !(Maybe DateTime')
} deriving (Eq,Show,Data,Typeable,Generic)
precondition
:: Precondition
precondition =
Precondition'
{ _pExists = Nothing
, _pUpdateTime = Nothing
}
pExists :: Lens' Precondition (Maybe Bool)
pExists = lens _pExists (\ s a -> s{_pExists = a})
pUpdateTime :: Lens' Precondition (Maybe UTCTime)
pUpdateTime
= lens _pUpdateTime (\ s a -> s{_pUpdateTime = a}) .
mapping _DateTime
instance FromJSON Precondition where
parseJSON
= withObject "Precondition"
(\ o ->
Precondition' <$>
(o .:? "exists") <*> (o .:? "updateTime"))
instance ToJSON Precondition where
toJSON Precondition'{..}
= object
(catMaybes
[("exists" .=) <$> _pExists,
("updateTime" .=) <$> _pUpdateTime])
newtype ReadWrite = ReadWrite'
{ _rwRetryTransaction :: Maybe Bytes
} deriving (Eq,Show,Data,Typeable,Generic)
readWrite
:: ReadWrite
readWrite =
ReadWrite'
{ _rwRetryTransaction = Nothing
}
rwRetryTransaction :: Lens' ReadWrite (Maybe ByteString)
rwRetryTransaction
= lens _rwRetryTransaction
(\ s a -> s{_rwRetryTransaction = a})
. mapping _Bytes
instance FromJSON ReadWrite where
parseJSON
= withObject "ReadWrite"
(\ o -> ReadWrite' <$> (o .:? "retryTransaction"))
instance ToJSON ReadWrite where
toJSON ReadWrite'{..}
= object
(catMaybes
[("retryTransaction" .=) <$> _rwRetryTransaction])
newtype RollbackRequest = RollbackRequest'
{ _rrTransaction :: Maybe Bytes
} deriving (Eq,Show,Data,Typeable,Generic)
rollbackRequest
:: RollbackRequest
rollbackRequest =
RollbackRequest'
{ _rrTransaction = Nothing
}
rrTransaction :: Lens' RollbackRequest (Maybe ByteString)
rrTransaction
= lens _rrTransaction
(\ s a -> s{_rrTransaction = a})
. mapping _Bytes
instance FromJSON RollbackRequest where
parseJSON
= withObject "RollbackRequest"
(\ o -> RollbackRequest' <$> (o .:? "transaction"))
instance ToJSON RollbackRequest where
toJSON RollbackRequest'{..}
= object
(catMaybes [("transaction" .=) <$> _rrTransaction])
data GoogleFirestoreAdminV1ExportDocumentsRequest = GoogleFirestoreAdminV1ExportDocumentsRequest'
{ _gfavedrCollectionIds :: !(Maybe [Text])
, _gfavedrOutputURIPrefix :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
googleFirestoreAdminV1ExportDocumentsRequest
:: GoogleFirestoreAdminV1ExportDocumentsRequest
googleFirestoreAdminV1ExportDocumentsRequest =
GoogleFirestoreAdminV1ExportDocumentsRequest'
{ _gfavedrCollectionIds = Nothing
, _gfavedrOutputURIPrefix = Nothing
}
gfavedrCollectionIds :: Lens' GoogleFirestoreAdminV1ExportDocumentsRequest [Text]
gfavedrCollectionIds
= lens _gfavedrCollectionIds
(\ s a -> s{_gfavedrCollectionIds = a})
. _Default
. _Coerce
gfavedrOutputURIPrefix :: Lens' GoogleFirestoreAdminV1ExportDocumentsRequest (Maybe Text)
gfavedrOutputURIPrefix
= lens _gfavedrOutputURIPrefix
(\ s a -> s{_gfavedrOutputURIPrefix = a})
instance FromJSON
GoogleFirestoreAdminV1ExportDocumentsRequest where
parseJSON
= withObject
"GoogleFirestoreAdminV1ExportDocumentsRequest"
(\ o ->
GoogleFirestoreAdminV1ExportDocumentsRequest' <$>
(o .:? "collectionIds" .!= mempty) <*>
(o .:? "outputUriPrefix"))
instance ToJSON
GoogleFirestoreAdminV1ExportDocumentsRequest where
toJSON
GoogleFirestoreAdminV1ExportDocumentsRequest'{..}
= object
(catMaybes
[("collectionIds" .=) <$> _gfavedrCollectionIds,
("outputUriPrefix" .=) <$> _gfavedrOutputURIPrefix])
data TargetChange = TargetChange'
{ _tcReadTime :: !(Maybe DateTime')
, _tcResumeToken :: !(Maybe Bytes)
, _tcCause :: !(Maybe Status)
, _tcTargetChangeType :: !(Maybe TargetChangeTargetChangeType)
, _tcTargetIds :: !(Maybe [Textual Int32])
} deriving (Eq,Show,Data,Typeable,Generic)
targetChange
:: TargetChange
targetChange =
TargetChange'
{ _tcReadTime = Nothing
, _tcResumeToken = Nothing
, _tcCause = Nothing
, _tcTargetChangeType = Nothing
, _tcTargetIds = Nothing
}
tcReadTime :: Lens' TargetChange (Maybe UTCTime)
tcReadTime
= lens _tcReadTime (\ s a -> s{_tcReadTime = a}) .
mapping _DateTime
tcResumeToken :: Lens' TargetChange (Maybe ByteString)
tcResumeToken
= lens _tcResumeToken
(\ s a -> s{_tcResumeToken = a})
. mapping _Bytes
tcCause :: Lens' TargetChange (Maybe Status)
tcCause = lens _tcCause (\ s a -> s{_tcCause = a})
tcTargetChangeType :: Lens' TargetChange (Maybe TargetChangeTargetChangeType)
tcTargetChangeType
= lens _tcTargetChangeType
(\ s a -> s{_tcTargetChangeType = a})
tcTargetIds :: Lens' TargetChange [Int32]
tcTargetIds
= lens _tcTargetIds (\ s a -> s{_tcTargetIds = a}) .
_Default
. _Coerce
instance FromJSON TargetChange where
parseJSON
= withObject "TargetChange"
(\ o ->
TargetChange' <$>
(o .:? "readTime") <*> (o .:? "resumeToken") <*>
(o .:? "cause")
<*> (o .:? "targetChangeType")
<*> (o .:? "targetIds" .!= mempty))
instance ToJSON TargetChange where
toJSON TargetChange'{..}
= object
(catMaybes
[("readTime" .=) <$> _tcReadTime,
("resumeToken" .=) <$> _tcResumeToken,
("cause" .=) <$> _tcCause,
("targetChangeType" .=) <$> _tcTargetChangeType,
("targetIds" .=) <$> _tcTargetIds])
data ListLocationsResponse = ListLocationsResponse'
{ _llrNextPageToken :: !(Maybe Text)
, _llrLocations :: !(Maybe [Location])
} deriving (Eq,Show,Data,Typeable,Generic)
listLocationsResponse
:: ListLocationsResponse
listLocationsResponse =
ListLocationsResponse'
{ _llrNextPageToken = Nothing
, _llrLocations = Nothing
}
llrNextPageToken :: Lens' ListLocationsResponse (Maybe Text)
llrNextPageToken
= lens _llrNextPageToken
(\ s a -> s{_llrNextPageToken = a})
llrLocations :: Lens' ListLocationsResponse [Location]
llrLocations
= lens _llrLocations (\ s a -> s{_llrLocations = a})
. _Default
. _Coerce
instance FromJSON ListLocationsResponse where
parseJSON
= withObject "ListLocationsResponse"
(\ o ->
ListLocationsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "locations" .!= mempty))
instance ToJSON ListLocationsResponse where
toJSON ListLocationsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _llrNextPageToken,
("locations" .=) <$> _llrLocations])
data Cursor = Cursor'
{ _cValues :: !(Maybe [Value])
, _cBefore :: !(Maybe Bool)
} deriving (Eq,Show,Data,Typeable,Generic)
cursor
:: Cursor
cursor =
Cursor'
{ _cValues = Nothing
, _cBefore = Nothing
}
cValues :: Lens' Cursor [Value]
cValues
= lens _cValues (\ s a -> s{_cValues = a}) . _Default
. _Coerce
cBefore :: Lens' Cursor (Maybe Bool)
cBefore = lens _cBefore (\ s a -> s{_cBefore = a})
instance FromJSON Cursor where
parseJSON
= withObject "Cursor"
(\ o ->
Cursor' <$>
(o .:? "values" .!= mempty) <*> (o .:? "before"))
instance ToJSON Cursor where
toJSON Cursor'{..}
= object
(catMaybes
[("values" .=) <$> _cValues,
("before" .=) <$> _cBefore])
data GoogleFirestoreAdminV1ImportDocumentsMetadata = GoogleFirestoreAdminV1ImportDocumentsMetadata'
{ _gfavidmProgressBytes :: !(Maybe GoogleFirestoreAdminV1Progress)
, _gfavidmStartTime :: !(Maybe DateTime')
, _gfavidmInputURIPrefix :: !(Maybe Text)
, _gfavidmCollectionIds :: !(Maybe [Text])
, _gfavidmProgressDocuments :: !(Maybe GoogleFirestoreAdminV1Progress)
, _gfavidmEndTime :: !(Maybe DateTime')
, _gfavidmOperationState :: !(Maybe GoogleFirestoreAdminV1ImportDocumentsMetadataOperationState)
} deriving (Eq,Show,Data,Typeable,Generic)
googleFirestoreAdminV1ImportDocumentsMetadata
:: GoogleFirestoreAdminV1ImportDocumentsMetadata
googleFirestoreAdminV1ImportDocumentsMetadata =
GoogleFirestoreAdminV1ImportDocumentsMetadata'
{ _gfavidmProgressBytes = Nothing
, _gfavidmStartTime = Nothing
, _gfavidmInputURIPrefix = Nothing
, _gfavidmCollectionIds = Nothing
, _gfavidmProgressDocuments = Nothing
, _gfavidmEndTime = Nothing
, _gfavidmOperationState = Nothing
}
gfavidmProgressBytes :: Lens' GoogleFirestoreAdminV1ImportDocumentsMetadata (Maybe GoogleFirestoreAdminV1Progress)
gfavidmProgressBytes
= lens _gfavidmProgressBytes
(\ s a -> s{_gfavidmProgressBytes = a})
gfavidmStartTime :: Lens' GoogleFirestoreAdminV1ImportDocumentsMetadata (Maybe UTCTime)
gfavidmStartTime
= lens _gfavidmStartTime
(\ s a -> s{_gfavidmStartTime = a})
. mapping _DateTime
gfavidmInputURIPrefix :: Lens' GoogleFirestoreAdminV1ImportDocumentsMetadata (Maybe Text)
gfavidmInputURIPrefix
= lens _gfavidmInputURIPrefix
(\ s a -> s{_gfavidmInputURIPrefix = a})
gfavidmCollectionIds :: Lens' GoogleFirestoreAdminV1ImportDocumentsMetadata [Text]
gfavidmCollectionIds
= lens _gfavidmCollectionIds
(\ s a -> s{_gfavidmCollectionIds = a})
. _Default
. _Coerce
gfavidmProgressDocuments :: Lens' GoogleFirestoreAdminV1ImportDocumentsMetadata (Maybe GoogleFirestoreAdminV1Progress)
gfavidmProgressDocuments
= lens _gfavidmProgressDocuments
(\ s a -> s{_gfavidmProgressDocuments = a})
gfavidmEndTime :: Lens' GoogleFirestoreAdminV1ImportDocumentsMetadata (Maybe UTCTime)
gfavidmEndTime
= lens _gfavidmEndTime
(\ s a -> s{_gfavidmEndTime = a})
. mapping _DateTime
gfavidmOperationState :: Lens' GoogleFirestoreAdminV1ImportDocumentsMetadata (Maybe GoogleFirestoreAdminV1ImportDocumentsMetadataOperationState)
gfavidmOperationState
= lens _gfavidmOperationState
(\ s a -> s{_gfavidmOperationState = a})
instance FromJSON
GoogleFirestoreAdminV1ImportDocumentsMetadata where
parseJSON
= withObject
"GoogleFirestoreAdminV1ImportDocumentsMetadata"
(\ o ->
GoogleFirestoreAdminV1ImportDocumentsMetadata' <$>
(o .:? "progressBytes") <*> (o .:? "startTime") <*>
(o .:? "inputUriPrefix")
<*> (o .:? "collectionIds" .!= mempty)
<*> (o .:? "progressDocuments")
<*> (o .:? "endTime")
<*> (o .:? "operationState"))
instance ToJSON
GoogleFirestoreAdminV1ImportDocumentsMetadata where
toJSON
GoogleFirestoreAdminV1ImportDocumentsMetadata'{..}
= object
(catMaybes
[("progressBytes" .=) <$> _gfavidmProgressBytes,
("startTime" .=) <$> _gfavidmStartTime,
("inputUriPrefix" .=) <$> _gfavidmInputURIPrefix,
("collectionIds" .=) <$> _gfavidmCollectionIds,
("progressDocuments" .=) <$>
_gfavidmProgressDocuments,
("endTime" .=) <$> _gfavidmEndTime,
("operationState" .=) <$> _gfavidmOperationState])
newtype BeginTransactionRequest = BeginTransactionRequest'
{ _btrOptions :: Maybe TransactionOptions
} deriving (Eq,Show,Data,Typeable,Generic)
beginTransactionRequest
:: BeginTransactionRequest
beginTransactionRequest =
BeginTransactionRequest'
{ _btrOptions = Nothing
}
btrOptions :: Lens' BeginTransactionRequest (Maybe TransactionOptions)
btrOptions
= lens _btrOptions (\ s a -> s{_btrOptions = a})
instance FromJSON BeginTransactionRequest where
parseJSON
= withObject "BeginTransactionRequest"
(\ o ->
BeginTransactionRequest' <$> (o .:? "options"))
instance ToJSON BeginTransactionRequest where
toJSON BeginTransactionRequest'{..}
= object (catMaybes [("options" .=) <$> _btrOptions])
data RunQueryRequest = RunQueryRequest'
{ _rqrReadTime :: !(Maybe DateTime')
, _rqrNewTransaction :: !(Maybe TransactionOptions)
, _rqrStructuredQuery :: !(Maybe StructuredQuery)
, _rqrTransaction :: !(Maybe Bytes)
} deriving (Eq,Show,Data,Typeable,Generic)
runQueryRequest
:: RunQueryRequest
runQueryRequest =
RunQueryRequest'
{ _rqrReadTime = Nothing
, _rqrNewTransaction = Nothing
, _rqrStructuredQuery = Nothing
, _rqrTransaction = Nothing
}
rqrReadTime :: Lens' RunQueryRequest (Maybe UTCTime)
rqrReadTime
= lens _rqrReadTime (\ s a -> s{_rqrReadTime = a}) .
mapping _DateTime
rqrNewTransaction :: Lens' RunQueryRequest (Maybe TransactionOptions)
rqrNewTransaction
= lens _rqrNewTransaction
(\ s a -> s{_rqrNewTransaction = a})
rqrStructuredQuery :: Lens' RunQueryRequest (Maybe StructuredQuery)
rqrStructuredQuery
= lens _rqrStructuredQuery
(\ s a -> s{_rqrStructuredQuery = a})
rqrTransaction :: Lens' RunQueryRequest (Maybe ByteString)
rqrTransaction
= lens _rqrTransaction
(\ s a -> s{_rqrTransaction = a})
. mapping _Bytes
instance FromJSON RunQueryRequest where
parseJSON
= withObject "RunQueryRequest"
(\ o ->
RunQueryRequest' <$>
(o .:? "readTime") <*> (o .:? "newTransaction") <*>
(o .:? "structuredQuery")
<*> (o .:? "transaction"))
instance ToJSON RunQueryRequest where
toJSON RunQueryRequest'{..}
= object
(catMaybes
[("readTime" .=) <$> _rqrReadTime,
("newTransaction" .=) <$> _rqrNewTransaction,
("structuredQuery" .=) <$> _rqrStructuredQuery,
("transaction" .=) <$> _rqrTransaction])
data GoogleFirestoreAdminV1IndexConfigDelta = GoogleFirestoreAdminV1IndexConfigDelta'
{ _gfavicdIndex :: !(Maybe GoogleFirestoreAdminV1Index)
, _gfavicdChangeType :: !(Maybe GoogleFirestoreAdminV1IndexConfigDeltaChangeType)
} deriving (Eq,Show,Data,Typeable,Generic)
googleFirestoreAdminV1IndexConfigDelta
:: GoogleFirestoreAdminV1IndexConfigDelta
googleFirestoreAdminV1IndexConfigDelta =
GoogleFirestoreAdminV1IndexConfigDelta'
{ _gfavicdIndex = Nothing
, _gfavicdChangeType = Nothing
}
gfavicdIndex :: Lens' GoogleFirestoreAdminV1IndexConfigDelta (Maybe GoogleFirestoreAdminV1Index)
gfavicdIndex
= lens _gfavicdIndex (\ s a -> s{_gfavicdIndex = a})
gfavicdChangeType :: Lens' GoogleFirestoreAdminV1IndexConfigDelta (Maybe GoogleFirestoreAdminV1IndexConfigDeltaChangeType)
gfavicdChangeType
= lens _gfavicdChangeType
(\ s a -> s{_gfavicdChangeType = a})
instance FromJSON
GoogleFirestoreAdminV1IndexConfigDelta where
parseJSON
= withObject "GoogleFirestoreAdminV1IndexConfigDelta"
(\ o ->
GoogleFirestoreAdminV1IndexConfigDelta' <$>
(o .:? "index") <*> (o .:? "changeType"))
instance ToJSON
GoogleFirestoreAdminV1IndexConfigDelta where
toJSON GoogleFirestoreAdminV1IndexConfigDelta'{..}
= object
(catMaybes
[("index" .=) <$> _gfavicdIndex,
("changeType" .=) <$> _gfavicdChangeType])
data GoogleFirestoreAdminV1IndexConfig = GoogleFirestoreAdminV1IndexConfig'
{ _gfavicAncestorField :: !(Maybe Text)
, _gfavicReverting :: !(Maybe Bool)
, _gfavicIndexes :: !(Maybe [GoogleFirestoreAdminV1Index])
, _gfavicUsesAncestorConfig :: !(Maybe Bool)
} deriving (Eq,Show,Data,Typeable,Generic)
googleFirestoreAdminV1IndexConfig
:: GoogleFirestoreAdminV1IndexConfig
googleFirestoreAdminV1IndexConfig =
GoogleFirestoreAdminV1IndexConfig'
{ _gfavicAncestorField = Nothing
, _gfavicReverting = Nothing
, _gfavicIndexes = Nothing
, _gfavicUsesAncestorConfig = Nothing
}
gfavicAncestorField :: Lens' GoogleFirestoreAdminV1IndexConfig (Maybe Text)
gfavicAncestorField
= lens _gfavicAncestorField
(\ s a -> s{_gfavicAncestorField = a})
gfavicReverting :: Lens' GoogleFirestoreAdminV1IndexConfig (Maybe Bool)
gfavicReverting
= lens _gfavicReverting
(\ s a -> s{_gfavicReverting = a})
gfavicIndexes :: Lens' GoogleFirestoreAdminV1IndexConfig [GoogleFirestoreAdminV1Index]
gfavicIndexes
= lens _gfavicIndexes
(\ s a -> s{_gfavicIndexes = a})
. _Default
. _Coerce
gfavicUsesAncestorConfig :: Lens' GoogleFirestoreAdminV1IndexConfig (Maybe Bool)
gfavicUsesAncestorConfig
= lens _gfavicUsesAncestorConfig
(\ s a -> s{_gfavicUsesAncestorConfig = a})
instance FromJSON GoogleFirestoreAdminV1IndexConfig
where
parseJSON
= withObject "GoogleFirestoreAdminV1IndexConfig"
(\ o ->
GoogleFirestoreAdminV1IndexConfig' <$>
(o .:? "ancestorField") <*> (o .:? "reverting") <*>
(o .:? "indexes" .!= mempty)
<*> (o .:? "usesAncestorConfig"))
instance ToJSON GoogleFirestoreAdminV1IndexConfig
where
toJSON GoogleFirestoreAdminV1IndexConfig'{..}
= object
(catMaybes
[("ancestorField" .=) <$> _gfavicAncestorField,
("reverting" .=) <$> _gfavicReverting,
("indexes" .=) <$> _gfavicIndexes,
("usesAncestorConfig" .=) <$>
_gfavicUsesAncestorConfig])
data GoogleFirestoreAdminV1IndexField = GoogleFirestoreAdminV1IndexField'
{ _gfavifFieldPath :: !(Maybe Text)
, _gfavifArrayConfig :: !(Maybe GoogleFirestoreAdminV1IndexFieldArrayConfig)
, _gfavifOrder :: !(Maybe GoogleFirestoreAdminV1IndexFieldOrder)
} deriving (Eq,Show,Data,Typeable,Generic)
googleFirestoreAdminV1IndexField
:: GoogleFirestoreAdminV1IndexField
googleFirestoreAdminV1IndexField =
GoogleFirestoreAdminV1IndexField'
{ _gfavifFieldPath = Nothing
, _gfavifArrayConfig = Nothing
, _gfavifOrder = Nothing
}
gfavifFieldPath :: Lens' GoogleFirestoreAdminV1IndexField (Maybe Text)
gfavifFieldPath
= lens _gfavifFieldPath
(\ s a -> s{_gfavifFieldPath = a})
gfavifArrayConfig :: Lens' GoogleFirestoreAdminV1IndexField (Maybe GoogleFirestoreAdminV1IndexFieldArrayConfig)
gfavifArrayConfig
= lens _gfavifArrayConfig
(\ s a -> s{_gfavifArrayConfig = a})
gfavifOrder :: Lens' GoogleFirestoreAdminV1IndexField (Maybe GoogleFirestoreAdminV1IndexFieldOrder)
gfavifOrder
= lens _gfavifOrder (\ s a -> s{_gfavifOrder = a})
instance FromJSON GoogleFirestoreAdminV1IndexField
where
parseJSON
= withObject "GoogleFirestoreAdminV1IndexField"
(\ o ->
GoogleFirestoreAdminV1IndexField' <$>
(o .:? "fieldPath") <*> (o .:? "arrayConfig") <*>
(o .:? "order"))
instance ToJSON GoogleFirestoreAdminV1IndexField
where
toJSON GoogleFirestoreAdminV1IndexField'{..}
= object
(catMaybes
[("fieldPath" .=) <$> _gfavifFieldPath,
("arrayConfig" .=) <$> _gfavifArrayConfig,
("order" .=) <$> _gfavifOrder])
data Write = Write'
{ _wTransform :: !(Maybe DocumentTransform)
, _wUpdateMask :: !(Maybe DocumentMask)
, _wCurrentDocument :: !(Maybe Precondition)
, _wDelete :: !(Maybe Text)
, _wUpdate :: !(Maybe Document)
} deriving (Eq,Show,Data,Typeable,Generic)
write
:: Write
write =
Write'
{ _wTransform = Nothing
, _wUpdateMask = Nothing
, _wCurrentDocument = Nothing
, _wDelete = Nothing
, _wUpdate = Nothing
}
wTransform :: Lens' Write (Maybe DocumentTransform)
wTransform
= lens _wTransform (\ s a -> s{_wTransform = a})
wUpdateMask :: Lens' Write (Maybe DocumentMask)
wUpdateMask
= lens _wUpdateMask (\ s a -> s{_wUpdateMask = a})
wCurrentDocument :: Lens' Write (Maybe Precondition)
wCurrentDocument
= lens _wCurrentDocument
(\ s a -> s{_wCurrentDocument = a})
wDelete :: Lens' Write (Maybe Text)
wDelete = lens _wDelete (\ s a -> s{_wDelete = a})
wUpdate :: Lens' Write (Maybe Document)
wUpdate = lens _wUpdate (\ s a -> s{_wUpdate = a})
instance FromJSON Write where
parseJSON
= withObject "Write"
(\ o ->
Write' <$>
(o .:? "transform") <*> (o .:? "updateMask") <*>
(o .:? "currentDocument")
<*> (o .:? "delete")
<*> (o .:? "update"))
instance ToJSON Write where
toJSON Write'{..}
= object
(catMaybes
[("transform" .=) <$> _wTransform,
("updateMask" .=) <$> _wUpdateMask,
("currentDocument" .=) <$> _wCurrentDocument,
("delete" .=) <$> _wDelete,
("update" .=) <$> _wUpdate])
data Location = Location'
{ _lName :: !(Maybe Text)
, _lMetadata :: !(Maybe LocationMetadata)
, _lDisplayName :: !(Maybe Text)
, _lLabels :: !(Maybe LocationLabels)
, _lLocationId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
location
:: Location
location =
Location'
{ _lName = Nothing
, _lMetadata = Nothing
, _lDisplayName = Nothing
, _lLabels = Nothing
, _lLocationId = Nothing
}
lName :: Lens' Location (Maybe Text)
lName = lens _lName (\ s a -> s{_lName = a})
lMetadata :: Lens' Location (Maybe LocationMetadata)
lMetadata
= lens _lMetadata (\ s a -> s{_lMetadata = a})
lDisplayName :: Lens' Location (Maybe Text)
lDisplayName
= lens _lDisplayName (\ s a -> s{_lDisplayName = a})
lLabels :: Lens' Location (Maybe LocationLabels)
lLabels = lens _lLabels (\ s a -> s{_lLabels = a})
lLocationId :: Lens' Location (Maybe Text)
lLocationId
= lens _lLocationId (\ s a -> s{_lLocationId = a})
instance FromJSON Location where
parseJSON
= withObject "Location"
(\ o ->
Location' <$>
(o .:? "name") <*> (o .:? "metadata") <*>
(o .:? "displayName")
<*> (o .:? "labels")
<*> (o .:? "locationId"))
instance ToJSON Location where
toJSON Location'{..}
= object
(catMaybes
[("name" .=) <$> _lName,
("metadata" .=) <$> _lMetadata,
("displayName" .=) <$> _lDisplayName,
("labels" .=) <$> _lLabels,
("locationId" .=) <$> _lLocationId])
data Empty =
Empty'
deriving (Eq,Show,Data,Typeable,Generic)
empty
:: Empty
empty = Empty'
instance FromJSON Empty where
parseJSON = withObject "Empty" (\ o -> pure Empty')
instance ToJSON Empty where
toJSON = const emptyObject
data BatchGetDocumentsResponse = BatchGetDocumentsResponse'
{ _bgdrReadTime :: !(Maybe DateTime')
, _bgdrFound :: !(Maybe Document)
, _bgdrTransaction :: !(Maybe Bytes)
, _bgdrMissing :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
batchGetDocumentsResponse
:: BatchGetDocumentsResponse
batchGetDocumentsResponse =
BatchGetDocumentsResponse'
{ _bgdrReadTime = Nothing
, _bgdrFound = Nothing
, _bgdrTransaction = Nothing
, _bgdrMissing = Nothing
}
bgdrReadTime :: Lens' BatchGetDocumentsResponse (Maybe UTCTime)
bgdrReadTime
= lens _bgdrReadTime (\ s a -> s{_bgdrReadTime = a})
. mapping _DateTime
bgdrFound :: Lens' BatchGetDocumentsResponse (Maybe Document)
bgdrFound
= lens _bgdrFound (\ s a -> s{_bgdrFound = a})
bgdrTransaction :: Lens' BatchGetDocumentsResponse (Maybe ByteString)
bgdrTransaction
= lens _bgdrTransaction
(\ s a -> s{_bgdrTransaction = a})
. mapping _Bytes
bgdrMissing :: Lens' BatchGetDocumentsResponse (Maybe Text)
bgdrMissing
= lens _bgdrMissing (\ s a -> s{_bgdrMissing = a})
instance FromJSON BatchGetDocumentsResponse where
parseJSON
= withObject "BatchGetDocumentsResponse"
(\ o ->
BatchGetDocumentsResponse' <$>
(o .:? "readTime") <*> (o .:? "found") <*>
(o .:? "transaction")
<*> (o .:? "missing"))
instance ToJSON BatchGetDocumentsResponse where
toJSON BatchGetDocumentsResponse'{..}
= object
(catMaybes
[("readTime" .=) <$> _bgdrReadTime,
("found" .=) <$> _bgdrFound,
("transaction" .=) <$> _bgdrTransaction,
("missing" .=) <$> _bgdrMissing])
data CompositeFilter = CompositeFilter'
{ _cfOp :: !(Maybe CompositeFilterOp)
, _cfFilters :: !(Maybe [Filter])
} deriving (Eq,Show,Data,Typeable,Generic)
compositeFilter
:: CompositeFilter
compositeFilter =
CompositeFilter'
{ _cfOp = Nothing
, _cfFilters = Nothing
}
cfOp :: Lens' CompositeFilter (Maybe CompositeFilterOp)
cfOp = lens _cfOp (\ s a -> s{_cfOp = a})
cfFilters :: Lens' CompositeFilter [Filter]
cfFilters
= lens _cfFilters (\ s a -> s{_cfFilters = a}) .
_Default
. _Coerce
instance FromJSON CompositeFilter where
parseJSON
= withObject "CompositeFilter"
(\ o ->
CompositeFilter' <$>
(o .:? "op") <*> (o .:? "filters" .!= mempty))
instance ToJSON CompositeFilter where
toJSON CompositeFilter'{..}
= object
(catMaybes
[("op" .=) <$> _cfOp, ("filters" .=) <$> _cfFilters])
newtype DocumentsTarget = DocumentsTarget'
{ _dtDocuments :: Maybe [Text]
} deriving (Eq,Show,Data,Typeable,Generic)
documentsTarget
:: DocumentsTarget
documentsTarget =
DocumentsTarget'
{ _dtDocuments = Nothing
}
dtDocuments :: Lens' DocumentsTarget [Text]
dtDocuments
= lens _dtDocuments (\ s a -> s{_dtDocuments = a}) .
_Default
. _Coerce
instance FromJSON DocumentsTarget where
parseJSON
= withObject "DocumentsTarget"
(\ o ->
DocumentsTarget' <$> (o .:? "documents" .!= mempty))
instance ToJSON DocumentsTarget where
toJSON DocumentsTarget'{..}
= object
(catMaybes [("documents" .=) <$> _dtDocuments])
newtype ListenRequestLabels = ListenRequestLabels'
{ _lrlAddtional :: HashMap Text Text
} deriving (Eq,Show,Data,Typeable,Generic)
listenRequestLabels
:: HashMap Text Text
-> ListenRequestLabels
listenRequestLabels pLrlAddtional_ =
ListenRequestLabels'
{ _lrlAddtional = _Coerce # pLrlAddtional_
}
lrlAddtional :: Lens' ListenRequestLabels (HashMap Text Text)
lrlAddtional
= lens _lrlAddtional (\ s a -> s{_lrlAddtional = a})
. _Coerce
instance FromJSON ListenRequestLabels where
parseJSON
= withObject "ListenRequestLabels"
(\ o -> ListenRequestLabels' <$> (parseJSONObject o))
instance ToJSON ListenRequestLabels where
toJSON = toJSON . _lrlAddtional
data GoogleFirestoreAdminV1Index = GoogleFirestoreAdminV1Index'
{ _gfaviState :: !(Maybe GoogleFirestoreAdminV1IndexState)
, _gfaviQueryScope :: !(Maybe GoogleFirestoreAdminV1IndexQueryScope)
, _gfaviName :: !(Maybe Text)
, _gfaviFields :: !(Maybe [GoogleFirestoreAdminV1IndexField])
} deriving (Eq,Show,Data,Typeable,Generic)
googleFirestoreAdminV1Index
:: GoogleFirestoreAdminV1Index
googleFirestoreAdminV1Index =
GoogleFirestoreAdminV1Index'
{ _gfaviState = Nothing
, _gfaviQueryScope = Nothing
, _gfaviName = Nothing
, _gfaviFields = Nothing
}
gfaviState :: Lens' GoogleFirestoreAdminV1Index (Maybe GoogleFirestoreAdminV1IndexState)
gfaviState
= lens _gfaviState (\ s a -> s{_gfaviState = a})
gfaviQueryScope :: Lens' GoogleFirestoreAdminV1Index (Maybe GoogleFirestoreAdminV1IndexQueryScope)
gfaviQueryScope
= lens _gfaviQueryScope
(\ s a -> s{_gfaviQueryScope = a})
gfaviName :: Lens' GoogleFirestoreAdminV1Index (Maybe Text)
gfaviName
= lens _gfaviName (\ s a -> s{_gfaviName = a})
gfaviFields :: Lens' GoogleFirestoreAdminV1Index [GoogleFirestoreAdminV1IndexField]
gfaviFields
= lens _gfaviFields (\ s a -> s{_gfaviFields = a}) .
_Default
. _Coerce
instance FromJSON GoogleFirestoreAdminV1Index where
parseJSON
= withObject "GoogleFirestoreAdminV1Index"
(\ o ->
GoogleFirestoreAdminV1Index' <$>
(o .:? "state") <*> (o .:? "queryScope") <*>
(o .:? "name")
<*> (o .:? "fields" .!= mempty))
instance ToJSON GoogleFirestoreAdminV1Index where
toJSON GoogleFirestoreAdminV1Index'{..}
= object
(catMaybes
[("state" .=) <$> _gfaviState,
("queryScope" .=) <$> _gfaviQueryScope,
("name" .=) <$> _gfaviName,
("fields" .=) <$> _gfaviFields])
newtype BeginTransactionResponse = BeginTransactionResponse'
{ _btrTransaction :: Maybe Bytes
} deriving (Eq,Show,Data,Typeable,Generic)
beginTransactionResponse
:: BeginTransactionResponse
beginTransactionResponse =
BeginTransactionResponse'
{ _btrTransaction = Nothing
}
btrTransaction :: Lens' BeginTransactionResponse (Maybe ByteString)
btrTransaction
= lens _btrTransaction
(\ s a -> s{_btrTransaction = a})
. mapping _Bytes
instance FromJSON BeginTransactionResponse where
parseJSON
= withObject "BeginTransactionResponse"
(\ o ->
BeginTransactionResponse' <$> (o .:? "transaction"))
instance ToJSON BeginTransactionResponse where
toJSON BeginTransactionResponse'{..}
= object
(catMaybes [("transaction" .=) <$> _btrTransaction])
data RunQueryResponse = RunQueryResponse'
{ _rReadTime :: !(Maybe DateTime')
, _rSkippedResults :: !(Maybe (Textual Int32))
, _rTransaction :: !(Maybe Bytes)
, _rDocument :: !(Maybe Document)
} deriving (Eq,Show,Data,Typeable,Generic)
runQueryResponse
:: RunQueryResponse
runQueryResponse =
RunQueryResponse'
{ _rReadTime = Nothing
, _rSkippedResults = Nothing
, _rTransaction = Nothing
, _rDocument = Nothing
}
rReadTime :: Lens' RunQueryResponse (Maybe UTCTime)
rReadTime
= lens _rReadTime (\ s a -> s{_rReadTime = a}) .
mapping _DateTime
rSkippedResults :: Lens' RunQueryResponse (Maybe Int32)
rSkippedResults
= lens _rSkippedResults
(\ s a -> s{_rSkippedResults = a})
. mapping _Coerce
rTransaction :: Lens' RunQueryResponse (Maybe ByteString)
rTransaction
= lens _rTransaction (\ s a -> s{_rTransaction = a})
. mapping _Bytes
rDocument :: Lens' RunQueryResponse (Maybe Document)
rDocument
= lens _rDocument (\ s a -> s{_rDocument = a})
instance FromJSON RunQueryResponse where
parseJSON
= withObject "RunQueryResponse"
(\ o ->
RunQueryResponse' <$>
(o .:? "readTime") <*> (o .:? "skippedResults") <*>
(o .:? "transaction")
<*> (o .:? "document"))
instance ToJSON RunQueryResponse where
toJSON RunQueryResponse'{..}
= object
(catMaybes
[("readTime" .=) <$> _rReadTime,
("skippedResults" .=) <$> _rSkippedResults,
("transaction" .=) <$> _rTransaction,
("document" .=) <$> _rDocument])
data GoogleFirestoreAdminV1ExportDocumentsMetadata = GoogleFirestoreAdminV1ExportDocumentsMetadata'
{ _gfavedmProgressBytes :: !(Maybe GoogleFirestoreAdminV1Progress)
, _gfavedmStartTime :: !(Maybe DateTime')
, _gfavedmCollectionIds :: !(Maybe [Text])
, _gfavedmProgressDocuments :: !(Maybe GoogleFirestoreAdminV1Progress)
, _gfavedmEndTime :: !(Maybe DateTime')
, _gfavedmOperationState :: !(Maybe GoogleFirestoreAdminV1ExportDocumentsMetadataOperationState)
, _gfavedmOutputURIPrefix :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
googleFirestoreAdminV1ExportDocumentsMetadata
:: GoogleFirestoreAdminV1ExportDocumentsMetadata
googleFirestoreAdminV1ExportDocumentsMetadata =
GoogleFirestoreAdminV1ExportDocumentsMetadata'
{ _gfavedmProgressBytes = Nothing
, _gfavedmStartTime = Nothing
, _gfavedmCollectionIds = Nothing
, _gfavedmProgressDocuments = Nothing
, _gfavedmEndTime = Nothing
, _gfavedmOperationState = Nothing
, _gfavedmOutputURIPrefix = Nothing
}
gfavedmProgressBytes :: Lens' GoogleFirestoreAdminV1ExportDocumentsMetadata (Maybe GoogleFirestoreAdminV1Progress)
gfavedmProgressBytes
= lens _gfavedmProgressBytes
(\ s a -> s{_gfavedmProgressBytes = a})
gfavedmStartTime :: Lens' GoogleFirestoreAdminV1ExportDocumentsMetadata (Maybe UTCTime)
gfavedmStartTime
= lens _gfavedmStartTime
(\ s a -> s{_gfavedmStartTime = a})
. mapping _DateTime
gfavedmCollectionIds :: Lens' GoogleFirestoreAdminV1ExportDocumentsMetadata [Text]
gfavedmCollectionIds
= lens _gfavedmCollectionIds
(\ s a -> s{_gfavedmCollectionIds = a})
. _Default
. _Coerce
gfavedmProgressDocuments :: Lens' GoogleFirestoreAdminV1ExportDocumentsMetadata (Maybe GoogleFirestoreAdminV1Progress)
gfavedmProgressDocuments
= lens _gfavedmProgressDocuments
(\ s a -> s{_gfavedmProgressDocuments = a})
gfavedmEndTime :: Lens' GoogleFirestoreAdminV1ExportDocumentsMetadata (Maybe UTCTime)
gfavedmEndTime
= lens _gfavedmEndTime
(\ s a -> s{_gfavedmEndTime = a})
. mapping _DateTime
gfavedmOperationState :: Lens' GoogleFirestoreAdminV1ExportDocumentsMetadata (Maybe GoogleFirestoreAdminV1ExportDocumentsMetadataOperationState)
gfavedmOperationState
= lens _gfavedmOperationState
(\ s a -> s{_gfavedmOperationState = a})
gfavedmOutputURIPrefix :: Lens' GoogleFirestoreAdminV1ExportDocumentsMetadata (Maybe Text)
gfavedmOutputURIPrefix
= lens _gfavedmOutputURIPrefix
(\ s a -> s{_gfavedmOutputURIPrefix = a})
instance FromJSON
GoogleFirestoreAdminV1ExportDocumentsMetadata where
parseJSON
= withObject
"GoogleFirestoreAdminV1ExportDocumentsMetadata"
(\ o ->
GoogleFirestoreAdminV1ExportDocumentsMetadata' <$>
(o .:? "progressBytes") <*> (o .:? "startTime") <*>
(o .:? "collectionIds" .!= mempty)
<*> (o .:? "progressDocuments")
<*> (o .:? "endTime")
<*> (o .:? "operationState")
<*> (o .:? "outputUriPrefix"))
instance ToJSON
GoogleFirestoreAdminV1ExportDocumentsMetadata where
toJSON
GoogleFirestoreAdminV1ExportDocumentsMetadata'{..}
= object
(catMaybes
[("progressBytes" .=) <$> _gfavedmProgressBytes,
("startTime" .=) <$> _gfavedmStartTime,
("collectionIds" .=) <$> _gfavedmCollectionIds,
("progressDocuments" .=) <$>
_gfavedmProgressDocuments,
("endTime" .=) <$> _gfavedmEndTime,
("operationState" .=) <$> _gfavedmOperationState,
("outputUriPrefix" .=) <$> _gfavedmOutputURIPrefix])
data GoogleFirestoreAdminV1Progress = GoogleFirestoreAdminV1Progress'
{ _gfavpCompletedWork :: !(Maybe (Textual Int64))
, _gfavpEstimatedWork :: !(Maybe (Textual Int64))
} deriving (Eq,Show,Data,Typeable,Generic)
googleFirestoreAdminV1Progress
:: GoogleFirestoreAdminV1Progress
googleFirestoreAdminV1Progress =
GoogleFirestoreAdminV1Progress'
{ _gfavpCompletedWork = Nothing
, _gfavpEstimatedWork = Nothing
}
gfavpCompletedWork :: Lens' GoogleFirestoreAdminV1Progress (Maybe Int64)
gfavpCompletedWork
= lens _gfavpCompletedWork
(\ s a -> s{_gfavpCompletedWork = a})
. mapping _Coerce
gfavpEstimatedWork :: Lens' GoogleFirestoreAdminV1Progress (Maybe Int64)
gfavpEstimatedWork
= lens _gfavpEstimatedWork
(\ s a -> s{_gfavpEstimatedWork = a})
. mapping _Coerce
instance FromJSON GoogleFirestoreAdminV1Progress
where
parseJSON
= withObject "GoogleFirestoreAdminV1Progress"
(\ o ->
GoogleFirestoreAdminV1Progress' <$>
(o .:? "completedWork") <*> (o .:? "estimatedWork"))
instance ToJSON GoogleFirestoreAdminV1Progress where
toJSON GoogleFirestoreAdminV1Progress'{..}
= object
(catMaybes
[("completedWork" .=) <$> _gfavpCompletedWork,
("estimatedWork" .=) <$> _gfavpEstimatedWork])
newtype DocumentMask = DocumentMask'
{ _dmFieldPaths :: Maybe [Text]
} deriving (Eq,Show,Data,Typeable,Generic)
documentMask
:: DocumentMask
documentMask =
DocumentMask'
{ _dmFieldPaths = Nothing
}
dmFieldPaths :: Lens' DocumentMask [Text]
dmFieldPaths
= lens _dmFieldPaths (\ s a -> s{_dmFieldPaths = a})
. _Default
. _Coerce
instance FromJSON DocumentMask where
parseJSON
= withObject "DocumentMask"
(\ o ->
DocumentMask' <$> (o .:? "fieldPaths" .!= mempty))
instance ToJSON DocumentMask where
toJSON DocumentMask'{..}
= object
(catMaybes [("fieldPaths" .=) <$> _dmFieldPaths])
data QueryTarget = QueryTarget'
{ _qtParent :: !(Maybe Text)
, _qtStructuredQuery :: !(Maybe StructuredQuery)
} deriving (Eq,Show,Data,Typeable,Generic)
queryTarget
:: QueryTarget
queryTarget =
QueryTarget'
{ _qtParent = Nothing
, _qtStructuredQuery = Nothing
}
qtParent :: Lens' QueryTarget (Maybe Text)
qtParent = lens _qtParent (\ s a -> s{_qtParent = a})
qtStructuredQuery :: Lens' QueryTarget (Maybe StructuredQuery)
qtStructuredQuery
= lens _qtStructuredQuery
(\ s a -> s{_qtStructuredQuery = a})
instance FromJSON QueryTarget where
parseJSON
= withObject "QueryTarget"
(\ o ->
QueryTarget' <$>
(o .:? "parent") <*> (o .:? "structuredQuery"))
instance ToJSON QueryTarget where
toJSON QueryTarget'{..}
= object
(catMaybes
[("parent" .=) <$> _qtParent,
("structuredQuery" .=) <$> _qtStructuredQuery])
data Value = Value'
{ _vGeoPointValue :: !(Maybe LatLng)
, _vBytesValue :: !(Maybe Bytes)
, _vIntegerValue :: !(Maybe (Textual Int64))
, _vTimestampValue :: !(Maybe DateTime')
, _vDoubleValue :: !(Maybe (Textual Double))
, _vStringValue :: !(Maybe Text)
, _vBooleanValue :: !(Maybe Bool)
, _vMapValue :: !(Maybe MapValue)
, _vArrayValue :: !(Maybe ArrayValue)
, _vReferenceValue :: !(Maybe Text)
, _vNullValue :: !(Maybe ValueNullValue)
} deriving (Eq,Show,Data,Typeable,Generic)
value
:: Value
value =
Value'
{ _vGeoPointValue = Nothing
, _vBytesValue = Nothing
, _vIntegerValue = Nothing
, _vTimestampValue = Nothing
, _vDoubleValue = Nothing
, _vStringValue = Nothing
, _vBooleanValue = Nothing
, _vMapValue = Nothing
, _vArrayValue = Nothing
, _vReferenceValue = Nothing
, _vNullValue = Nothing
}
vGeoPointValue :: Lens' Value (Maybe LatLng)
vGeoPointValue
= lens _vGeoPointValue
(\ s a -> s{_vGeoPointValue = a})
vBytesValue :: Lens' Value (Maybe ByteString)
vBytesValue
= lens _vBytesValue (\ s a -> s{_vBytesValue = a}) .
mapping _Bytes
vIntegerValue :: Lens' Value (Maybe Int64)
vIntegerValue
= lens _vIntegerValue
(\ s a -> s{_vIntegerValue = a})
. mapping _Coerce
vTimestampValue :: Lens' Value (Maybe UTCTime)
vTimestampValue
= lens _vTimestampValue
(\ s a -> s{_vTimestampValue = a})
. mapping _DateTime
vDoubleValue :: Lens' Value (Maybe Double)
vDoubleValue
= lens _vDoubleValue (\ s a -> s{_vDoubleValue = a})
. mapping _Coerce
vStringValue :: Lens' Value (Maybe Text)
vStringValue
= lens _vStringValue (\ s a -> s{_vStringValue = a})
vBooleanValue :: Lens' Value (Maybe Bool)
vBooleanValue
= lens _vBooleanValue
(\ s a -> s{_vBooleanValue = a})
vMapValue :: Lens' Value (Maybe MapValue)
vMapValue
= lens _vMapValue (\ s a -> s{_vMapValue = a})
vArrayValue :: Lens' Value (Maybe ArrayValue)
vArrayValue
= lens _vArrayValue (\ s a -> s{_vArrayValue = a})
vReferenceValue :: Lens' Value (Maybe Text)
vReferenceValue
= lens _vReferenceValue
(\ s a -> s{_vReferenceValue = a})
vNullValue :: Lens' Value (Maybe ValueNullValue)
vNullValue
= lens _vNullValue (\ s a -> s{_vNullValue = a})
instance FromJSON Value where
parseJSON
= withObject "Value"
(\ o ->
Value' <$>
(o .:? "geoPointValue") <*> (o .:? "bytesValue") <*>
(o .:? "integerValue")
<*> (o .:? "timestampValue")
<*> (o .:? "doubleValue")
<*> (o .:? "stringValue")
<*> (o .:? "booleanValue")
<*> (o .:? "mapValue")
<*> (o .:? "arrayValue")
<*> (o .:? "referenceValue")
<*> (o .:? "nullValue"))
instance ToJSON Value where
toJSON Value'{..}
= object
(catMaybes
[("geoPointValue" .=) <$> _vGeoPointValue,
("bytesValue" .=) <$> _vBytesValue,
("integerValue" .=) <$> _vIntegerValue,
("timestampValue" .=) <$> _vTimestampValue,
("doubleValue" .=) <$> _vDoubleValue,
("stringValue" .=) <$> _vStringValue,
("booleanValue" .=) <$> _vBooleanValue,
("mapValue" .=) <$> _vMapValue,
("arrayValue" .=) <$> _vArrayValue,
("referenceValue" .=) <$> _vReferenceValue,
("nullValue" .=) <$> _vNullValue])
newtype StatusDetailsItem = StatusDetailsItem'
{ _sdiAddtional :: HashMap Text JSONValue
} deriving (Eq,Show,Data,Typeable,Generic)
statusDetailsItem
:: HashMap Text JSONValue
-> StatusDetailsItem
statusDetailsItem pSdiAddtional_ =
StatusDetailsItem'
{ _sdiAddtional = _Coerce # pSdiAddtional_
}
sdiAddtional :: Lens' StatusDetailsItem (HashMap Text JSONValue)
sdiAddtional
= lens _sdiAddtional (\ s a -> s{_sdiAddtional = a})
. _Coerce
instance FromJSON StatusDetailsItem where
parseJSON
= withObject "StatusDetailsItem"
(\ o -> StatusDetailsItem' <$> (parseJSONObject o))
instance ToJSON StatusDetailsItem where
toJSON = toJSON . _sdiAddtional
data DocumentTransform = DocumentTransform'
{ _dtDocument :: !(Maybe Text)
, _dtFieldTransforms :: !(Maybe [FieldTransform])
} deriving (Eq,Show,Data,Typeable,Generic)
documentTransform
:: DocumentTransform
documentTransform =
DocumentTransform'
{ _dtDocument = Nothing
, _dtFieldTransforms = Nothing
}
dtDocument :: Lens' DocumentTransform (Maybe Text)
dtDocument
= lens _dtDocument (\ s a -> s{_dtDocument = a})
dtFieldTransforms :: Lens' DocumentTransform [FieldTransform]
dtFieldTransforms
= lens _dtFieldTransforms
(\ s a -> s{_dtFieldTransforms = a})
. _Default
. _Coerce
instance FromJSON DocumentTransform where
parseJSON
= withObject "DocumentTransform"
(\ o ->
DocumentTransform' <$>
(o .:? "document") <*>
(o .:? "fieldTransforms" .!= mempty))
instance ToJSON DocumentTransform where
toJSON DocumentTransform'{..}
= object
(catMaybes
[("document" .=) <$> _dtDocument,
("fieldTransforms" .=) <$> _dtFieldTransforms])
data StructuredQuery = StructuredQuery'
{ _sqWhere :: !(Maybe Filter)
, _sqOrderBy :: !(Maybe [Order])
, _sqStartAt :: !(Maybe Cursor)
, _sqOffSet :: !(Maybe (Textual Int32))
, _sqFrom :: !(Maybe [CollectionSelector])
, _sqEndAt :: !(Maybe Cursor)
, _sqLimit :: !(Maybe (Textual Int32))
, _sqSelect :: !(Maybe Projection)
} deriving (Eq,Show,Data,Typeable,Generic)
structuredQuery
:: StructuredQuery
structuredQuery =
StructuredQuery'
{ _sqWhere = Nothing
, _sqOrderBy = Nothing
, _sqStartAt = Nothing
, _sqOffSet = Nothing
, _sqFrom = Nothing
, _sqEndAt = Nothing
, _sqLimit = Nothing
, _sqSelect = Nothing
}
sqWhere :: Lens' StructuredQuery (Maybe Filter)
sqWhere = lens _sqWhere (\ s a -> s{_sqWhere = a})
sqOrderBy :: Lens' StructuredQuery [Order]
sqOrderBy
= lens _sqOrderBy (\ s a -> s{_sqOrderBy = a}) .
_Default
. _Coerce
sqStartAt :: Lens' StructuredQuery (Maybe Cursor)
sqStartAt
= lens _sqStartAt (\ s a -> s{_sqStartAt = a})
sqOffSet :: Lens' StructuredQuery (Maybe Int32)
sqOffSet
= lens _sqOffSet (\ s a -> s{_sqOffSet = a}) .
mapping _Coerce
sqFrom :: Lens' StructuredQuery [CollectionSelector]
sqFrom
= lens _sqFrom (\ s a -> s{_sqFrom = a}) . _Default .
_Coerce
sqEndAt :: Lens' StructuredQuery (Maybe Cursor)
sqEndAt = lens _sqEndAt (\ s a -> s{_sqEndAt = a})
sqLimit :: Lens' StructuredQuery (Maybe Int32)
sqLimit
= lens _sqLimit (\ s a -> s{_sqLimit = a}) .
mapping _Coerce
sqSelect :: Lens' StructuredQuery (Maybe Projection)
sqSelect = lens _sqSelect (\ s a -> s{_sqSelect = a})
instance FromJSON StructuredQuery where
parseJSON
= withObject "StructuredQuery"
(\ o ->
StructuredQuery' <$>
(o .:? "where") <*> (o .:? "orderBy" .!= mempty) <*>
(o .:? "startAt")
<*> (o .:? "offset")
<*> (o .:? "from" .!= mempty)
<*> (o .:? "endAt")
<*> (o .:? "limit")
<*> (o .:? "select"))
instance ToJSON StructuredQuery where
toJSON StructuredQuery'{..}
= object
(catMaybes
[("where" .=) <$> _sqWhere,
("orderBy" .=) <$> _sqOrderBy,
("startAt" .=) <$> _sqStartAt,
("offset" .=) <$> _sqOffSet, ("from" .=) <$> _sqFrom,
("endAt" .=) <$> _sqEndAt, ("limit" .=) <$> _sqLimit,
("select" .=) <$> _sqSelect])
data ExistenceFilter = ExistenceFilter'
{ _efTargetId :: !(Maybe (Textual Int32))
, _efCount :: !(Maybe (Textual Int32))
} deriving (Eq,Show,Data,Typeable,Generic)
existenceFilter
:: ExistenceFilter
existenceFilter =
ExistenceFilter'
{ _efTargetId = Nothing
, _efCount = Nothing
}
efTargetId :: Lens' ExistenceFilter (Maybe Int32)
efTargetId
= lens _efTargetId (\ s a -> s{_efTargetId = a}) .
mapping _Coerce
efCount :: Lens' ExistenceFilter (Maybe Int32)
efCount
= lens _efCount (\ s a -> s{_efCount = a}) .
mapping _Coerce
instance FromJSON ExistenceFilter where
parseJSON
= withObject "ExistenceFilter"
(\ o ->
ExistenceFilter' <$>
(o .:? "targetId") <*> (o .:? "count"))
instance ToJSON ExistenceFilter where
toJSON ExistenceFilter'{..}
= object
(catMaybes
[("targetId" .=) <$> _efTargetId,
("count" .=) <$> _efCount])
data GoogleFirestoreAdminV1ListFieldsResponse = GoogleFirestoreAdminV1ListFieldsResponse'
{ _gfavlfrNextPageToken :: !(Maybe Text)
, _gfavlfrFields :: !(Maybe [GoogleFirestoreAdminV1Field])
} deriving (Eq,Show,Data,Typeable,Generic)
googleFirestoreAdminV1ListFieldsResponse
:: GoogleFirestoreAdminV1ListFieldsResponse
googleFirestoreAdminV1ListFieldsResponse =
GoogleFirestoreAdminV1ListFieldsResponse'
{ _gfavlfrNextPageToken = Nothing
, _gfavlfrFields = Nothing
}
gfavlfrNextPageToken :: Lens' GoogleFirestoreAdminV1ListFieldsResponse (Maybe Text)
gfavlfrNextPageToken
= lens _gfavlfrNextPageToken
(\ s a -> s{_gfavlfrNextPageToken = a})
gfavlfrFields :: Lens' GoogleFirestoreAdminV1ListFieldsResponse [GoogleFirestoreAdminV1Field]
gfavlfrFields
= lens _gfavlfrFields
(\ s a -> s{_gfavlfrFields = a})
. _Default
. _Coerce
instance FromJSON
GoogleFirestoreAdminV1ListFieldsResponse where
parseJSON
= withObject
"GoogleFirestoreAdminV1ListFieldsResponse"
(\ o ->
GoogleFirestoreAdminV1ListFieldsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "fields" .!= mempty))
instance ToJSON
GoogleFirestoreAdminV1ListFieldsResponse where
toJSON GoogleFirestoreAdminV1ListFieldsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _gfavlfrNextPageToken,
("fields" .=) <$> _gfavlfrFields])
data GoogleFirestoreAdminV1ImportDocumentsRequest = GoogleFirestoreAdminV1ImportDocumentsRequest'
{ _gfavidrInputURIPrefix :: !(Maybe Text)
, _gfavidrCollectionIds :: !(Maybe [Text])
} deriving (Eq,Show,Data,Typeable,Generic)
googleFirestoreAdminV1ImportDocumentsRequest
:: GoogleFirestoreAdminV1ImportDocumentsRequest
googleFirestoreAdminV1ImportDocumentsRequest =
GoogleFirestoreAdminV1ImportDocumentsRequest'
{ _gfavidrInputURIPrefix = Nothing
, _gfavidrCollectionIds = Nothing
}
gfavidrInputURIPrefix :: Lens' GoogleFirestoreAdminV1ImportDocumentsRequest (Maybe Text)
gfavidrInputURIPrefix
= lens _gfavidrInputURIPrefix
(\ s a -> s{_gfavidrInputURIPrefix = a})
gfavidrCollectionIds :: Lens' GoogleFirestoreAdminV1ImportDocumentsRequest [Text]
gfavidrCollectionIds
= lens _gfavidrCollectionIds
(\ s a -> s{_gfavidrCollectionIds = a})
. _Default
. _Coerce
instance FromJSON
GoogleFirestoreAdminV1ImportDocumentsRequest where
parseJSON
= withObject
"GoogleFirestoreAdminV1ImportDocumentsRequest"
(\ o ->
GoogleFirestoreAdminV1ImportDocumentsRequest' <$>
(o .:? "inputUriPrefix") <*>
(o .:? "collectionIds" .!= mempty))
instance ToJSON
GoogleFirestoreAdminV1ImportDocumentsRequest where
toJSON
GoogleFirestoreAdminV1ImportDocumentsRequest'{..}
= object
(catMaybes
[("inputUriPrefix" .=) <$> _gfavidrInputURIPrefix,
("collectionIds" .=) <$> _gfavidrCollectionIds])
data GoogleFirestoreAdminV1LocationMetadata =
GoogleFirestoreAdminV1LocationMetadata'
deriving (Eq,Show,Data,Typeable,Generic)
googleFirestoreAdminV1LocationMetadata
:: GoogleFirestoreAdminV1LocationMetadata
googleFirestoreAdminV1LocationMetadata =
GoogleFirestoreAdminV1LocationMetadata'
instance FromJSON
GoogleFirestoreAdminV1LocationMetadata where
parseJSON
= withObject "GoogleFirestoreAdminV1LocationMetadata"
(\ o -> pure GoogleFirestoreAdminV1LocationMetadata')
instance ToJSON
GoogleFirestoreAdminV1LocationMetadata where
toJSON = const emptyObject
data GoogleLongrunningCancelOperationRequest =
GoogleLongrunningCancelOperationRequest'
deriving (Eq,Show,Data,Typeable,Generic)
googleLongrunningCancelOperationRequest
:: GoogleLongrunningCancelOperationRequest
googleLongrunningCancelOperationRequest =
GoogleLongrunningCancelOperationRequest'
instance FromJSON
GoogleLongrunningCancelOperationRequest where
parseJSON
= withObject
"GoogleLongrunningCancelOperationRequest"
(\ o ->
pure GoogleLongrunningCancelOperationRequest')
instance ToJSON
GoogleLongrunningCancelOperationRequest where
toJSON = const emptyObject
data ListCollectionIdsResponse = ListCollectionIdsResponse'
{ _lcirNextPageToken :: !(Maybe Text)
, _lcirCollectionIds :: !(Maybe [Text])
} deriving (Eq,Show,Data,Typeable,Generic)
listCollectionIdsResponse
:: ListCollectionIdsResponse
listCollectionIdsResponse =
ListCollectionIdsResponse'
{ _lcirNextPageToken = Nothing
, _lcirCollectionIds = Nothing
}
lcirNextPageToken :: Lens' ListCollectionIdsResponse (Maybe Text)
lcirNextPageToken
= lens _lcirNextPageToken
(\ s a -> s{_lcirNextPageToken = a})
lcirCollectionIds :: Lens' ListCollectionIdsResponse [Text]
lcirCollectionIds
= lens _lcirCollectionIds
(\ s a -> s{_lcirCollectionIds = a})
. _Default
. _Coerce
instance FromJSON ListCollectionIdsResponse where
parseJSON
= withObject "ListCollectionIdsResponse"
(\ o ->
ListCollectionIdsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "collectionIds" .!= mempty))
instance ToJSON ListCollectionIdsResponse where
toJSON ListCollectionIdsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lcirNextPageToken,
("collectionIds" .=) <$> _lcirCollectionIds])
newtype FieldReference = FieldReference'
{ _frFieldPath :: Maybe Text
} deriving (Eq,Show,Data,Typeable,Generic)
fieldReference
:: FieldReference
fieldReference =
FieldReference'
{ _frFieldPath = Nothing
}
frFieldPath :: Lens' FieldReference (Maybe Text)
frFieldPath
= lens _frFieldPath (\ s a -> s{_frFieldPath = a})
instance FromJSON FieldReference where
parseJSON
= withObject "FieldReference"
(\ o -> FieldReference' <$> (o .:? "fieldPath"))
instance ToJSON FieldReference where
toJSON FieldReference'{..}
= object
(catMaybes [("fieldPath" .=) <$> _frFieldPath])
data DocumentRemove = DocumentRemove'
{ _drReadTime :: !(Maybe DateTime')
, _drDocument :: !(Maybe Text)
, _drRemovedTargetIds :: !(Maybe [Textual Int32])
} deriving (Eq,Show,Data,Typeable,Generic)
documentRemove
:: DocumentRemove
documentRemove =
DocumentRemove'
{ _drReadTime = Nothing
, _drDocument = Nothing
, _drRemovedTargetIds = Nothing
}
drReadTime :: Lens' DocumentRemove (Maybe UTCTime)
drReadTime
= lens _drReadTime (\ s a -> s{_drReadTime = a}) .
mapping _DateTime
drDocument :: Lens' DocumentRemove (Maybe Text)
drDocument
= lens _drDocument (\ s a -> s{_drDocument = a})
drRemovedTargetIds :: Lens' DocumentRemove [Int32]
drRemovedTargetIds
= lens _drRemovedTargetIds
(\ s a -> s{_drRemovedTargetIds = a})
. _Default
. _Coerce
instance FromJSON DocumentRemove where
parseJSON
= withObject "DocumentRemove"
(\ o ->
DocumentRemove' <$>
(o .:? "readTime") <*> (o .:? "document") <*>
(o .:? "removedTargetIds" .!= mempty))
instance ToJSON DocumentRemove where
toJSON DocumentRemove'{..}
= object
(catMaybes
[("readTime" .=) <$> _drReadTime,
("document" .=) <$> _drDocument,
("removedTargetIds" .=) <$> _drRemovedTargetIds])
data DocumentChange = DocumentChange'
{ _dcDocument :: !(Maybe Document)
, _dcTargetIds :: !(Maybe [Textual Int32])
, _dcRemovedTargetIds :: !(Maybe [Textual Int32])
} deriving (Eq,Show,Data,Typeable,Generic)
documentChange
:: DocumentChange
documentChange =
DocumentChange'
{ _dcDocument = Nothing
, _dcTargetIds = Nothing
, _dcRemovedTargetIds = Nothing
}
dcDocument :: Lens' DocumentChange (Maybe Document)
dcDocument
= lens _dcDocument (\ s a -> s{_dcDocument = a})
dcTargetIds :: Lens' DocumentChange [Int32]
dcTargetIds
= lens _dcTargetIds (\ s a -> s{_dcTargetIds = a}) .
_Default
. _Coerce
dcRemovedTargetIds :: Lens' DocumentChange [Int32]
dcRemovedTargetIds
= lens _dcRemovedTargetIds
(\ s a -> s{_dcRemovedTargetIds = a})
. _Default
. _Coerce
instance FromJSON DocumentChange where
parseJSON
= withObject "DocumentChange"
(\ o ->
DocumentChange' <$>
(o .:? "document") <*> (o .:? "targetIds" .!= mempty)
<*> (o .:? "removedTargetIds" .!= mempty))
instance ToJSON DocumentChange where
toJSON DocumentChange'{..}
= object
(catMaybes
[("document" .=) <$> _dcDocument,
("targetIds" .=) <$> _dcTargetIds,
("removedTargetIds" .=) <$> _dcRemovedTargetIds])
data GoogleFirestoreAdminV1FieldOperationMetadata = GoogleFirestoreAdminV1FieldOperationMetadata'
{ _gfavfomProgressBytes :: !(Maybe GoogleFirestoreAdminV1Progress)
, _gfavfomState :: !(Maybe GoogleFirestoreAdminV1FieldOperationMetadataState)
, _gfavfomField :: !(Maybe Text)
, _gfavfomStartTime :: !(Maybe DateTime')
, _gfavfomProgressDocuments :: !(Maybe GoogleFirestoreAdminV1Progress)
, _gfavfomIndexConfigDeltas :: !(Maybe [GoogleFirestoreAdminV1IndexConfigDelta])
, _gfavfomEndTime :: !(Maybe DateTime')
} deriving (Eq,Show,Data,Typeable,Generic)
googleFirestoreAdminV1FieldOperationMetadata
:: GoogleFirestoreAdminV1FieldOperationMetadata
googleFirestoreAdminV1FieldOperationMetadata =
GoogleFirestoreAdminV1FieldOperationMetadata'
{ _gfavfomProgressBytes = Nothing
, _gfavfomState = Nothing
, _gfavfomField = Nothing
, _gfavfomStartTime = Nothing
, _gfavfomProgressDocuments = Nothing
, _gfavfomIndexConfigDeltas = Nothing
, _gfavfomEndTime = Nothing
}
gfavfomProgressBytes :: Lens' GoogleFirestoreAdminV1FieldOperationMetadata (Maybe GoogleFirestoreAdminV1Progress)
gfavfomProgressBytes
= lens _gfavfomProgressBytes
(\ s a -> s{_gfavfomProgressBytes = a})
gfavfomState :: Lens' GoogleFirestoreAdminV1FieldOperationMetadata (Maybe GoogleFirestoreAdminV1FieldOperationMetadataState)
gfavfomState
= lens _gfavfomState (\ s a -> s{_gfavfomState = a})
gfavfomField :: Lens' GoogleFirestoreAdminV1FieldOperationMetadata (Maybe Text)
gfavfomField
= lens _gfavfomField (\ s a -> s{_gfavfomField = a})
gfavfomStartTime :: Lens' GoogleFirestoreAdminV1FieldOperationMetadata (Maybe UTCTime)
gfavfomStartTime
= lens _gfavfomStartTime
(\ s a -> s{_gfavfomStartTime = a})
. mapping _DateTime
gfavfomProgressDocuments :: Lens' GoogleFirestoreAdminV1FieldOperationMetadata (Maybe GoogleFirestoreAdminV1Progress)
gfavfomProgressDocuments
= lens _gfavfomProgressDocuments
(\ s a -> s{_gfavfomProgressDocuments = a})
gfavfomIndexConfigDeltas :: Lens' GoogleFirestoreAdminV1FieldOperationMetadata [GoogleFirestoreAdminV1IndexConfigDelta]
gfavfomIndexConfigDeltas
= lens _gfavfomIndexConfigDeltas
(\ s a -> s{_gfavfomIndexConfigDeltas = a})
. _Default
. _Coerce
gfavfomEndTime :: Lens' GoogleFirestoreAdminV1FieldOperationMetadata (Maybe UTCTime)
gfavfomEndTime
= lens _gfavfomEndTime
(\ s a -> s{_gfavfomEndTime = a})
. mapping _DateTime
instance FromJSON
GoogleFirestoreAdminV1FieldOperationMetadata where
parseJSON
= withObject
"GoogleFirestoreAdminV1FieldOperationMetadata"
(\ o ->
GoogleFirestoreAdminV1FieldOperationMetadata' <$>
(o .:? "progressBytes") <*> (o .:? "state") <*>
(o .:? "field")
<*> (o .:? "startTime")
<*> (o .:? "progressDocuments")
<*> (o .:? "indexConfigDeltas" .!= mempty)
<*> (o .:? "endTime"))
instance ToJSON
GoogleFirestoreAdminV1FieldOperationMetadata where
toJSON
GoogleFirestoreAdminV1FieldOperationMetadata'{..}
= object
(catMaybes
[("progressBytes" .=) <$> _gfavfomProgressBytes,
("state" .=) <$> _gfavfomState,
("field" .=) <$> _gfavfomField,
("startTime" .=) <$> _gfavfomStartTime,
("progressDocuments" .=) <$>
_gfavfomProgressDocuments,
("indexConfigDeltas" .=) <$>
_gfavfomIndexConfigDeltas,
("endTime" .=) <$> _gfavfomEndTime])
data GoogleFirestoreAdminV1ListIndexesResponse = GoogleFirestoreAdminV1ListIndexesResponse'
{ _gfavlirNextPageToken :: !(Maybe Text)
, _gfavlirIndexes :: !(Maybe [GoogleFirestoreAdminV1Index])
} deriving (Eq,Show,Data,Typeable,Generic)
googleFirestoreAdminV1ListIndexesResponse
:: GoogleFirestoreAdminV1ListIndexesResponse
googleFirestoreAdminV1ListIndexesResponse =
GoogleFirestoreAdminV1ListIndexesResponse'
{ _gfavlirNextPageToken = Nothing
, _gfavlirIndexes = Nothing
}
gfavlirNextPageToken :: Lens' GoogleFirestoreAdminV1ListIndexesResponse (Maybe Text)
gfavlirNextPageToken
= lens _gfavlirNextPageToken
(\ s a -> s{_gfavlirNextPageToken = a})
gfavlirIndexes :: Lens' GoogleFirestoreAdminV1ListIndexesResponse [GoogleFirestoreAdminV1Index]
gfavlirIndexes
= lens _gfavlirIndexes
(\ s a -> s{_gfavlirIndexes = a})
. _Default
. _Coerce
instance FromJSON
GoogleFirestoreAdminV1ListIndexesResponse where
parseJSON
= withObject
"GoogleFirestoreAdminV1ListIndexesResponse"
(\ o ->
GoogleFirestoreAdminV1ListIndexesResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "indexes" .!= mempty))
instance ToJSON
GoogleFirestoreAdminV1ListIndexesResponse where
toJSON GoogleFirestoreAdminV1ListIndexesResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _gfavlirNextPageToken,
("indexes" .=) <$> _gfavlirIndexes])
newtype MapValue = MapValue'
{ _mvFields :: Maybe MapValueFields
} deriving (Eq,Show,Data,Typeable,Generic)
mapValue
:: MapValue
mapValue =
MapValue'
{ _mvFields = Nothing
}
mvFields :: Lens' MapValue (Maybe MapValueFields)
mvFields = lens _mvFields (\ s a -> s{_mvFields = a})
instance FromJSON MapValue where
parseJSON
= withObject "MapValue"
(\ o -> MapValue' <$> (o .:? "fields"))
instance ToJSON MapValue where
toJSON MapValue'{..}
= object (catMaybes [("fields" .=) <$> _mvFields])
data BatchGetDocumentsRequest = BatchGetDocumentsRequest'
{ _bReadTime :: !(Maybe DateTime')
, _bNewTransaction :: !(Maybe TransactionOptions)
, _bTransaction :: !(Maybe Bytes)
, _bDocuments :: !(Maybe [Text])
, _bMask :: !(Maybe DocumentMask)
} deriving (Eq,Show,Data,Typeable,Generic)
batchGetDocumentsRequest
:: BatchGetDocumentsRequest
batchGetDocumentsRequest =
BatchGetDocumentsRequest'
{ _bReadTime = Nothing
, _bNewTransaction = Nothing
, _bTransaction = Nothing
, _bDocuments = Nothing
, _bMask = Nothing
}
bReadTime :: Lens' BatchGetDocumentsRequest (Maybe UTCTime)
bReadTime
= lens _bReadTime (\ s a -> s{_bReadTime = a}) .
mapping _DateTime
bNewTransaction :: Lens' BatchGetDocumentsRequest (Maybe TransactionOptions)
bNewTransaction
= lens _bNewTransaction
(\ s a -> s{_bNewTransaction = a})
bTransaction :: Lens' BatchGetDocumentsRequest (Maybe ByteString)
bTransaction
= lens _bTransaction (\ s a -> s{_bTransaction = a})
. mapping _Bytes
bDocuments :: Lens' BatchGetDocumentsRequest [Text]
bDocuments
= lens _bDocuments (\ s a -> s{_bDocuments = a}) .
_Default
. _Coerce
bMask :: Lens' BatchGetDocumentsRequest (Maybe DocumentMask)
bMask = lens _bMask (\ s a -> s{_bMask = a})
instance FromJSON BatchGetDocumentsRequest where
parseJSON
= withObject "BatchGetDocumentsRequest"
(\ o ->
BatchGetDocumentsRequest' <$>
(o .:? "readTime") <*> (o .:? "newTransaction") <*>
(o .:? "transaction")
<*> (o .:? "documents" .!= mempty)
<*> (o .:? "mask"))
instance ToJSON BatchGetDocumentsRequest where
toJSON BatchGetDocumentsRequest'{..}
= object
(catMaybes
[("readTime" .=) <$> _bReadTime,
("newTransaction" .=) <$> _bNewTransaction,
("transaction" .=) <$> _bTransaction,
("documents" .=) <$> _bDocuments,
("mask" .=) <$> _bMask])
data Document = Document'
{ _dUpdateTime :: !(Maybe DateTime')
, _dName :: !(Maybe Text)
, _dCreateTime :: !(Maybe DateTime')
, _dFields :: !(Maybe DocumentFields)
} deriving (Eq,Show,Data,Typeable,Generic)
document
:: Document
document =
Document'
{ _dUpdateTime = Nothing
, _dName = Nothing
, _dCreateTime = Nothing
, _dFields = Nothing
}
dUpdateTime :: Lens' Document (Maybe UTCTime)
dUpdateTime
= lens _dUpdateTime (\ s a -> s{_dUpdateTime = a}) .
mapping _DateTime
dName :: Lens' Document (Maybe Text)
dName = lens _dName (\ s a -> s{_dName = a})
dCreateTime :: Lens' Document (Maybe UTCTime)
dCreateTime
= lens _dCreateTime (\ s a -> s{_dCreateTime = a}) .
mapping _DateTime
dFields :: Lens' Document (Maybe DocumentFields)
dFields = lens _dFields (\ s a -> s{_dFields = a})
instance FromJSON Document where
parseJSON
= withObject "Document"
(\ o ->
Document' <$>
(o .:? "updateTime") <*> (o .:? "name") <*>
(o .:? "createTime")
<*> (o .:? "fields"))
instance ToJSON Document where
toJSON Document'{..}
= object
(catMaybes
[("updateTime" .=) <$> _dUpdateTime,
("name" .=) <$> _dName,
("createTime" .=) <$> _dCreateTime,
("fields" .=) <$> _dFields])
newtype ArrayValue = ArrayValue'
{ _avValues :: Maybe [Value]
} deriving (Eq,Show,Data,Typeable,Generic)
arrayValue
:: ArrayValue
arrayValue =
ArrayValue'
{ _avValues = Nothing
}
avValues :: Lens' ArrayValue [Value]
avValues
= lens _avValues (\ s a -> s{_avValues = a}) .
_Default
. _Coerce
instance FromJSON ArrayValue where
parseJSON
= withObject "ArrayValue"
(\ o -> ArrayValue' <$> (o .:? "values" .!= mempty))
instance ToJSON ArrayValue where
toJSON ArrayValue'{..}
= object (catMaybes [("values" .=) <$> _avValues])
data CommitResponse = CommitResponse'
{ _crCommitTime :: !(Maybe DateTime')
, _crWriteResults :: !(Maybe [WriteResult])
} deriving (Eq,Show,Data,Typeable,Generic)
commitResponse
:: CommitResponse
commitResponse =
CommitResponse'
{ _crCommitTime = Nothing
, _crWriteResults = Nothing
}
crCommitTime :: Lens' CommitResponse (Maybe UTCTime)
crCommitTime
= lens _crCommitTime (\ s a -> s{_crCommitTime = a})
. mapping _DateTime
crWriteResults :: Lens' CommitResponse [WriteResult]
crWriteResults
= lens _crWriteResults
(\ s a -> s{_crWriteResults = a})
. _Default
. _Coerce
instance FromJSON CommitResponse where
parseJSON
= withObject "CommitResponse"
(\ o ->
CommitResponse' <$>
(o .:? "commitTime") <*>
(o .:? "writeResults" .!= mempty))
instance ToJSON CommitResponse where
toJSON CommitResponse'{..}
= object
(catMaybes
[("commitTime" .=) <$> _crCommitTime,
("writeResults" .=) <$> _crWriteResults])
data ListenResponse = ListenResponse'
{ _lrTargetChange :: !(Maybe TargetChange)
, _lrDocumentRemove :: !(Maybe DocumentRemove)
, _lrDocumentChange :: !(Maybe DocumentChange)
, _lrFilter :: !(Maybe ExistenceFilter)
, _lrDocumentDelete :: !(Maybe DocumentDelete)
} deriving (Eq,Show,Data,Typeable,Generic)
listenResponse
:: ListenResponse
listenResponse =
ListenResponse'
{ _lrTargetChange = Nothing
, _lrDocumentRemove = Nothing
, _lrDocumentChange = Nothing
, _lrFilter = Nothing
, _lrDocumentDelete = Nothing
}
lrTargetChange :: Lens' ListenResponse (Maybe TargetChange)
lrTargetChange
= lens _lrTargetChange
(\ s a -> s{_lrTargetChange = a})
lrDocumentRemove :: Lens' ListenResponse (Maybe DocumentRemove)
lrDocumentRemove
= lens _lrDocumentRemove
(\ s a -> s{_lrDocumentRemove = a})
lrDocumentChange :: Lens' ListenResponse (Maybe DocumentChange)
lrDocumentChange
= lens _lrDocumentChange
(\ s a -> s{_lrDocumentChange = a})
lrFilter :: Lens' ListenResponse (Maybe ExistenceFilter)
lrFilter = lens _lrFilter (\ s a -> s{_lrFilter = a})
lrDocumentDelete :: Lens' ListenResponse (Maybe DocumentDelete)
lrDocumentDelete
= lens _lrDocumentDelete
(\ s a -> s{_lrDocumentDelete = a})
instance FromJSON ListenResponse where
parseJSON
= withObject "ListenResponse"
(\ o ->
ListenResponse' <$>
(o .:? "targetChange") <*> (o .:? "documentRemove")
<*> (o .:? "documentChange")
<*> (o .:? "filter")
<*> (o .:? "documentDelete"))
instance ToJSON ListenResponse where
toJSON ListenResponse'{..}
= object
(catMaybes
[("targetChange" .=) <$> _lrTargetChange,
("documentRemove" .=) <$> _lrDocumentRemove,
("documentChange" .=) <$> _lrDocumentChange,
("filter" .=) <$> _lrFilter,
("documentDelete" .=) <$> _lrDocumentDelete])
data FieldFilter = FieldFilter'
{ _ffOp :: !(Maybe FieldFilterOp)
, _ffField :: !(Maybe FieldReference)
, _ffValue :: !(Maybe Value)
} deriving (Eq,Show,Data,Typeable,Generic)
fieldFilter
:: FieldFilter
fieldFilter =
FieldFilter'
{ _ffOp = Nothing
, _ffField = Nothing
, _ffValue = Nothing
}
ffOp :: Lens' FieldFilter (Maybe FieldFilterOp)
ffOp = lens _ffOp (\ s a -> s{_ffOp = a})
ffField :: Lens' FieldFilter (Maybe FieldReference)
ffField = lens _ffField (\ s a -> s{_ffField = a})
ffValue :: Lens' FieldFilter (Maybe Value)
ffValue = lens _ffValue (\ s a -> s{_ffValue = a})
instance FromJSON FieldFilter where
parseJSON
= withObject "FieldFilter"
(\ o ->
FieldFilter' <$>
(o .:? "op") <*> (o .:? "field") <*> (o .:? "value"))
instance ToJSON FieldFilter where
toJSON FieldFilter'{..}
= object
(catMaybes
[("op" .=) <$> _ffOp, ("field" .=) <$> _ffField,
("value" .=) <$> _ffValue])
newtype GoogleLongrunningOperationResponse = GoogleLongrunningOperationResponse'
{ _glorAddtional :: HashMap Text JSONValue
} deriving (Eq,Show,Data,Typeable,Generic)
googleLongrunningOperationResponse
:: HashMap Text JSONValue
-> GoogleLongrunningOperationResponse
googleLongrunningOperationResponse pGlorAddtional_ =
GoogleLongrunningOperationResponse'
{ _glorAddtional = _Coerce # pGlorAddtional_
}
glorAddtional :: Lens' GoogleLongrunningOperationResponse (HashMap Text JSONValue)
glorAddtional
= lens _glorAddtional
(\ s a -> s{_glorAddtional = a})
. _Coerce
instance FromJSON GoogleLongrunningOperationResponse
where
parseJSON
= withObject "GoogleLongrunningOperationResponse"
(\ o ->
GoogleLongrunningOperationResponse' <$>
(parseJSONObject o))
instance ToJSON GoogleLongrunningOperationResponse
where
toJSON = toJSON . _glorAddtional
data ListDocumentsResponse = ListDocumentsResponse'
{ _ldrNextPageToken :: !(Maybe Text)
, _ldrDocuments :: !(Maybe [Document])
} deriving (Eq,Show,Data,Typeable,Generic)
listDocumentsResponse
:: ListDocumentsResponse
listDocumentsResponse =
ListDocumentsResponse'
{ _ldrNextPageToken = Nothing
, _ldrDocuments = Nothing
}
ldrNextPageToken :: Lens' ListDocumentsResponse (Maybe Text)
ldrNextPageToken
= lens _ldrNextPageToken
(\ s a -> s{_ldrNextPageToken = a})
ldrDocuments :: Lens' ListDocumentsResponse [Document]
ldrDocuments
= lens _ldrDocuments (\ s a -> s{_ldrDocuments = a})
. _Default
. _Coerce
instance FromJSON ListDocumentsResponse where
parseJSON
= withObject "ListDocumentsResponse"
(\ o ->
ListDocumentsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "documents" .!= mempty))
instance ToJSON ListDocumentsResponse where
toJSON ListDocumentsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _ldrNextPageToken,
("documents" .=) <$> _ldrDocuments])
newtype GoogleFirestoreAdminV1ExportDocumentsResponse = GoogleFirestoreAdminV1ExportDocumentsResponse'
{ _gOutputURIPrefix :: Maybe Text
} deriving (Eq,Show,Data,Typeable,Generic)
googleFirestoreAdminV1ExportDocumentsResponse
:: GoogleFirestoreAdminV1ExportDocumentsResponse
googleFirestoreAdminV1ExportDocumentsResponse =
GoogleFirestoreAdminV1ExportDocumentsResponse'
{ _gOutputURIPrefix = Nothing
}
gOutputURIPrefix :: Lens' GoogleFirestoreAdminV1ExportDocumentsResponse (Maybe Text)
gOutputURIPrefix
= lens _gOutputURIPrefix
(\ s a -> s{_gOutputURIPrefix = a})
instance FromJSON
GoogleFirestoreAdminV1ExportDocumentsResponse where
parseJSON
= withObject
"GoogleFirestoreAdminV1ExportDocumentsResponse"
(\ o ->
GoogleFirestoreAdminV1ExportDocumentsResponse' <$>
(o .:? "outputUriPrefix"))
instance ToJSON
GoogleFirestoreAdminV1ExportDocumentsResponse where
toJSON
GoogleFirestoreAdminV1ExportDocumentsResponse'{..}
= object
(catMaybes
[("outputUriPrefix" .=) <$> _gOutputURIPrefix])
newtype Projection = Projection'
{ _pFields :: Maybe [FieldReference]
} deriving (Eq,Show,Data,Typeable,Generic)
projection
:: Projection
projection =
Projection'
{ _pFields = Nothing
}
pFields :: Lens' Projection [FieldReference]
pFields
= lens _pFields (\ s a -> s{_pFields = a}) . _Default
. _Coerce
instance FromJSON Projection where
parseJSON
= withObject "Projection"
(\ o -> Projection' <$> (o .:? "fields" .!= mempty))
instance ToJSON Projection where
toJSON Projection'{..}
= object (catMaybes [("fields" .=) <$> _pFields])
data Filter = Filter'
{ _fCompositeFilter :: !(Maybe CompositeFilter)
, _fFieldFilter :: !(Maybe FieldFilter)
, _fUnaryFilter :: !(Maybe UnaryFilter)
} deriving (Eq,Show,Data,Typeable,Generic)
filter'
:: Filter
filter' =
Filter'
{ _fCompositeFilter = Nothing
, _fFieldFilter = Nothing
, _fUnaryFilter = Nothing
}
fCompositeFilter :: Lens' Filter (Maybe CompositeFilter)
fCompositeFilter
= lens _fCompositeFilter
(\ s a -> s{_fCompositeFilter = a})
fFieldFilter :: Lens' Filter (Maybe FieldFilter)
fFieldFilter
= lens _fFieldFilter (\ s a -> s{_fFieldFilter = a})
fUnaryFilter :: Lens' Filter (Maybe UnaryFilter)
fUnaryFilter
= lens _fUnaryFilter (\ s a -> s{_fUnaryFilter = a})
instance FromJSON Filter where
parseJSON
= withObject "Filter"
(\ o ->
Filter' <$>
(o .:? "compositeFilter") <*> (o .:? "fieldFilter")
<*> (o .:? "unaryFilter"))
instance ToJSON Filter where
toJSON Filter'{..}
= object
(catMaybes
[("compositeFilter" .=) <$> _fCompositeFilter,
("fieldFilter" .=) <$> _fFieldFilter,
("unaryFilter" .=) <$> _fUnaryFilter])
data GoogleFirestoreAdminV1IndexOperationMetadata = GoogleFirestoreAdminV1IndexOperationMetadata'
{ _gfaviomProgressBytes :: !(Maybe GoogleFirestoreAdminV1Progress)
, _gfaviomState :: !(Maybe GoogleFirestoreAdminV1IndexOperationMetadataState)
, _gfaviomStartTime :: !(Maybe DateTime')
, _gfaviomProgressDocuments :: !(Maybe GoogleFirestoreAdminV1Progress)
, _gfaviomEndTime :: !(Maybe DateTime')
, _gfaviomIndex :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
googleFirestoreAdminV1IndexOperationMetadata
:: GoogleFirestoreAdminV1IndexOperationMetadata
googleFirestoreAdminV1IndexOperationMetadata =
GoogleFirestoreAdminV1IndexOperationMetadata'
{ _gfaviomProgressBytes = Nothing
, _gfaviomState = Nothing
, _gfaviomStartTime = Nothing
, _gfaviomProgressDocuments = Nothing
, _gfaviomEndTime = Nothing
, _gfaviomIndex = Nothing
}
gfaviomProgressBytes :: Lens' GoogleFirestoreAdminV1IndexOperationMetadata (Maybe GoogleFirestoreAdminV1Progress)
gfaviomProgressBytes
= lens _gfaviomProgressBytes
(\ s a -> s{_gfaviomProgressBytes = a})
gfaviomState :: Lens' GoogleFirestoreAdminV1IndexOperationMetadata (Maybe GoogleFirestoreAdminV1IndexOperationMetadataState)
gfaviomState
= lens _gfaviomState (\ s a -> s{_gfaviomState = a})
gfaviomStartTime :: Lens' GoogleFirestoreAdminV1IndexOperationMetadata (Maybe UTCTime)
gfaviomStartTime
= lens _gfaviomStartTime
(\ s a -> s{_gfaviomStartTime = a})
. mapping _DateTime
gfaviomProgressDocuments :: Lens' GoogleFirestoreAdminV1IndexOperationMetadata (Maybe GoogleFirestoreAdminV1Progress)
gfaviomProgressDocuments
= lens _gfaviomProgressDocuments
(\ s a -> s{_gfaviomProgressDocuments = a})
gfaviomEndTime :: Lens' GoogleFirestoreAdminV1IndexOperationMetadata (Maybe UTCTime)
gfaviomEndTime
= lens _gfaviomEndTime
(\ s a -> s{_gfaviomEndTime = a})
. mapping _DateTime
gfaviomIndex :: Lens' GoogleFirestoreAdminV1IndexOperationMetadata (Maybe Text)
gfaviomIndex
= lens _gfaviomIndex (\ s a -> s{_gfaviomIndex = a})
instance FromJSON
GoogleFirestoreAdminV1IndexOperationMetadata where
parseJSON
= withObject
"GoogleFirestoreAdminV1IndexOperationMetadata"
(\ o ->
GoogleFirestoreAdminV1IndexOperationMetadata' <$>
(o .:? "progressBytes") <*> (o .:? "state") <*>
(o .:? "startTime")
<*> (o .:? "progressDocuments")
<*> (o .:? "endTime")
<*> (o .:? "index"))
instance ToJSON
GoogleFirestoreAdminV1IndexOperationMetadata where
toJSON
GoogleFirestoreAdminV1IndexOperationMetadata'{..}
= object
(catMaybes
[("progressBytes" .=) <$> _gfaviomProgressBytes,
("state" .=) <$> _gfaviomState,
("startTime" .=) <$> _gfaviomStartTime,
("progressDocuments" .=) <$>
_gfaviomProgressDocuments,
("endTime" .=) <$> _gfaviomEndTime,
("index" .=) <$> _gfaviomIndex])
newtype LocationLabels = LocationLabels'
{ _llAddtional :: HashMap Text Text
} deriving (Eq,Show,Data,Typeable,Generic)
locationLabels
:: HashMap Text Text
-> LocationLabels
locationLabels pLlAddtional_ =
LocationLabels'
{ _llAddtional = _Coerce # pLlAddtional_
}
llAddtional :: Lens' LocationLabels (HashMap Text Text)
llAddtional
= lens _llAddtional (\ s a -> s{_llAddtional = a}) .
_Coerce
instance FromJSON LocationLabels where
parseJSON
= withObject "LocationLabels"
(\ o -> LocationLabels' <$> (parseJSONObject o))
instance ToJSON LocationLabels where
toJSON = toJSON . _llAddtional
data ListenRequest = ListenRequest'
{ _lrRemoveTarget :: !(Maybe (Textual Int32))
, _lrLabels :: !(Maybe ListenRequestLabels)
, _lrAddTarget :: !(Maybe Target)
} deriving (Eq,Show,Data,Typeable,Generic)
listenRequest
:: ListenRequest
listenRequest =
ListenRequest'
{ _lrRemoveTarget = Nothing
, _lrLabels = Nothing
, _lrAddTarget = Nothing
}
lrRemoveTarget :: Lens' ListenRequest (Maybe Int32)
lrRemoveTarget
= lens _lrRemoveTarget
(\ s a -> s{_lrRemoveTarget = a})
. mapping _Coerce
lrLabels :: Lens' ListenRequest (Maybe ListenRequestLabels)
lrLabels = lens _lrLabels (\ s a -> s{_lrLabels = a})
lrAddTarget :: Lens' ListenRequest (Maybe Target)
lrAddTarget
= lens _lrAddTarget (\ s a -> s{_lrAddTarget = a})
instance FromJSON ListenRequest where
parseJSON
= withObject "ListenRequest"
(\ o ->
ListenRequest' <$>
(o .:? "removeTarget") <*> (o .:? "labels") <*>
(o .:? "addTarget"))
instance ToJSON ListenRequest where
toJSON ListenRequest'{..}
= object
(catMaybes
[("removeTarget" .=) <$> _lrRemoveTarget,
("labels" .=) <$> _lrLabels,
("addTarget" .=) <$> _lrAddTarget])
data CommitRequest = CommitRequest'
{ _crTransaction :: !(Maybe Bytes)
, _crWrites :: !(Maybe [Write])
} deriving (Eq,Show,Data,Typeable,Generic)
commitRequest
:: CommitRequest
commitRequest =
CommitRequest'
{ _crTransaction = Nothing
, _crWrites = Nothing
}
crTransaction :: Lens' CommitRequest (Maybe ByteString)
crTransaction
= lens _crTransaction
(\ s a -> s{_crTransaction = a})
. mapping _Bytes
crWrites :: Lens' CommitRequest [Write]
crWrites
= lens _crWrites (\ s a -> s{_crWrites = a}) .
_Default
. _Coerce
instance FromJSON CommitRequest where
parseJSON
= withObject "CommitRequest"
(\ o ->
CommitRequest' <$>
(o .:? "transaction") <*>
(o .:? "writes" .!= mempty))
instance ToJSON CommitRequest where
toJSON CommitRequest'{..}
= object
(catMaybes
[("transaction" .=) <$> _crTransaction,
("writes" .=) <$> _crWrites])
newtype LocationMetadata = LocationMetadata'
{ _lmAddtional :: HashMap Text JSONValue
} deriving (Eq,Show,Data,Typeable,Generic)
locationMetadata
:: HashMap Text JSONValue
-> LocationMetadata
locationMetadata pLmAddtional_ =
LocationMetadata'
{ _lmAddtional = _Coerce # pLmAddtional_
}
lmAddtional :: Lens' LocationMetadata (HashMap Text JSONValue)
lmAddtional
= lens _lmAddtional (\ s a -> s{_lmAddtional = a}) .
_Coerce
instance FromJSON LocationMetadata where
parseJSON
= withObject "LocationMetadata"
(\ o -> LocationMetadata' <$> (parseJSONObject o))
instance ToJSON LocationMetadata where
toJSON = toJSON . _lmAddtional
data GoogleLongrunningListOperationsResponse = GoogleLongrunningListOperationsResponse'
{ _gllorNextPageToken :: !(Maybe Text)
, _gllorOperations :: !(Maybe [GoogleLongrunningOperation])
} deriving (Eq,Show,Data,Typeable,Generic)
googleLongrunningListOperationsResponse
:: GoogleLongrunningListOperationsResponse
googleLongrunningListOperationsResponse =
GoogleLongrunningListOperationsResponse'
{ _gllorNextPageToken = Nothing
, _gllorOperations = Nothing
}
gllorNextPageToken :: Lens' GoogleLongrunningListOperationsResponse (Maybe Text)
gllorNextPageToken
= lens _gllorNextPageToken
(\ s a -> s{_gllorNextPageToken = a})
gllorOperations :: Lens' GoogleLongrunningListOperationsResponse [GoogleLongrunningOperation]
gllorOperations
= lens _gllorOperations
(\ s a -> s{_gllorOperations = a})
. _Default
. _Coerce
instance FromJSON
GoogleLongrunningListOperationsResponse where
parseJSON
= withObject
"GoogleLongrunningListOperationsResponse"
(\ o ->
GoogleLongrunningListOperationsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "operations" .!= mempty))
instance ToJSON
GoogleLongrunningListOperationsResponse where
toJSON GoogleLongrunningListOperationsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _gllorNextPageToken,
("operations" .=) <$> _gllorOperations])
data CollectionSelector = CollectionSelector'
{ _csAllDescendants :: !(Maybe Bool)
, _csCollectionId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
collectionSelector
:: CollectionSelector
collectionSelector =
CollectionSelector'
{ _csAllDescendants = Nothing
, _csCollectionId = Nothing
}
csAllDescendants :: Lens' CollectionSelector (Maybe Bool)
csAllDescendants
= lens _csAllDescendants
(\ s a -> s{_csAllDescendants = a})
csCollectionId :: Lens' CollectionSelector (Maybe Text)
csCollectionId
= lens _csCollectionId
(\ s a -> s{_csCollectionId = a})
instance FromJSON CollectionSelector where
parseJSON
= withObject "CollectionSelector"
(\ o ->
CollectionSelector' <$>
(o .:? "allDescendants") <*> (o .:? "collectionId"))
instance ToJSON CollectionSelector where
toJSON CollectionSelector'{..}
= object
(catMaybes
[("allDescendants" .=) <$> _csAllDescendants,
("collectionId" .=) <$> _csCollectionId])
data ListCollectionIdsRequest = ListCollectionIdsRequest'
{ _lcirPageToken :: !(Maybe Text)
, _lcirPageSize :: !(Maybe (Textual Int32))
} deriving (Eq,Show,Data,Typeable,Generic)
listCollectionIdsRequest
:: ListCollectionIdsRequest
listCollectionIdsRequest =
ListCollectionIdsRequest'
{ _lcirPageToken = Nothing
, _lcirPageSize = Nothing
}
lcirPageToken :: Lens' ListCollectionIdsRequest (Maybe Text)
lcirPageToken
= lens _lcirPageToken
(\ s a -> s{_lcirPageToken = a})
lcirPageSize :: Lens' ListCollectionIdsRequest (Maybe Int32)
lcirPageSize
= lens _lcirPageSize (\ s a -> s{_lcirPageSize = a})
. mapping _Coerce
instance FromJSON ListCollectionIdsRequest where
parseJSON
= withObject "ListCollectionIdsRequest"
(\ o ->
ListCollectionIdsRequest' <$>
(o .:? "pageToken") <*> (o .:? "pageSize"))
instance ToJSON ListCollectionIdsRequest where
toJSON ListCollectionIdsRequest'{..}
= object
(catMaybes
[("pageToken" .=) <$> _lcirPageToken,
("pageSize" .=) <$> _lcirPageSize])
data WriteResponse = WriteResponse'
{ _wStreamToken :: !(Maybe Bytes)
, _wCommitTime :: !(Maybe DateTime')
, _wWriteResults :: !(Maybe [WriteResult])
, _wStreamId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
writeResponse
:: WriteResponse
writeResponse =
WriteResponse'
{ _wStreamToken = Nothing
, _wCommitTime = Nothing
, _wWriteResults = Nothing
, _wStreamId = Nothing
}
wStreamToken :: Lens' WriteResponse (Maybe ByteString)
wStreamToken
= lens _wStreamToken (\ s a -> s{_wStreamToken = a})
. mapping _Bytes
wCommitTime :: Lens' WriteResponse (Maybe UTCTime)
wCommitTime
= lens _wCommitTime (\ s a -> s{_wCommitTime = a}) .
mapping _DateTime
wWriteResults :: Lens' WriteResponse [WriteResult]
wWriteResults
= lens _wWriteResults
(\ s a -> s{_wWriteResults = a})
. _Default
. _Coerce
wStreamId :: Lens' WriteResponse (Maybe Text)
wStreamId
= lens _wStreamId (\ s a -> s{_wStreamId = a})
instance FromJSON WriteResponse where
parseJSON
= withObject "WriteResponse"
(\ o ->
WriteResponse' <$>
(o .:? "streamToken") <*> (o .:? "commitTime") <*>
(o .:? "writeResults" .!= mempty)
<*> (o .:? "streamId"))
instance ToJSON WriteResponse where
toJSON WriteResponse'{..}
= object
(catMaybes
[("streamToken" .=) <$> _wStreamToken,
("commitTime" .=) <$> _wCommitTime,
("writeResults" .=) <$> _wWriteResults,
("streamId" .=) <$> _wStreamId])
data Order = Order'
{ _oField :: !(Maybe FieldReference)
, _oDirection :: !(Maybe OrderDirection)
} deriving (Eq,Show,Data,Typeable,Generic)
order
:: Order
order =
Order'
{ _oField = Nothing
, _oDirection = Nothing
}
oField :: Lens' Order (Maybe FieldReference)
oField = lens _oField (\ s a -> s{_oField = a})
oDirection :: Lens' Order (Maybe OrderDirection)
oDirection
= lens _oDirection (\ s a -> s{_oDirection = a})
instance FromJSON Order where
parseJSON
= withObject "Order"
(\ o ->
Order' <$> (o .:? "field") <*> (o .:? "direction"))
instance ToJSON Order where
toJSON Order'{..}
= object
(catMaybes
[("field" .=) <$> _oField,
("direction" .=) <$> _oDirection])
data DocumentDelete = DocumentDelete'
{ _ddReadTime :: !(Maybe DateTime')
, _ddDocument :: !(Maybe Text)
, _ddRemovedTargetIds :: !(Maybe [Textual Int32])
} deriving (Eq,Show,Data,Typeable,Generic)
documentDelete
:: DocumentDelete
documentDelete =
DocumentDelete'
{ _ddReadTime = Nothing
, _ddDocument = Nothing
, _ddRemovedTargetIds = Nothing
}
ddReadTime :: Lens' DocumentDelete (Maybe UTCTime)
ddReadTime
= lens _ddReadTime (\ s a -> s{_ddReadTime = a}) .
mapping _DateTime
ddDocument :: Lens' DocumentDelete (Maybe Text)
ddDocument
= lens _ddDocument (\ s a -> s{_ddDocument = a})
ddRemovedTargetIds :: Lens' DocumentDelete [Int32]
ddRemovedTargetIds
= lens _ddRemovedTargetIds
(\ s a -> s{_ddRemovedTargetIds = a})
. _Default
. _Coerce
instance FromJSON DocumentDelete where
parseJSON
= withObject "DocumentDelete"
(\ o ->
DocumentDelete' <$>
(o .:? "readTime") <*> (o .:? "document") <*>
(o .:? "removedTargetIds" .!= mempty))
instance ToJSON DocumentDelete where
toJSON DocumentDelete'{..}
= object
(catMaybes
[("readTime" .=) <$> _ddReadTime,
("document" .=) <$> _ddDocument,
("removedTargetIds" .=) <$> _ddRemovedTargetIds])
data FieldTransform = FieldTransform'
{ _ftFieldPath :: !(Maybe Text)
, _ftAppendMissingElements :: !(Maybe ArrayValue)
, _ftSetToServerValue :: !(Maybe FieldTransformSetToServerValue)
, _ftRemoveAllFromArray :: !(Maybe ArrayValue)
} deriving (Eq,Show,Data,Typeable,Generic)
fieldTransform
:: FieldTransform
fieldTransform =
FieldTransform'
{ _ftFieldPath = Nothing
, _ftAppendMissingElements = Nothing
, _ftSetToServerValue = Nothing
, _ftRemoveAllFromArray = Nothing
}
ftFieldPath :: Lens' FieldTransform (Maybe Text)
ftFieldPath
= lens _ftFieldPath (\ s a -> s{_ftFieldPath = a})
ftAppendMissingElements :: Lens' FieldTransform (Maybe ArrayValue)
ftAppendMissingElements
= lens _ftAppendMissingElements
(\ s a -> s{_ftAppendMissingElements = a})
ftSetToServerValue :: Lens' FieldTransform (Maybe FieldTransformSetToServerValue)
ftSetToServerValue
= lens _ftSetToServerValue
(\ s a -> s{_ftSetToServerValue = a})
ftRemoveAllFromArray :: Lens' FieldTransform (Maybe ArrayValue)
ftRemoveAllFromArray
= lens _ftRemoveAllFromArray
(\ s a -> s{_ftRemoveAllFromArray = a})
instance FromJSON FieldTransform where
parseJSON
= withObject "FieldTransform"
(\ o ->
FieldTransform' <$>
(o .:? "fieldPath") <*>
(o .:? "appendMissingElements")
<*> (o .:? "setToServerValue")
<*> (o .:? "removeAllFromArray"))
instance ToJSON FieldTransform where
toJSON FieldTransform'{..}
= object
(catMaybes
[("fieldPath" .=) <$> _ftFieldPath,
("appendMissingElements" .=) <$>
_ftAppendMissingElements,
("setToServerValue" .=) <$> _ftSetToServerValue,
("removeAllFromArray" .=) <$> _ftRemoveAllFromArray])
newtype MapValueFields = MapValueFields'
{ _mvfAddtional :: HashMap Text Value
} deriving (Eq,Show,Data,Typeable,Generic)
mapValueFields
:: HashMap Text Value
-> MapValueFields
mapValueFields pMvfAddtional_ =
MapValueFields'
{ _mvfAddtional = _Coerce # pMvfAddtional_
}
mvfAddtional :: Lens' MapValueFields (HashMap Text Value)
mvfAddtional
= lens _mvfAddtional (\ s a -> s{_mvfAddtional = a})
. _Coerce
instance FromJSON MapValueFields where
parseJSON
= withObject "MapValueFields"
(\ o -> MapValueFields' <$> (parseJSONObject o))
instance ToJSON MapValueFields where
toJSON = toJSON . _mvfAddtional
newtype DocumentFields = DocumentFields'
{ _dfAddtional :: HashMap Text Value
} deriving (Eq,Show,Data,Typeable,Generic)
documentFields
:: HashMap Text Value
-> DocumentFields
documentFields pDfAddtional_ =
DocumentFields'
{ _dfAddtional = _Coerce # pDfAddtional_
}
dfAddtional :: Lens' DocumentFields (HashMap Text Value)
dfAddtional
= lens _dfAddtional (\ s a -> s{_dfAddtional = a}) .
_Coerce
instance FromJSON DocumentFields where
parseJSON
= withObject "DocumentFields"
(\ o -> DocumentFields' <$> (parseJSONObject o))
instance ToJSON DocumentFields where
toJSON = toJSON . _dfAddtional
newtype ReadOnly = ReadOnly'
{ _roReadTime :: Maybe DateTime'
} deriving (Eq,Show,Data,Typeable,Generic)
readOnly
:: ReadOnly
readOnly =
ReadOnly'
{ _roReadTime = Nothing
}
roReadTime :: Lens' ReadOnly (Maybe UTCTime)
roReadTime
= lens _roReadTime (\ s a -> s{_roReadTime = a}) .
mapping _DateTime
instance FromJSON ReadOnly where
parseJSON
= withObject "ReadOnly"
(\ o -> ReadOnly' <$> (o .:? "readTime"))
instance ToJSON ReadOnly where
toJSON ReadOnly'{..}
= object
(catMaybes [("readTime" .=) <$> _roReadTime])
data Target = Target'
{ _tTargetId :: !(Maybe (Textual Int32))
, _tOnce :: !(Maybe Bool)
, _tReadTime :: !(Maybe DateTime')
, _tResumeToken :: !(Maybe Bytes)
, _tDocuments :: !(Maybe DocumentsTarget)
, _tQuery :: !(Maybe QueryTarget)
} deriving (Eq,Show,Data,Typeable,Generic)
target
:: Target
target =
Target'
{ _tTargetId = Nothing
, _tOnce = Nothing
, _tReadTime = Nothing
, _tResumeToken = Nothing
, _tDocuments = Nothing
, _tQuery = Nothing
}
tTargetId :: Lens' Target (Maybe Int32)
tTargetId
= lens _tTargetId (\ s a -> s{_tTargetId = a}) .
mapping _Coerce
tOnce :: Lens' Target (Maybe Bool)
tOnce = lens _tOnce (\ s a -> s{_tOnce = a})
tReadTime :: Lens' Target (Maybe UTCTime)
tReadTime
= lens _tReadTime (\ s a -> s{_tReadTime = a}) .
mapping _DateTime
tResumeToken :: Lens' Target (Maybe ByteString)
tResumeToken
= lens _tResumeToken (\ s a -> s{_tResumeToken = a})
. mapping _Bytes
tDocuments :: Lens' Target (Maybe DocumentsTarget)
tDocuments
= lens _tDocuments (\ s a -> s{_tDocuments = a})
tQuery :: Lens' Target (Maybe QueryTarget)
tQuery = lens _tQuery (\ s a -> s{_tQuery = a})
instance FromJSON Target where
parseJSON
= withObject "Target"
(\ o ->
Target' <$>
(o .:? "targetId") <*> (o .:? "once") <*>
(o .:? "readTime")
<*> (o .:? "resumeToken")
<*> (o .:? "documents")
<*> (o .:? "query"))
instance ToJSON Target where
toJSON Target'{..}
= object
(catMaybes
[("targetId" .=) <$> _tTargetId,
("once" .=) <$> _tOnce,
("readTime" .=) <$> _tReadTime,
("resumeToken" .=) <$> _tResumeToken,
("documents" .=) <$> _tDocuments,
("query" .=) <$> _tQuery])
newtype WriteRequestLabels = WriteRequestLabels'
{ _wrlAddtional :: HashMap Text Text
} deriving (Eq,Show,Data,Typeable,Generic)
writeRequestLabels
:: HashMap Text Text
-> WriteRequestLabels
writeRequestLabels pWrlAddtional_ =
WriteRequestLabels'
{ _wrlAddtional = _Coerce # pWrlAddtional_
}
wrlAddtional :: Lens' WriteRequestLabels (HashMap Text Text)
wrlAddtional
= lens _wrlAddtional (\ s a -> s{_wrlAddtional = a})
. _Coerce
instance FromJSON WriteRequestLabels where
parseJSON
= withObject "WriteRequestLabels"
(\ o -> WriteRequestLabels' <$> (parseJSONObject o))
instance ToJSON WriteRequestLabels where
toJSON = toJSON . _wrlAddtional
data GoogleLongrunningOperation = GoogleLongrunningOperation'
{ _gloDone :: !(Maybe Bool)
, _gloError :: !(Maybe Status)
, _gloResponse :: !(Maybe GoogleLongrunningOperationResponse)
, _gloName :: !(Maybe Text)
, _gloMetadata :: !(Maybe GoogleLongrunningOperationMetadata)
} deriving (Eq,Show,Data,Typeable,Generic)
googleLongrunningOperation
:: GoogleLongrunningOperation
googleLongrunningOperation =
GoogleLongrunningOperation'
{ _gloDone = Nothing
, _gloError = Nothing
, _gloResponse = Nothing
, _gloName = Nothing
, _gloMetadata = Nothing
}
gloDone :: Lens' GoogleLongrunningOperation (Maybe Bool)
gloDone = lens _gloDone (\ s a -> s{_gloDone = a})
gloError :: Lens' GoogleLongrunningOperation (Maybe Status)
gloError = lens _gloError (\ s a -> s{_gloError = a})
gloResponse :: Lens' GoogleLongrunningOperation (Maybe GoogleLongrunningOperationResponse)
gloResponse
= lens _gloResponse (\ s a -> s{_gloResponse = a})
gloName :: Lens' GoogleLongrunningOperation (Maybe Text)
gloName = lens _gloName (\ s a -> s{_gloName = a})
gloMetadata :: Lens' GoogleLongrunningOperation (Maybe GoogleLongrunningOperationMetadata)
gloMetadata
= lens _gloMetadata (\ s a -> s{_gloMetadata = a})
instance FromJSON GoogleLongrunningOperation where
parseJSON
= withObject "GoogleLongrunningOperation"
(\ o ->
GoogleLongrunningOperation' <$>
(o .:? "done") <*> (o .:? "error") <*>
(o .:? "response")
<*> (o .:? "name")
<*> (o .:? "metadata"))
instance ToJSON GoogleLongrunningOperation where
toJSON GoogleLongrunningOperation'{..}
= object
(catMaybes
[("done" .=) <$> _gloDone,
("error" .=) <$> _gloError,
("response" .=) <$> _gloResponse,
("name" .=) <$> _gloName,
("metadata" .=) <$> _gloMetadata])
data UnaryFilter = UnaryFilter'
{ _ufOp :: !(Maybe UnaryFilterOp)
, _ufField :: !(Maybe FieldReference)
} deriving (Eq,Show,Data,Typeable,Generic)
unaryFilter
:: UnaryFilter
unaryFilter =
UnaryFilter'
{ _ufOp = Nothing
, _ufField = Nothing
}
ufOp :: Lens' UnaryFilter (Maybe UnaryFilterOp)
ufOp = lens _ufOp (\ s a -> s{_ufOp = a})
ufField :: Lens' UnaryFilter (Maybe FieldReference)
ufField = lens _ufField (\ s a -> s{_ufField = a})
instance FromJSON UnaryFilter where
parseJSON
= withObject "UnaryFilter"
(\ o ->
UnaryFilter' <$> (o .:? "op") <*> (o .:? "field"))
instance ToJSON UnaryFilter where
toJSON UnaryFilter'{..}
= object
(catMaybes
[("op" .=) <$> _ufOp, ("field" .=) <$> _ufField])