{-# 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.SafeBrowsing.Types.Product where
import Network.Google.Prelude
import Network.Google.SafeBrowsing.Types.Sum
newtype ThreatEntryMetadata = ThreatEntryMetadata'
{ _temEntries :: Maybe [MetadataEntry]
} deriving (Eq,Show,Data,Typeable,Generic)
threatEntryMetadata
:: ThreatEntryMetadata
threatEntryMetadata =
ThreatEntryMetadata'
{ _temEntries = Nothing
}
temEntries :: Lens' ThreatEntryMetadata [MetadataEntry]
temEntries
= lens _temEntries (\ s a -> s{_temEntries = a}) .
_Default
. _Coerce
instance FromJSON ThreatEntryMetadata where
parseJSON
= withObject "ThreatEntryMetadata"
(\ o ->
ThreatEntryMetadata' <$>
(o .:? "entries" .!= mempty))
instance ToJSON ThreatEntryMetadata where
toJSON ThreatEntryMetadata'{..}
= object (catMaybes [("entries" .=) <$> _temEntries])
data UserInfo = UserInfo'
{ _uiRegionCode :: !(Maybe Text)
, _uiUserId :: !(Maybe Bytes)
} deriving (Eq,Show,Data,Typeable,Generic)
userInfo
:: UserInfo
userInfo =
UserInfo'
{ _uiRegionCode = Nothing
, _uiUserId = Nothing
}
uiRegionCode :: Lens' UserInfo (Maybe Text)
uiRegionCode
= lens _uiRegionCode (\ s a -> s{_uiRegionCode = a})
uiUserId :: Lens' UserInfo (Maybe ByteString)
uiUserId
= lens _uiUserId (\ s a -> s{_uiUserId = a}) .
mapping _Bytes
instance FromJSON UserInfo where
parseJSON
= withObject "UserInfo"
(\ o ->
UserInfo' <$>
(o .:? "regionCode") <*> (o .:? "userId"))
instance ToJSON UserInfo where
toJSON UserInfo'{..}
= object
(catMaybes
[("regionCode" .=) <$> _uiRegionCode,
("userId" .=) <$> _uiUserId])
newtype Checksum = Checksum'
{ _cSha256 :: Maybe Bytes
} deriving (Eq,Show,Data,Typeable,Generic)
checksum
:: Checksum
checksum =
Checksum'
{ _cSha256 = Nothing
}
cSha256 :: Lens' Checksum (Maybe ByteString)
cSha256
= lens _cSha256 (\ s a -> s{_cSha256 = a}) .
mapping _Bytes
instance FromJSON Checksum where
parseJSON
= withObject "Checksum"
(\ o -> Checksum' <$> (o .:? "sha256"))
instance ToJSON Checksum where
toJSON Checksum'{..}
= object (catMaybes [("sha256" .=) <$> _cSha256])
newtype FindThreatMatchesResponse = FindThreatMatchesResponse'
{ _ftmrMatches :: Maybe [ThreatMatch]
} deriving (Eq,Show,Data,Typeable,Generic)
findThreatMatchesResponse
:: FindThreatMatchesResponse
findThreatMatchesResponse =
FindThreatMatchesResponse'
{ _ftmrMatches = Nothing
}
ftmrMatches :: Lens' FindThreatMatchesResponse [ThreatMatch]
ftmrMatches
= lens _ftmrMatches (\ s a -> s{_ftmrMatches = a}) .
_Default
. _Coerce
instance FromJSON FindThreatMatchesResponse where
parseJSON
= withObject "FindThreatMatchesResponse"
(\ o ->
FindThreatMatchesResponse' <$>
(o .:? "matches" .!= mempty))
instance ToJSON FindThreatMatchesResponse where
toJSON FindThreatMatchesResponse'{..}
= object
(catMaybes [("matches" .=) <$> _ftmrMatches])
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 ThreatInfo = ThreatInfo'
{ _tiThreatEntries :: !(Maybe [ThreatEntry])
, _tiThreatTypes :: !(Maybe [Text])
, _tiPlatformTypes :: !(Maybe [Text])
, _tiThreatEntryTypes :: !(Maybe [Text])
} deriving (Eq,Show,Data,Typeable,Generic)
threatInfo
:: ThreatInfo
threatInfo =
ThreatInfo'
{ _tiThreatEntries = Nothing
, _tiThreatTypes = Nothing
, _tiPlatformTypes = Nothing
, _tiThreatEntryTypes = Nothing
}
tiThreatEntries :: Lens' ThreatInfo [ThreatEntry]
tiThreatEntries
= lens _tiThreatEntries
(\ s a -> s{_tiThreatEntries = a})
. _Default
. _Coerce
tiThreatTypes :: Lens' ThreatInfo [Text]
tiThreatTypes
= lens _tiThreatTypes
(\ s a -> s{_tiThreatTypes = a})
. _Default
. _Coerce
tiPlatformTypes :: Lens' ThreatInfo [Text]
tiPlatformTypes
= lens _tiPlatformTypes
(\ s a -> s{_tiPlatformTypes = a})
. _Default
. _Coerce
tiThreatEntryTypes :: Lens' ThreatInfo [Text]
tiThreatEntryTypes
= lens _tiThreatEntryTypes
(\ s a -> s{_tiThreatEntryTypes = a})
. _Default
. _Coerce
instance FromJSON ThreatInfo where
parseJSON
= withObject "ThreatInfo"
(\ o ->
ThreatInfo' <$>
(o .:? "threatEntries" .!= mempty) <*>
(o .:? "threatTypes" .!= mempty)
<*> (o .:? "platformTypes" .!= mempty)
<*> (o .:? "threatEntryTypes" .!= mempty))
instance ToJSON ThreatInfo where
toJSON ThreatInfo'{..}
= object
(catMaybes
[("threatEntries" .=) <$> _tiThreatEntries,
("threatTypes" .=) <$> _tiThreatTypes,
("platformTypes" .=) <$> _tiPlatformTypes,
("threatEntryTypes" .=) <$> _tiThreatEntryTypes])
data ThreatHit = ThreatHit'
{ _thUserInfo :: !(Maybe UserInfo)
, _thThreatType :: !(Maybe ThreatHitThreatType)
, _thResources :: !(Maybe [ThreatSource])
, _thEntry :: !(Maybe ThreatEntry)
, _thClientInfo :: !(Maybe ClientInfo)
, _thPlatformType :: !(Maybe ThreatHitPlatformType)
} deriving (Eq,Show,Data,Typeable,Generic)
threatHit
:: ThreatHit
threatHit =
ThreatHit'
{ _thUserInfo = Nothing
, _thThreatType = Nothing
, _thResources = Nothing
, _thEntry = Nothing
, _thClientInfo = Nothing
, _thPlatformType = Nothing
}
thUserInfo :: Lens' ThreatHit (Maybe UserInfo)
thUserInfo
= lens _thUserInfo (\ s a -> s{_thUserInfo = a})
thThreatType :: Lens' ThreatHit (Maybe ThreatHitThreatType)
thThreatType
= lens _thThreatType (\ s a -> s{_thThreatType = a})
thResources :: Lens' ThreatHit [ThreatSource]
thResources
= lens _thResources (\ s a -> s{_thResources = a}) .
_Default
. _Coerce
thEntry :: Lens' ThreatHit (Maybe ThreatEntry)
thEntry = lens _thEntry (\ s a -> s{_thEntry = a})
thClientInfo :: Lens' ThreatHit (Maybe ClientInfo)
thClientInfo
= lens _thClientInfo (\ s a -> s{_thClientInfo = a})
thPlatformType :: Lens' ThreatHit (Maybe ThreatHitPlatformType)
thPlatformType
= lens _thPlatformType
(\ s a -> s{_thPlatformType = a})
instance FromJSON ThreatHit where
parseJSON
= withObject "ThreatHit"
(\ o ->
ThreatHit' <$>
(o .:? "userInfo") <*> (o .:? "threatType") <*>
(o .:? "resources" .!= mempty)
<*> (o .:? "entry")
<*> (o .:? "clientInfo")
<*> (o .:? "platformType"))
instance ToJSON ThreatHit where
toJSON ThreatHit'{..}
= object
(catMaybes
[("userInfo" .=) <$> _thUserInfo,
("threatType" .=) <$> _thThreatType,
("resources" .=) <$> _thResources,
("entry" .=) <$> _thEntry,
("clientInfo" .=) <$> _thClientInfo,
("platformType" .=) <$> _thPlatformType])
data FetchThreatListUpdatesRequest = FetchThreatListUpdatesRequest'
{ _ftlurListUpdateRequests :: !(Maybe [ListUpdateRequest])
, _ftlurClient :: !(Maybe ClientInfo)
} deriving (Eq,Show,Data,Typeable,Generic)
fetchThreatListUpdatesRequest
:: FetchThreatListUpdatesRequest
fetchThreatListUpdatesRequest =
FetchThreatListUpdatesRequest'
{ _ftlurListUpdateRequests = Nothing
, _ftlurClient = Nothing
}
ftlurListUpdateRequests :: Lens' FetchThreatListUpdatesRequest [ListUpdateRequest]
ftlurListUpdateRequests
= lens _ftlurListUpdateRequests
(\ s a -> s{_ftlurListUpdateRequests = a})
. _Default
. _Coerce
ftlurClient :: Lens' FetchThreatListUpdatesRequest (Maybe ClientInfo)
ftlurClient
= lens _ftlurClient (\ s a -> s{_ftlurClient = a})
instance FromJSON FetchThreatListUpdatesRequest where
parseJSON
= withObject "FetchThreatListUpdatesRequest"
(\ o ->
FetchThreatListUpdatesRequest' <$>
(o .:? "listUpdateRequests" .!= mempty) <*>
(o .:? "client"))
instance ToJSON FetchThreatListUpdatesRequest where
toJSON FetchThreatListUpdatesRequest'{..}
= object
(catMaybes
[("listUpdateRequests" .=) <$>
_ftlurListUpdateRequests,
("client" .=) <$> _ftlurClient])
data FindFullHashesRequest = FindFullHashesRequest'
{ _ffhrThreatInfo :: !(Maybe ThreatInfo)
, _ffhrAPIClient :: !(Maybe ClientInfo)
, _ffhrClientStates :: !(Maybe [Bytes])
, _ffhrClient :: !(Maybe ClientInfo)
} deriving (Eq,Show,Data,Typeable,Generic)
findFullHashesRequest
:: FindFullHashesRequest
findFullHashesRequest =
FindFullHashesRequest'
{ _ffhrThreatInfo = Nothing
, _ffhrAPIClient = Nothing
, _ffhrClientStates = Nothing
, _ffhrClient = Nothing
}
ffhrThreatInfo :: Lens' FindFullHashesRequest (Maybe ThreatInfo)
ffhrThreatInfo
= lens _ffhrThreatInfo
(\ s a -> s{_ffhrThreatInfo = a})
ffhrAPIClient :: Lens' FindFullHashesRequest (Maybe ClientInfo)
ffhrAPIClient
= lens _ffhrAPIClient
(\ s a -> s{_ffhrAPIClient = a})
ffhrClientStates :: Lens' FindFullHashesRequest [ByteString]
ffhrClientStates
= lens _ffhrClientStates
(\ s a -> s{_ffhrClientStates = a})
. _Default
. _Coerce
ffhrClient :: Lens' FindFullHashesRequest (Maybe ClientInfo)
ffhrClient
= lens _ffhrClient (\ s a -> s{_ffhrClient = a})
instance FromJSON FindFullHashesRequest where
parseJSON
= withObject "FindFullHashesRequest"
(\ o ->
FindFullHashesRequest' <$>
(o .:? "threatInfo") <*> (o .:? "apiClient") <*>
(o .:? "clientStates" .!= mempty)
<*> (o .:? "client"))
instance ToJSON FindFullHashesRequest where
toJSON FindFullHashesRequest'{..}
= object
(catMaybes
[("threatInfo" .=) <$> _ffhrThreatInfo,
("apiClient" .=) <$> _ffhrAPIClient,
("clientStates" .=) <$> _ffhrClientStates,
("client" .=) <$> _ffhrClient])
data Constraints = Constraints'
{ _cMaxUpdateEntries :: !(Maybe (Textual Int32))
, _cDeviceLocation :: !(Maybe Text)
, _cLanguage :: !(Maybe Text)
, _cRegion :: !(Maybe Text)
, _cSupportedCompressions :: !(Maybe [Text])
, _cMaxDatabaseEntries :: !(Maybe (Textual Int32))
} deriving (Eq,Show,Data,Typeable,Generic)
constraints
:: Constraints
constraints =
Constraints'
{ _cMaxUpdateEntries = Nothing
, _cDeviceLocation = Nothing
, _cLanguage = Nothing
, _cRegion = Nothing
, _cSupportedCompressions = Nothing
, _cMaxDatabaseEntries = Nothing
}
cMaxUpdateEntries :: Lens' Constraints (Maybe Int32)
cMaxUpdateEntries
= lens _cMaxUpdateEntries
(\ s a -> s{_cMaxUpdateEntries = a})
. mapping _Coerce
cDeviceLocation :: Lens' Constraints (Maybe Text)
cDeviceLocation
= lens _cDeviceLocation
(\ s a -> s{_cDeviceLocation = a})
cLanguage :: Lens' Constraints (Maybe Text)
cLanguage
= lens _cLanguage (\ s a -> s{_cLanguage = a})
cRegion :: Lens' Constraints (Maybe Text)
cRegion = lens _cRegion (\ s a -> s{_cRegion = a})
cSupportedCompressions :: Lens' Constraints [Text]
cSupportedCompressions
= lens _cSupportedCompressions
(\ s a -> s{_cSupportedCompressions = a})
. _Default
. _Coerce
cMaxDatabaseEntries :: Lens' Constraints (Maybe Int32)
cMaxDatabaseEntries
= lens _cMaxDatabaseEntries
(\ s a -> s{_cMaxDatabaseEntries = a})
. mapping _Coerce
instance FromJSON Constraints where
parseJSON
= withObject "Constraints"
(\ o ->
Constraints' <$>
(o .:? "maxUpdateEntries") <*>
(o .:? "deviceLocation")
<*> (o .:? "language")
<*> (o .:? "region")
<*> (o .:? "supportedCompressions" .!= mempty)
<*> (o .:? "maxDatabaseEntries"))
instance ToJSON Constraints where
toJSON Constraints'{..}
= object
(catMaybes
[("maxUpdateEntries" .=) <$> _cMaxUpdateEntries,
("deviceLocation" .=) <$> _cDeviceLocation,
("language" .=) <$> _cLanguage,
("region" .=) <$> _cRegion,
("supportedCompressions" .=) <$>
_cSupportedCompressions,
("maxDatabaseEntries" .=) <$> _cMaxDatabaseEntries])
data RiceDeltaEncoding = RiceDeltaEncoding'
{ _rdeFirstValue :: !(Maybe (Textual Int64))
, _rdeRiceParameter :: !(Maybe (Textual Int32))
, _rdeNumEntries :: !(Maybe (Textual Int32))
, _rdeEncodedData :: !(Maybe Bytes)
} deriving (Eq,Show,Data,Typeable,Generic)
riceDeltaEncoding
:: RiceDeltaEncoding
riceDeltaEncoding =
RiceDeltaEncoding'
{ _rdeFirstValue = Nothing
, _rdeRiceParameter = Nothing
, _rdeNumEntries = Nothing
, _rdeEncodedData = Nothing
}
rdeFirstValue :: Lens' RiceDeltaEncoding (Maybe Int64)
rdeFirstValue
= lens _rdeFirstValue
(\ s a -> s{_rdeFirstValue = a})
. mapping _Coerce
rdeRiceParameter :: Lens' RiceDeltaEncoding (Maybe Int32)
rdeRiceParameter
= lens _rdeRiceParameter
(\ s a -> s{_rdeRiceParameter = a})
. mapping _Coerce
rdeNumEntries :: Lens' RiceDeltaEncoding (Maybe Int32)
rdeNumEntries
= lens _rdeNumEntries
(\ s a -> s{_rdeNumEntries = a})
. mapping _Coerce
rdeEncodedData :: Lens' RiceDeltaEncoding (Maybe ByteString)
rdeEncodedData
= lens _rdeEncodedData
(\ s a -> s{_rdeEncodedData = a})
. mapping _Bytes
instance FromJSON RiceDeltaEncoding where
parseJSON
= withObject "RiceDeltaEncoding"
(\ o ->
RiceDeltaEncoding' <$>
(o .:? "firstValue") <*> (o .:? "riceParameter") <*>
(o .:? "numEntries")
<*> (o .:? "encodedData"))
instance ToJSON RiceDeltaEncoding where
toJSON RiceDeltaEncoding'{..}
= object
(catMaybes
[("firstValue" .=) <$> _rdeFirstValue,
("riceParameter" .=) <$> _rdeRiceParameter,
("numEntries" .=) <$> _rdeNumEntries,
("encodedData" .=) <$> _rdeEncodedData])
newtype ListThreatListsResponse = ListThreatListsResponse'
{ _ltlrThreatLists :: Maybe [ThreatListDescriptor]
} deriving (Eq,Show,Data,Typeable,Generic)
listThreatListsResponse
:: ListThreatListsResponse
listThreatListsResponse =
ListThreatListsResponse'
{ _ltlrThreatLists = Nothing
}
ltlrThreatLists :: Lens' ListThreatListsResponse [ThreatListDescriptor]
ltlrThreatLists
= lens _ltlrThreatLists
(\ s a -> s{_ltlrThreatLists = a})
. _Default
. _Coerce
instance FromJSON ListThreatListsResponse where
parseJSON
= withObject "ListThreatListsResponse"
(\ o ->
ListThreatListsResponse' <$>
(o .:? "threatLists" .!= mempty))
instance ToJSON ListThreatListsResponse where
toJSON ListThreatListsResponse'{..}
= object
(catMaybes [("threatLists" .=) <$> _ltlrThreatLists])
data ThreatListDescriptor = ThreatListDescriptor'
{ _tldThreatEntryType :: !(Maybe ThreatListDescriptorThreatEntryType)
, _tldThreatType :: !(Maybe ThreatListDescriptorThreatType)
, _tldPlatformType :: !(Maybe ThreatListDescriptorPlatformType)
} deriving (Eq,Show,Data,Typeable,Generic)
threatListDescriptor
:: ThreatListDescriptor
threatListDescriptor =
ThreatListDescriptor'
{ _tldThreatEntryType = Nothing
, _tldThreatType = Nothing
, _tldPlatformType = Nothing
}
tldThreatEntryType :: Lens' ThreatListDescriptor (Maybe ThreatListDescriptorThreatEntryType)
tldThreatEntryType
= lens _tldThreatEntryType
(\ s a -> s{_tldThreatEntryType = a})
tldThreatType :: Lens' ThreatListDescriptor (Maybe ThreatListDescriptorThreatType)
tldThreatType
= lens _tldThreatType
(\ s a -> s{_tldThreatType = a})
tldPlatformType :: Lens' ThreatListDescriptor (Maybe ThreatListDescriptorPlatformType)
tldPlatformType
= lens _tldPlatformType
(\ s a -> s{_tldPlatformType = a})
instance FromJSON ThreatListDescriptor where
parseJSON
= withObject "ThreatListDescriptor"
(\ o ->
ThreatListDescriptor' <$>
(o .:? "threatEntryType") <*> (o .:? "threatType")
<*> (o .:? "platformType"))
instance ToJSON ThreatListDescriptor where
toJSON ThreatListDescriptor'{..}
= object
(catMaybes
[("threatEntryType" .=) <$> _tldThreatEntryType,
("threatType" .=) <$> _tldThreatType,
("platformType" .=) <$> _tldPlatformType])
data ClientInfo = ClientInfo'
{ _ciClientId :: !(Maybe Text)
, _ciClientVersion :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
clientInfo
:: ClientInfo
clientInfo =
ClientInfo'
{ _ciClientId = Nothing
, _ciClientVersion = Nothing
}
ciClientId :: Lens' ClientInfo (Maybe Text)
ciClientId
= lens _ciClientId (\ s a -> s{_ciClientId = a})
ciClientVersion :: Lens' ClientInfo (Maybe Text)
ciClientVersion
= lens _ciClientVersion
(\ s a -> s{_ciClientVersion = a})
instance FromJSON ClientInfo where
parseJSON
= withObject "ClientInfo"
(\ o ->
ClientInfo' <$>
(o .:? "clientId") <*> (o .:? "clientVersion"))
instance ToJSON ClientInfo where
toJSON ClientInfo'{..}
= object
(catMaybes
[("clientId" .=) <$> _ciClientId,
("clientVersion" .=) <$> _ciClientVersion])
data FindThreatMatchesRequest = FindThreatMatchesRequest'
{ _ftmrThreatInfo :: !(Maybe ThreatInfo)
, _ftmrClient :: !(Maybe ClientInfo)
} deriving (Eq,Show,Data,Typeable,Generic)
findThreatMatchesRequest
:: FindThreatMatchesRequest
findThreatMatchesRequest =
FindThreatMatchesRequest'
{ _ftmrThreatInfo = Nothing
, _ftmrClient = Nothing
}
ftmrThreatInfo :: Lens' FindThreatMatchesRequest (Maybe ThreatInfo)
ftmrThreatInfo
= lens _ftmrThreatInfo
(\ s a -> s{_ftmrThreatInfo = a})
ftmrClient :: Lens' FindThreatMatchesRequest (Maybe ClientInfo)
ftmrClient
= lens _ftmrClient (\ s a -> s{_ftmrClient = a})
instance FromJSON FindThreatMatchesRequest where
parseJSON
= withObject "FindThreatMatchesRequest"
(\ o ->
FindThreatMatchesRequest' <$>
(o .:? "threatInfo") <*> (o .:? "client"))
instance ToJSON FindThreatMatchesRequest where
toJSON FindThreatMatchesRequest'{..}
= object
(catMaybes
[("threatInfo" .=) <$> _ftmrThreatInfo,
("client" .=) <$> _ftmrClient])
data ListUpdateRequest = ListUpdateRequest'
{ _lurState :: !(Maybe Bytes)
, _lurThreatEntryType :: !(Maybe ListUpdateRequestThreatEntryType)
, _lurConstraints :: !(Maybe Constraints)
, _lurThreatType :: !(Maybe ListUpdateRequestThreatType)
, _lurPlatformType :: !(Maybe ListUpdateRequestPlatformType)
} deriving (Eq,Show,Data,Typeable,Generic)
listUpdateRequest
:: ListUpdateRequest
listUpdateRequest =
ListUpdateRequest'
{ _lurState = Nothing
, _lurThreatEntryType = Nothing
, _lurConstraints = Nothing
, _lurThreatType = Nothing
, _lurPlatformType = Nothing
}
lurState :: Lens' ListUpdateRequest (Maybe ByteString)
lurState
= lens _lurState (\ s a -> s{_lurState = a}) .
mapping _Bytes
lurThreatEntryType :: Lens' ListUpdateRequest (Maybe ListUpdateRequestThreatEntryType)
lurThreatEntryType
= lens _lurThreatEntryType
(\ s a -> s{_lurThreatEntryType = a})
lurConstraints :: Lens' ListUpdateRequest (Maybe Constraints)
lurConstraints
= lens _lurConstraints
(\ s a -> s{_lurConstraints = a})
lurThreatType :: Lens' ListUpdateRequest (Maybe ListUpdateRequestThreatType)
lurThreatType
= lens _lurThreatType
(\ s a -> s{_lurThreatType = a})
lurPlatformType :: Lens' ListUpdateRequest (Maybe ListUpdateRequestPlatformType)
lurPlatformType
= lens _lurPlatformType
(\ s a -> s{_lurPlatformType = a})
instance FromJSON ListUpdateRequest where
parseJSON
= withObject "ListUpdateRequest"
(\ o ->
ListUpdateRequest' <$>
(o .:? "state") <*> (o .:? "threatEntryType") <*>
(o .:? "constraints")
<*> (o .:? "threatType")
<*> (o .:? "platformType"))
instance ToJSON ListUpdateRequest where
toJSON ListUpdateRequest'{..}
= object
(catMaybes
[("state" .=) <$> _lurState,
("threatEntryType" .=) <$> _lurThreatEntryType,
("constraints" .=) <$> _lurConstraints,
("threatType" .=) <$> _lurThreatType,
("platformType" .=) <$> _lurPlatformType])
data ThreatEntry = ThreatEntry'
{ _teHash :: !(Maybe Bytes)
, _teURL :: !(Maybe Text)
, _teDigest :: !(Maybe Bytes)
} deriving (Eq,Show,Data,Typeable,Generic)
threatEntry
:: ThreatEntry
threatEntry =
ThreatEntry'
{ _teHash = Nothing
, _teURL = Nothing
, _teDigest = Nothing
}
teHash :: Lens' ThreatEntry (Maybe ByteString)
teHash
= lens _teHash (\ s a -> s{_teHash = a}) .
mapping _Bytes
teURL :: Lens' ThreatEntry (Maybe Text)
teURL = lens _teURL (\ s a -> s{_teURL = a})
teDigest :: Lens' ThreatEntry (Maybe ByteString)
teDigest
= lens _teDigest (\ s a -> s{_teDigest = a}) .
mapping _Bytes
instance FromJSON ThreatEntry where
parseJSON
= withObject "ThreatEntry"
(\ o ->
ThreatEntry' <$>
(o .:? "hash") <*> (o .:? "url") <*>
(o .:? "digest"))
instance ToJSON ThreatEntry where
toJSON ThreatEntry'{..}
= object
(catMaybes
[("hash" .=) <$> _teHash, ("url" .=) <$> _teURL,
("digest" .=) <$> _teDigest])
data ThreatMatch = ThreatMatch'
{ _tmThreatEntryMetadata :: !(Maybe ThreatEntryMetadata)
, _tmThreatEntryType :: !(Maybe ThreatMatchThreatEntryType)
, _tmThreatType :: !(Maybe ThreatMatchThreatType)
, _tmPlatformType :: !(Maybe ThreatMatchPlatformType)
, _tmCacheDuration :: !(Maybe GDuration)
, _tmThreat :: !(Maybe ThreatEntry)
} deriving (Eq,Show,Data,Typeable,Generic)
threatMatch
:: ThreatMatch
threatMatch =
ThreatMatch'
{ _tmThreatEntryMetadata = Nothing
, _tmThreatEntryType = Nothing
, _tmThreatType = Nothing
, _tmPlatformType = Nothing
, _tmCacheDuration = Nothing
, _tmThreat = Nothing
}
tmThreatEntryMetadata :: Lens' ThreatMatch (Maybe ThreatEntryMetadata)
tmThreatEntryMetadata
= lens _tmThreatEntryMetadata
(\ s a -> s{_tmThreatEntryMetadata = a})
tmThreatEntryType :: Lens' ThreatMatch (Maybe ThreatMatchThreatEntryType)
tmThreatEntryType
= lens _tmThreatEntryType
(\ s a -> s{_tmThreatEntryType = a})
tmThreatType :: Lens' ThreatMatch (Maybe ThreatMatchThreatType)
tmThreatType
= lens _tmThreatType (\ s a -> s{_tmThreatType = a})
tmPlatformType :: Lens' ThreatMatch (Maybe ThreatMatchPlatformType)
tmPlatformType
= lens _tmPlatformType
(\ s a -> s{_tmPlatformType = a})
tmCacheDuration :: Lens' ThreatMatch (Maybe Scientific)
tmCacheDuration
= lens _tmCacheDuration
(\ s a -> s{_tmCacheDuration = a})
. mapping _GDuration
tmThreat :: Lens' ThreatMatch (Maybe ThreatEntry)
tmThreat = lens _tmThreat (\ s a -> s{_tmThreat = a})
instance FromJSON ThreatMatch where
parseJSON
= withObject "ThreatMatch"
(\ o ->
ThreatMatch' <$>
(o .:? "threatEntryMetadata") <*>
(o .:? "threatEntryType")
<*> (o .:? "threatType")
<*> (o .:? "platformType")
<*> (o .:? "cacheDuration")
<*> (o .:? "threat"))
instance ToJSON ThreatMatch where
toJSON ThreatMatch'{..}
= object
(catMaybes
[("threatEntryMetadata" .=) <$>
_tmThreatEntryMetadata,
("threatEntryType" .=) <$> _tmThreatEntryType,
("threatType" .=) <$> _tmThreatType,
("platformType" .=) <$> _tmPlatformType,
("cacheDuration" .=) <$> _tmCacheDuration,
("threat" .=) <$> _tmThreat])
data RawHashes = RawHashes'
{ _rhPrefixSize :: !(Maybe (Textual Int32))
, _rhRawHashes :: !(Maybe Bytes)
} deriving (Eq,Show,Data,Typeable,Generic)
rawHashes
:: RawHashes
rawHashes =
RawHashes'
{ _rhPrefixSize = Nothing
, _rhRawHashes = Nothing
}
rhPrefixSize :: Lens' RawHashes (Maybe Int32)
rhPrefixSize
= lens _rhPrefixSize (\ s a -> s{_rhPrefixSize = a})
. mapping _Coerce
rhRawHashes :: Lens' RawHashes (Maybe ByteString)
rhRawHashes
= lens _rhRawHashes (\ s a -> s{_rhRawHashes = a}) .
mapping _Bytes
instance FromJSON RawHashes where
parseJSON
= withObject "RawHashes"
(\ o ->
RawHashes' <$>
(o .:? "prefixSize") <*> (o .:? "rawHashes"))
instance ToJSON RawHashes where
toJSON RawHashes'{..}
= object
(catMaybes
[("prefixSize" .=) <$> _rhPrefixSize,
("rawHashes" .=) <$> _rhRawHashes])
data ListUpdateResponse = ListUpdateResponse'
{ _lAdditions :: !(Maybe [ThreatEntrySet])
, _lThreatEntryType :: !(Maybe ListUpdateResponseThreatEntryType)
, _lChecksum :: !(Maybe Checksum)
, _lThreatType :: !(Maybe ListUpdateResponseThreatType)
, _lPlatformType :: !(Maybe ListUpdateResponsePlatformType)
, _lNewClientState :: !(Maybe Bytes)
, _lRemovals :: !(Maybe [ThreatEntrySet])
, _lResponseType :: !(Maybe ListUpdateResponseResponseType)
} deriving (Eq,Show,Data,Typeable,Generic)
listUpdateResponse
:: ListUpdateResponse
listUpdateResponse =
ListUpdateResponse'
{ _lAdditions = Nothing
, _lThreatEntryType = Nothing
, _lChecksum = Nothing
, _lThreatType = Nothing
, _lPlatformType = Nothing
, _lNewClientState = Nothing
, _lRemovals = Nothing
, _lResponseType = Nothing
}
lAdditions :: Lens' ListUpdateResponse [ThreatEntrySet]
lAdditions
= lens _lAdditions (\ s a -> s{_lAdditions = a}) .
_Default
. _Coerce
lThreatEntryType :: Lens' ListUpdateResponse (Maybe ListUpdateResponseThreatEntryType)
lThreatEntryType
= lens _lThreatEntryType
(\ s a -> s{_lThreatEntryType = a})
lChecksum :: Lens' ListUpdateResponse (Maybe Checksum)
lChecksum
= lens _lChecksum (\ s a -> s{_lChecksum = a})
lThreatType :: Lens' ListUpdateResponse (Maybe ListUpdateResponseThreatType)
lThreatType
= lens _lThreatType (\ s a -> s{_lThreatType = a})
lPlatformType :: Lens' ListUpdateResponse (Maybe ListUpdateResponsePlatformType)
lPlatformType
= lens _lPlatformType
(\ s a -> s{_lPlatformType = a})
lNewClientState :: Lens' ListUpdateResponse (Maybe ByteString)
lNewClientState
= lens _lNewClientState
(\ s a -> s{_lNewClientState = a})
. mapping _Bytes
lRemovals :: Lens' ListUpdateResponse [ThreatEntrySet]
lRemovals
= lens _lRemovals (\ s a -> s{_lRemovals = a}) .
_Default
. _Coerce
lResponseType :: Lens' ListUpdateResponse (Maybe ListUpdateResponseResponseType)
lResponseType
= lens _lResponseType
(\ s a -> s{_lResponseType = a})
instance FromJSON ListUpdateResponse where
parseJSON
= withObject "ListUpdateResponse"
(\ o ->
ListUpdateResponse' <$>
(o .:? "additions" .!= mempty) <*>
(o .:? "threatEntryType")
<*> (o .:? "checksum")
<*> (o .:? "threatType")
<*> (o .:? "platformType")
<*> (o .:? "newClientState")
<*> (o .:? "removals" .!= mempty)
<*> (o .:? "responseType"))
instance ToJSON ListUpdateResponse where
toJSON ListUpdateResponse'{..}
= object
(catMaybes
[("additions" .=) <$> _lAdditions,
("threatEntryType" .=) <$> _lThreatEntryType,
("checksum" .=) <$> _lChecksum,
("threatType" .=) <$> _lThreatType,
("platformType" .=) <$> _lPlatformType,
("newClientState" .=) <$> _lNewClientState,
("removals" .=) <$> _lRemovals,
("responseType" .=) <$> _lResponseType])
data ThreatEntrySet = ThreatEntrySet'
{ _tesRiceHashes :: !(Maybe RiceDeltaEncoding)
, _tesRiceIndices :: !(Maybe RiceDeltaEncoding)
, _tesRawHashes :: !(Maybe RawHashes)
, _tesRawIndices :: !(Maybe RawIndices)
, _tesCompressionType :: !(Maybe ThreatEntrySetCompressionType)
} deriving (Eq,Show,Data,Typeable,Generic)
threatEntrySet
:: ThreatEntrySet
threatEntrySet =
ThreatEntrySet'
{ _tesRiceHashes = Nothing
, _tesRiceIndices = Nothing
, _tesRawHashes = Nothing
, _tesRawIndices = Nothing
, _tesCompressionType = Nothing
}
tesRiceHashes :: Lens' ThreatEntrySet (Maybe RiceDeltaEncoding)
tesRiceHashes
= lens _tesRiceHashes
(\ s a -> s{_tesRiceHashes = a})
tesRiceIndices :: Lens' ThreatEntrySet (Maybe RiceDeltaEncoding)
tesRiceIndices
= lens _tesRiceIndices
(\ s a -> s{_tesRiceIndices = a})
tesRawHashes :: Lens' ThreatEntrySet (Maybe RawHashes)
tesRawHashes
= lens _tesRawHashes (\ s a -> s{_tesRawHashes = a})
tesRawIndices :: Lens' ThreatEntrySet (Maybe RawIndices)
tesRawIndices
= lens _tesRawIndices
(\ s a -> s{_tesRawIndices = a})
tesCompressionType :: Lens' ThreatEntrySet (Maybe ThreatEntrySetCompressionType)
tesCompressionType
= lens _tesCompressionType
(\ s a -> s{_tesCompressionType = a})
instance FromJSON ThreatEntrySet where
parseJSON
= withObject "ThreatEntrySet"
(\ o ->
ThreatEntrySet' <$>
(o .:? "riceHashes") <*> (o .:? "riceIndices") <*>
(o .:? "rawHashes")
<*> (o .:? "rawIndices")
<*> (o .:? "compressionType"))
instance ToJSON ThreatEntrySet where
toJSON ThreatEntrySet'{..}
= object
(catMaybes
[("riceHashes" .=) <$> _tesRiceHashes,
("riceIndices" .=) <$> _tesRiceIndices,
("rawHashes" .=) <$> _tesRawHashes,
("rawIndices" .=) <$> _tesRawIndices,
("compressionType" .=) <$> _tesCompressionType])
newtype RawIndices = RawIndices'
{ _riIndices :: Maybe [Textual Int32]
} deriving (Eq,Show,Data,Typeable,Generic)
rawIndices
:: RawIndices
rawIndices =
RawIndices'
{ _riIndices = Nothing
}
riIndices :: Lens' RawIndices [Int32]
riIndices
= lens _riIndices (\ s a -> s{_riIndices = a}) .
_Default
. _Coerce
instance FromJSON RawIndices where
parseJSON
= withObject "RawIndices"
(\ o -> RawIndices' <$> (o .:? "indices" .!= mempty))
instance ToJSON RawIndices where
toJSON RawIndices'{..}
= object (catMaybes [("indices" .=) <$> _riIndices])
data ThreatSource = ThreatSource'
{ _tsRemoteIP :: !(Maybe Text)
, _tsURL :: !(Maybe Text)
, _tsReferrer :: !(Maybe Text)
, _tsType :: !(Maybe ThreatSourceType)
} deriving (Eq,Show,Data,Typeable,Generic)
threatSource
:: ThreatSource
threatSource =
ThreatSource'
{ _tsRemoteIP = Nothing
, _tsURL = Nothing
, _tsReferrer = Nothing
, _tsType = Nothing
}
tsRemoteIP :: Lens' ThreatSource (Maybe Text)
tsRemoteIP
= lens _tsRemoteIP (\ s a -> s{_tsRemoteIP = a})
tsURL :: Lens' ThreatSource (Maybe Text)
tsURL = lens _tsURL (\ s a -> s{_tsURL = a})
tsReferrer :: Lens' ThreatSource (Maybe Text)
tsReferrer
= lens _tsReferrer (\ s a -> s{_tsReferrer = a})
tsType :: Lens' ThreatSource (Maybe ThreatSourceType)
tsType = lens _tsType (\ s a -> s{_tsType = a})
instance FromJSON ThreatSource where
parseJSON
= withObject "ThreatSource"
(\ o ->
ThreatSource' <$>
(o .:? "remoteIp") <*> (o .:? "url") <*>
(o .:? "referrer")
<*> (o .:? "type"))
instance ToJSON ThreatSource where
toJSON ThreatSource'{..}
= object
(catMaybes
[("remoteIp" .=) <$> _tsRemoteIP,
("url" .=) <$> _tsURL,
("referrer" .=) <$> _tsReferrer,
("type" .=) <$> _tsType])
data FindFullHashesResponse = FindFullHashesResponse'
{ _ffhrMatches :: !(Maybe [ThreatMatch])
, _ffhrNegativeCacheDuration :: !(Maybe GDuration)
, _ffhrMinimumWaitDuration :: !(Maybe GDuration)
} deriving (Eq,Show,Data,Typeable,Generic)
findFullHashesResponse
:: FindFullHashesResponse
findFullHashesResponse =
FindFullHashesResponse'
{ _ffhrMatches = Nothing
, _ffhrNegativeCacheDuration = Nothing
, _ffhrMinimumWaitDuration = Nothing
}
ffhrMatches :: Lens' FindFullHashesResponse [ThreatMatch]
ffhrMatches
= lens _ffhrMatches (\ s a -> s{_ffhrMatches = a}) .
_Default
. _Coerce
ffhrNegativeCacheDuration :: Lens' FindFullHashesResponse (Maybe Scientific)
ffhrNegativeCacheDuration
= lens _ffhrNegativeCacheDuration
(\ s a -> s{_ffhrNegativeCacheDuration = a})
. mapping _GDuration
ffhrMinimumWaitDuration :: Lens' FindFullHashesResponse (Maybe Scientific)
ffhrMinimumWaitDuration
= lens _ffhrMinimumWaitDuration
(\ s a -> s{_ffhrMinimumWaitDuration = a})
. mapping _GDuration
instance FromJSON FindFullHashesResponse where
parseJSON
= withObject "FindFullHashesResponse"
(\ o ->
FindFullHashesResponse' <$>
(o .:? "matches" .!= mempty) <*>
(o .:? "negativeCacheDuration")
<*> (o .:? "minimumWaitDuration"))
instance ToJSON FindFullHashesResponse where
toJSON FindFullHashesResponse'{..}
= object
(catMaybes
[("matches" .=) <$> _ffhrMatches,
("negativeCacheDuration" .=) <$>
_ffhrNegativeCacheDuration,
("minimumWaitDuration" .=) <$>
_ffhrMinimumWaitDuration])
data MetadataEntry = MetadataEntry'
{ _meValue :: !(Maybe Bytes)
, _meKey :: !(Maybe Bytes)
} deriving (Eq,Show,Data,Typeable,Generic)
metadataEntry
:: MetadataEntry
metadataEntry =
MetadataEntry'
{ _meValue = Nothing
, _meKey = Nothing
}
meValue :: Lens' MetadataEntry (Maybe ByteString)
meValue
= lens _meValue (\ s a -> s{_meValue = a}) .
mapping _Bytes
meKey :: Lens' MetadataEntry (Maybe ByteString)
meKey
= lens _meKey (\ s a -> s{_meKey = a}) .
mapping _Bytes
instance FromJSON MetadataEntry where
parseJSON
= withObject "MetadataEntry"
(\ o ->
MetadataEntry' <$> (o .:? "value") <*> (o .:? "key"))
instance ToJSON MetadataEntry where
toJSON MetadataEntry'{..}
= object
(catMaybes
[("value" .=) <$> _meValue, ("key" .=) <$> _meKey])
data FetchThreatListUpdatesResponse = FetchThreatListUpdatesResponse'
{ _ftlurListUpdateResponses :: !(Maybe [ListUpdateResponse])
, _ftlurMinimumWaitDuration :: !(Maybe GDuration)
} deriving (Eq,Show,Data,Typeable,Generic)
fetchThreatListUpdatesResponse
:: FetchThreatListUpdatesResponse
fetchThreatListUpdatesResponse =
FetchThreatListUpdatesResponse'
{ _ftlurListUpdateResponses = Nothing
, _ftlurMinimumWaitDuration = Nothing
}
ftlurListUpdateResponses :: Lens' FetchThreatListUpdatesResponse [ListUpdateResponse]
ftlurListUpdateResponses
= lens _ftlurListUpdateResponses
(\ s a -> s{_ftlurListUpdateResponses = a})
. _Default
. _Coerce
ftlurMinimumWaitDuration :: Lens' FetchThreatListUpdatesResponse (Maybe Scientific)
ftlurMinimumWaitDuration
= lens _ftlurMinimumWaitDuration
(\ s a -> s{_ftlurMinimumWaitDuration = a})
. mapping _GDuration
instance FromJSON FetchThreatListUpdatesResponse
where
parseJSON
= withObject "FetchThreatListUpdatesResponse"
(\ o ->
FetchThreatListUpdatesResponse' <$>
(o .:? "listUpdateResponses" .!= mempty) <*>
(o .:? "minimumWaitDuration"))
instance ToJSON FetchThreatListUpdatesResponse where
toJSON FetchThreatListUpdatesResponse'{..}
= object
(catMaybes
[("listUpdateResponses" .=) <$>
_ftlurListUpdateResponses,
("minimumWaitDuration" .=) <$>
_ftlurMinimumWaitDuration])