{-# 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.WebSecurityScanner.Types.Product where
import Network.Google.Prelude
import Network.Google.WebSecurityScanner.Types.Sum
data FindingTypeStats =
FindingTypeStats'
{ _ftsFindingCount :: !(Maybe (Textual Int32))
, _ftsFindingType :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
findingTypeStats
:: FindingTypeStats
findingTypeStats =
FindingTypeStats' {_ftsFindingCount = Nothing, _ftsFindingType = Nothing}
ftsFindingCount :: Lens' FindingTypeStats (Maybe Int32)
ftsFindingCount
= lens _ftsFindingCount
(\ s a -> s{_ftsFindingCount = a})
. mapping _Coerce
ftsFindingType :: Lens' FindingTypeStats (Maybe Text)
ftsFindingType
= lens _ftsFindingType
(\ s a -> s{_ftsFindingType = a})
instance FromJSON FindingTypeStats where
parseJSON
= withObject "FindingTypeStats"
(\ o ->
FindingTypeStats' <$>
(o .:? "findingCount") <*> (o .:? "findingType"))
instance ToJSON FindingTypeStats where
toJSON FindingTypeStats'{..}
= object
(catMaybes
[("findingCount" .=) <$> _ftsFindingCount,
("findingType" .=) <$> _ftsFindingType])
data ListFindingsResponse =
ListFindingsResponse'
{ _lfrNextPageToken :: !(Maybe Text)
, _lfrFindings :: !(Maybe [Finding])
}
deriving (Eq, Show, Data, Typeable, Generic)
listFindingsResponse
:: ListFindingsResponse
listFindingsResponse =
ListFindingsResponse' {_lfrNextPageToken = Nothing, _lfrFindings = Nothing}
lfrNextPageToken :: Lens' ListFindingsResponse (Maybe Text)
lfrNextPageToken
= lens _lfrNextPageToken
(\ s a -> s{_lfrNextPageToken = a})
lfrFindings :: Lens' ListFindingsResponse [Finding]
lfrFindings
= lens _lfrFindings (\ s a -> s{_lfrFindings = a}) .
_Default
. _Coerce
instance FromJSON ListFindingsResponse where
parseJSON
= withObject "ListFindingsResponse"
(\ o ->
ListFindingsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "findings" .!= mempty))
instance ToJSON ListFindingsResponse where
toJSON ListFindingsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lfrNextPageToken,
("findings" .=) <$> _lfrFindings])
data StopScanRunRequest =
StopScanRunRequest'
deriving (Eq, Show, Data, Typeable, Generic)
stopScanRunRequest
:: StopScanRunRequest
stopScanRunRequest = StopScanRunRequest'
instance FromJSON StopScanRunRequest where
parseJSON
= withObject "StopScanRunRequest"
(\ o -> pure StopScanRunRequest')
instance ToJSON StopScanRunRequest where
toJSON = const emptyObject
data ScanConfigError =
ScanConfigError'
{ _sceFieldName :: !(Maybe Text)
, _sceCode :: !(Maybe ScanConfigErrorCode)
}
deriving (Eq, Show, Data, Typeable, Generic)
scanConfigError
:: ScanConfigError
scanConfigError = ScanConfigError' {_sceFieldName = Nothing, _sceCode = Nothing}
sceFieldName :: Lens' ScanConfigError (Maybe Text)
sceFieldName
= lens _sceFieldName (\ s a -> s{_sceFieldName = a})
sceCode :: Lens' ScanConfigError (Maybe ScanConfigErrorCode)
sceCode = lens _sceCode (\ s a -> s{_sceCode = a})
instance FromJSON ScanConfigError where
parseJSON
= withObject "ScanConfigError"
(\ o ->
ScanConfigError' <$>
(o .:? "fieldName") <*> (o .:? "code"))
instance ToJSON ScanConfigError where
toJSON ScanConfigError'{..}
= object
(catMaybes
[("fieldName" .=) <$> _sceFieldName,
("code" .=) <$> _sceCode])
data Schedule =
Schedule'
{ _sScheduleTime :: !(Maybe DateTime')
, _sIntervalDurationDays :: !(Maybe (Textual Int32))
}
deriving (Eq, Show, Data, Typeable, Generic)
schedule
:: Schedule
schedule =
Schedule' {_sScheduleTime = Nothing, _sIntervalDurationDays = Nothing}
sScheduleTime :: Lens' Schedule (Maybe UTCTime)
sScheduleTime
= lens _sScheduleTime
(\ s a -> s{_sScheduleTime = a})
. mapping _DateTime
sIntervalDurationDays :: Lens' Schedule (Maybe Int32)
sIntervalDurationDays
= lens _sIntervalDurationDays
(\ s a -> s{_sIntervalDurationDays = a})
. mapping _Coerce
instance FromJSON Schedule where
parseJSON
= withObject "Schedule"
(\ o ->
Schedule' <$>
(o .:? "scheduleTime") <*>
(o .:? "intervalDurationDays"))
instance ToJSON Schedule where
toJSON Schedule'{..}
= object
(catMaybes
[("scheduleTime" .=) <$> _sScheduleTime,
("intervalDurationDays" .=) <$>
_sIntervalDurationDays])
data Finding =
Finding'
{ _fFinalURL :: !(Maybe Text)
, _fHTTPMethod :: !(Maybe Text)
, _fReProductionURL :: !(Maybe Text)
, _fTrackingId :: !(Maybe Text)
, _fBody :: !(Maybe Text)
, _fXss :: !(Maybe Xss)
, _fVulnerableParameters :: !(Maybe VulnerableParameters)
, _fOutdatedLibrary :: !(Maybe OutdatedLibrary)
, _fFuzzedURL :: !(Maybe Text)
, _fName :: !(Maybe Text)
, _fFindingType :: !(Maybe Text)
, _fVulnerableHeaders :: !(Maybe VulnerableHeaders)
, _fViolatingResource :: !(Maybe ViolatingResource)
, _fForm :: !(Maybe Form)
, _fFrameURL :: !(Maybe Text)
, _fDescription :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
finding
:: Finding
finding =
Finding'
{ _fFinalURL = Nothing
, _fHTTPMethod = Nothing
, _fReProductionURL = Nothing
, _fTrackingId = Nothing
, _fBody = Nothing
, _fXss = Nothing
, _fVulnerableParameters = Nothing
, _fOutdatedLibrary = Nothing
, _fFuzzedURL = Nothing
, _fName = Nothing
, _fFindingType = Nothing
, _fVulnerableHeaders = Nothing
, _fViolatingResource = Nothing
, _fForm = Nothing
, _fFrameURL = Nothing
, _fDescription = Nothing
}
fFinalURL :: Lens' Finding (Maybe Text)
fFinalURL
= lens _fFinalURL (\ s a -> s{_fFinalURL = a})
fHTTPMethod :: Lens' Finding (Maybe Text)
fHTTPMethod
= lens _fHTTPMethod (\ s a -> s{_fHTTPMethod = a})
fReProductionURL :: Lens' Finding (Maybe Text)
fReProductionURL
= lens _fReProductionURL
(\ s a -> s{_fReProductionURL = a})
fTrackingId :: Lens' Finding (Maybe Text)
fTrackingId
= lens _fTrackingId (\ s a -> s{_fTrackingId = a})
fBody :: Lens' Finding (Maybe Text)
fBody = lens _fBody (\ s a -> s{_fBody = a})
fXss :: Lens' Finding (Maybe Xss)
fXss = lens _fXss (\ s a -> s{_fXss = a})
fVulnerableParameters :: Lens' Finding (Maybe VulnerableParameters)
fVulnerableParameters
= lens _fVulnerableParameters
(\ s a -> s{_fVulnerableParameters = a})
fOutdatedLibrary :: Lens' Finding (Maybe OutdatedLibrary)
fOutdatedLibrary
= lens _fOutdatedLibrary
(\ s a -> s{_fOutdatedLibrary = a})
fFuzzedURL :: Lens' Finding (Maybe Text)
fFuzzedURL
= lens _fFuzzedURL (\ s a -> s{_fFuzzedURL = a})
fName :: Lens' Finding (Maybe Text)
fName = lens _fName (\ s a -> s{_fName = a})
fFindingType :: Lens' Finding (Maybe Text)
fFindingType
= lens _fFindingType (\ s a -> s{_fFindingType = a})
fVulnerableHeaders :: Lens' Finding (Maybe VulnerableHeaders)
fVulnerableHeaders
= lens _fVulnerableHeaders
(\ s a -> s{_fVulnerableHeaders = a})
fViolatingResource :: Lens' Finding (Maybe ViolatingResource)
fViolatingResource
= lens _fViolatingResource
(\ s a -> s{_fViolatingResource = a})
fForm :: Lens' Finding (Maybe Form)
fForm = lens _fForm (\ s a -> s{_fForm = a})
fFrameURL :: Lens' Finding (Maybe Text)
fFrameURL
= lens _fFrameURL (\ s a -> s{_fFrameURL = a})
fDescription :: Lens' Finding (Maybe Text)
fDescription
= lens _fDescription (\ s a -> s{_fDescription = a})
instance FromJSON Finding where
parseJSON
= withObject "Finding"
(\ o ->
Finding' <$>
(o .:? "finalUrl") <*> (o .:? "httpMethod") <*>
(o .:? "reproductionUrl")
<*> (o .:? "trackingId")
<*> (o .:? "body")
<*> (o .:? "xss")
<*> (o .:? "vulnerableParameters")
<*> (o .:? "outdatedLibrary")
<*> (o .:? "fuzzedUrl")
<*> (o .:? "name")
<*> (o .:? "findingType")
<*> (o .:? "vulnerableHeaders")
<*> (o .:? "violatingResource")
<*> (o .:? "form")
<*> (o .:? "frameUrl")
<*> (o .:? "description"))
instance ToJSON Finding where
toJSON Finding'{..}
= object
(catMaybes
[("finalUrl" .=) <$> _fFinalURL,
("httpMethod" .=) <$> _fHTTPMethod,
("reproductionUrl" .=) <$> _fReProductionURL,
("trackingId" .=) <$> _fTrackingId,
("body" .=) <$> _fBody, ("xss" .=) <$> _fXss,
("vulnerableParameters" .=) <$>
_fVulnerableParameters,
("outdatedLibrary" .=) <$> _fOutdatedLibrary,
("fuzzedUrl" .=) <$> _fFuzzedURL,
("name" .=) <$> _fName,
("findingType" .=) <$> _fFindingType,
("vulnerableHeaders" .=) <$> _fVulnerableHeaders,
("violatingResource" .=) <$> _fViolatingResource,
("form" .=) <$> _fForm,
("frameUrl" .=) <$> _fFrameURL,
("description" .=) <$> _fDescription])
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
newtype ScanRunWarningTrace =
ScanRunWarningTrace'
{ _srwtCode :: Maybe ScanRunWarningTraceCode
}
deriving (Eq, Show, Data, Typeable, Generic)
scanRunWarningTrace
:: ScanRunWarningTrace
scanRunWarningTrace = ScanRunWarningTrace' {_srwtCode = Nothing}
srwtCode :: Lens' ScanRunWarningTrace (Maybe ScanRunWarningTraceCode)
srwtCode = lens _srwtCode (\ s a -> s{_srwtCode = a})
instance FromJSON ScanRunWarningTrace where
parseJSON
= withObject "ScanRunWarningTrace"
(\ o -> ScanRunWarningTrace' <$> (o .:? "code"))
instance ToJSON ScanRunWarningTrace where
toJSON ScanRunWarningTrace'{..}
= object (catMaybes [("code" .=) <$> _srwtCode])
newtype ListFindingTypeStatsResponse =
ListFindingTypeStatsResponse'
{ _lftsrFindingTypeStats :: Maybe [FindingTypeStats]
}
deriving (Eq, Show, Data, Typeable, Generic)
listFindingTypeStatsResponse
:: ListFindingTypeStatsResponse
listFindingTypeStatsResponse =
ListFindingTypeStatsResponse' {_lftsrFindingTypeStats = Nothing}
lftsrFindingTypeStats :: Lens' ListFindingTypeStatsResponse [FindingTypeStats]
lftsrFindingTypeStats
= lens _lftsrFindingTypeStats
(\ s a -> s{_lftsrFindingTypeStats = a})
. _Default
. _Coerce
instance FromJSON ListFindingTypeStatsResponse where
parseJSON
= withObject "ListFindingTypeStatsResponse"
(\ o ->
ListFindingTypeStatsResponse' <$>
(o .:? "findingTypeStats" .!= mempty))
instance ToJSON ListFindingTypeStatsResponse where
toJSON ListFindingTypeStatsResponse'{..}
= object
(catMaybes
[("findingTypeStats" .=) <$> _lftsrFindingTypeStats])
data GoogleAccount =
GoogleAccount'
{ _gaUsername :: !(Maybe Text)
, _gaPassword :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
googleAccount
:: GoogleAccount
googleAccount = GoogleAccount' {_gaUsername = Nothing, _gaPassword = Nothing}
gaUsername :: Lens' GoogleAccount (Maybe Text)
gaUsername
= lens _gaUsername (\ s a -> s{_gaUsername = a})
gaPassword :: Lens' GoogleAccount (Maybe Text)
gaPassword
= lens _gaPassword (\ s a -> s{_gaPassword = a})
instance FromJSON GoogleAccount where
parseJSON
= withObject "GoogleAccount"
(\ o ->
GoogleAccount' <$>
(o .:? "username") <*> (o .:? "password"))
instance ToJSON GoogleAccount where
toJSON GoogleAccount'{..}
= object
(catMaybes
[("username" .=) <$> _gaUsername,
("password" .=) <$> _gaPassword])
data Xss =
Xss'
{ _xStackTraces :: !(Maybe [Text])
, _xErrorMessage :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
xss
:: Xss
xss = Xss' {_xStackTraces = Nothing, _xErrorMessage = Nothing}
xStackTraces :: Lens' Xss [Text]
xStackTraces
= lens _xStackTraces (\ s a -> s{_xStackTraces = a})
. _Default
. _Coerce
xErrorMessage :: Lens' Xss (Maybe Text)
xErrorMessage
= lens _xErrorMessage
(\ s a -> s{_xErrorMessage = a})
instance FromJSON Xss where
parseJSON
= withObject "Xss"
(\ o ->
Xss' <$>
(o .:? "stackTraces" .!= mempty) <*>
(o .:? "errorMessage"))
instance ToJSON Xss where
toJSON Xss'{..}
= object
(catMaybes
[("stackTraces" .=) <$> _xStackTraces,
("errorMessage" .=) <$> _xErrorMessage])
data Authentication =
Authentication'
{ _aGoogleAccount :: !(Maybe GoogleAccount)
, _aCustomAccount :: !(Maybe CustomAccount)
}
deriving (Eq, Show, Data, Typeable, Generic)
authentication
:: Authentication
authentication =
Authentication' {_aGoogleAccount = Nothing, _aCustomAccount = Nothing}
aGoogleAccount :: Lens' Authentication (Maybe GoogleAccount)
aGoogleAccount
= lens _aGoogleAccount
(\ s a -> s{_aGoogleAccount = a})
aCustomAccount :: Lens' Authentication (Maybe CustomAccount)
aCustomAccount
= lens _aCustomAccount
(\ s a -> s{_aCustomAccount = a})
instance FromJSON Authentication where
parseJSON
= withObject "Authentication"
(\ o ->
Authentication' <$>
(o .:? "googleAccount") <*> (o .:? "customAccount"))
instance ToJSON Authentication where
toJSON Authentication'{..}
= object
(catMaybes
[("googleAccount" .=) <$> _aGoogleAccount,
("customAccount" .=) <$> _aCustomAccount])
data ListCrawledURLsResponse =
ListCrawledURLsResponse'
{ _lcurNextPageToken :: !(Maybe Text)
, _lcurCrawledURLs :: !(Maybe [CrawledURL])
}
deriving (Eq, Show, Data, Typeable, Generic)
listCrawledURLsResponse
:: ListCrawledURLsResponse
listCrawledURLsResponse =
ListCrawledURLsResponse'
{_lcurNextPageToken = Nothing, _lcurCrawledURLs = Nothing}
lcurNextPageToken :: Lens' ListCrawledURLsResponse (Maybe Text)
lcurNextPageToken
= lens _lcurNextPageToken
(\ s a -> s{_lcurNextPageToken = a})
lcurCrawledURLs :: Lens' ListCrawledURLsResponse [CrawledURL]
lcurCrawledURLs
= lens _lcurCrawledURLs
(\ s a -> s{_lcurCrawledURLs = a})
. _Default
. _Coerce
instance FromJSON ListCrawledURLsResponse where
parseJSON
= withObject "ListCrawledURLsResponse"
(\ o ->
ListCrawledURLsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "crawledUrls" .!= mempty))
instance ToJSON ListCrawledURLsResponse where
toJSON ListCrawledURLsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lcurNextPageToken,
("crawledUrls" .=) <$> _lcurCrawledURLs])
newtype VulnerableParameters =
VulnerableParameters'
{ _vpParameterNames :: Maybe [Text]
}
deriving (Eq, Show, Data, Typeable, Generic)
vulnerableParameters
:: VulnerableParameters
vulnerableParameters = VulnerableParameters' {_vpParameterNames = Nothing}
vpParameterNames :: Lens' VulnerableParameters [Text]
vpParameterNames
= lens _vpParameterNames
(\ s a -> s{_vpParameterNames = a})
. _Default
. _Coerce
instance FromJSON VulnerableParameters where
parseJSON
= withObject "VulnerableParameters"
(\ o ->
VulnerableParameters' <$>
(o .:? "parameterNames" .!= mempty))
instance ToJSON VulnerableParameters where
toJSON VulnerableParameters'{..}
= object
(catMaybes
[("parameterNames" .=) <$> _vpParameterNames])
data CrawledURL =
CrawledURL'
{ _cuHTTPMethod :: !(Maybe Text)
, _cuBody :: !(Maybe Text)
, _cuURL :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
crawledURL
:: CrawledURL
crawledURL =
CrawledURL' {_cuHTTPMethod = Nothing, _cuBody = Nothing, _cuURL = Nothing}
cuHTTPMethod :: Lens' CrawledURL (Maybe Text)
cuHTTPMethod
= lens _cuHTTPMethod (\ s a -> s{_cuHTTPMethod = a})
cuBody :: Lens' CrawledURL (Maybe Text)
cuBody = lens _cuBody (\ s a -> s{_cuBody = a})
cuURL :: Lens' CrawledURL (Maybe Text)
cuURL = lens _cuURL (\ s a -> s{_cuURL = a})
instance FromJSON CrawledURL where
parseJSON
= withObject "CrawledURL"
(\ o ->
CrawledURL' <$>
(o .:? "httpMethod") <*> (o .:? "body") <*>
(o .:? "url"))
instance ToJSON CrawledURL where
toJSON CrawledURL'{..}
= object
(catMaybes
[("httpMethod" .=) <$> _cuHTTPMethod,
("body" .=) <$> _cuBody, ("url" .=) <$> _cuURL])
data OutdatedLibrary =
OutdatedLibrary'
{ _olLearnMoreURLs :: !(Maybe [Text])
, _olVersion :: !(Maybe Text)
, _olLibraryName :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
outdatedLibrary
:: OutdatedLibrary
outdatedLibrary =
OutdatedLibrary'
{_olLearnMoreURLs = Nothing, _olVersion = Nothing, _olLibraryName = Nothing}
olLearnMoreURLs :: Lens' OutdatedLibrary [Text]
olLearnMoreURLs
= lens _olLearnMoreURLs
(\ s a -> s{_olLearnMoreURLs = a})
. _Default
. _Coerce
olVersion :: Lens' OutdatedLibrary (Maybe Text)
olVersion
= lens _olVersion (\ s a -> s{_olVersion = a})
olLibraryName :: Lens' OutdatedLibrary (Maybe Text)
olLibraryName
= lens _olLibraryName
(\ s a -> s{_olLibraryName = a})
instance FromJSON OutdatedLibrary where
parseJSON
= withObject "OutdatedLibrary"
(\ o ->
OutdatedLibrary' <$>
(o .:? "learnMoreUrls" .!= mempty) <*>
(o .:? "version")
<*> (o .:? "libraryName"))
instance ToJSON OutdatedLibrary where
toJSON OutdatedLibrary'{..}
= object
(catMaybes
[("learnMoreUrls" .=) <$> _olLearnMoreURLs,
("version" .=) <$> _olVersion,
("libraryName" .=) <$> _olLibraryName])
data ListScanRunsResponse =
ListScanRunsResponse'
{ _lsrrNextPageToken :: !(Maybe Text)
, _lsrrScanRuns :: !(Maybe [ScanRun])
}
deriving (Eq, Show, Data, Typeable, Generic)
listScanRunsResponse
:: ListScanRunsResponse
listScanRunsResponse =
ListScanRunsResponse' {_lsrrNextPageToken = Nothing, _lsrrScanRuns = Nothing}
lsrrNextPageToken :: Lens' ListScanRunsResponse (Maybe Text)
lsrrNextPageToken
= lens _lsrrNextPageToken
(\ s a -> s{_lsrrNextPageToken = a})
lsrrScanRuns :: Lens' ListScanRunsResponse [ScanRun]
lsrrScanRuns
= lens _lsrrScanRuns (\ s a -> s{_lsrrScanRuns = a})
. _Default
. _Coerce
instance FromJSON ListScanRunsResponse where
parseJSON
= withObject "ListScanRunsResponse"
(\ o ->
ListScanRunsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "scanRuns" .!= mempty))
instance ToJSON ListScanRunsResponse where
toJSON ListScanRunsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lsrrNextPageToken,
("scanRuns" .=) <$> _lsrrScanRuns])
data Header =
Header'
{ _hValue :: !(Maybe Text)
, _hName :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
header
:: Header
header = Header' {_hValue = Nothing, _hName = Nothing}
hValue :: Lens' Header (Maybe Text)
hValue = lens _hValue (\ s a -> s{_hValue = a})
hName :: Lens' Header (Maybe Text)
hName = lens _hName (\ s a -> s{_hName = a})
instance FromJSON Header where
parseJSON
= withObject "Header"
(\ o ->
Header' <$> (o .:? "value") <*> (o .:? "name"))
instance ToJSON Header where
toJSON Header'{..}
= object
(catMaybes
[("value" .=) <$> _hValue, ("name" .=) <$> _hName])
data ScanRunErrorTrace =
ScanRunErrorTrace'
{ _sretMostCommonHTTPErrorCode :: !(Maybe (Textual Int32))
, _sretScanConfigError :: !(Maybe ScanConfigError)
, _sretCode :: !(Maybe ScanRunErrorTraceCode)
}
deriving (Eq, Show, Data, Typeable, Generic)
scanRunErrorTrace
:: ScanRunErrorTrace
scanRunErrorTrace =
ScanRunErrorTrace'
{ _sretMostCommonHTTPErrorCode = Nothing
, _sretScanConfigError = Nothing
, _sretCode = Nothing
}
sretMostCommonHTTPErrorCode :: Lens' ScanRunErrorTrace (Maybe Int32)
sretMostCommonHTTPErrorCode
= lens _sretMostCommonHTTPErrorCode
(\ s a -> s{_sretMostCommonHTTPErrorCode = a})
. mapping _Coerce
sretScanConfigError :: Lens' ScanRunErrorTrace (Maybe ScanConfigError)
sretScanConfigError
= lens _sretScanConfigError
(\ s a -> s{_sretScanConfigError = a})
sretCode :: Lens' ScanRunErrorTrace (Maybe ScanRunErrorTraceCode)
sretCode = lens _sretCode (\ s a -> s{_sretCode = a})
instance FromJSON ScanRunErrorTrace where
parseJSON
= withObject "ScanRunErrorTrace"
(\ o ->
ScanRunErrorTrace' <$>
(o .:? "mostCommonHttpErrorCode") <*>
(o .:? "scanConfigError")
<*> (o .:? "code"))
instance ToJSON ScanRunErrorTrace where
toJSON ScanRunErrorTrace'{..}
= object
(catMaybes
[("mostCommonHttpErrorCode" .=) <$>
_sretMostCommonHTTPErrorCode,
("scanConfigError" .=) <$> _sretScanConfigError,
("code" .=) <$> _sretCode])
data ListScanConfigsResponse =
ListScanConfigsResponse'
{ _lscrNextPageToken :: !(Maybe Text)
, _lscrScanConfigs :: !(Maybe [ScanConfig])
}
deriving (Eq, Show, Data, Typeable, Generic)
listScanConfigsResponse
:: ListScanConfigsResponse
listScanConfigsResponse =
ListScanConfigsResponse'
{_lscrNextPageToken = Nothing, _lscrScanConfigs = Nothing}
lscrNextPageToken :: Lens' ListScanConfigsResponse (Maybe Text)
lscrNextPageToken
= lens _lscrNextPageToken
(\ s a -> s{_lscrNextPageToken = a})
lscrScanConfigs :: Lens' ListScanConfigsResponse [ScanConfig]
lscrScanConfigs
= lens _lscrScanConfigs
(\ s a -> s{_lscrScanConfigs = a})
. _Default
. _Coerce
instance FromJSON ListScanConfigsResponse where
parseJSON
= withObject "ListScanConfigsResponse"
(\ o ->
ListScanConfigsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "scanConfigs" .!= mempty))
instance ToJSON ListScanConfigsResponse where
toJSON ListScanConfigsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lscrNextPageToken,
("scanConfigs" .=) <$> _lscrScanConfigs])
data StartScanRunRequest =
StartScanRunRequest'
deriving (Eq, Show, Data, Typeable, Generic)
startScanRunRequest
:: StartScanRunRequest
startScanRunRequest = StartScanRunRequest'
instance FromJSON StartScanRunRequest where
parseJSON
= withObject "StartScanRunRequest"
(\ o -> pure StartScanRunRequest')
instance ToJSON StartScanRunRequest where
toJSON = const emptyObject
data CustomAccount =
CustomAccount'
{ _caLoginURL :: !(Maybe Text)
, _caUsername :: !(Maybe Text)
, _caPassword :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
customAccount
:: CustomAccount
customAccount =
CustomAccount'
{_caLoginURL = Nothing, _caUsername = Nothing, _caPassword = Nothing}
caLoginURL :: Lens' CustomAccount (Maybe Text)
caLoginURL
= lens _caLoginURL (\ s a -> s{_caLoginURL = a})
caUsername :: Lens' CustomAccount (Maybe Text)
caUsername
= lens _caUsername (\ s a -> s{_caUsername = a})
caPassword :: Lens' CustomAccount (Maybe Text)
caPassword
= lens _caPassword (\ s a -> s{_caPassword = a})
instance FromJSON CustomAccount where
parseJSON
= withObject "CustomAccount"
(\ o ->
CustomAccount' <$>
(o .:? "loginUrl") <*> (o .:? "username") <*>
(o .:? "password"))
instance ToJSON CustomAccount where
toJSON CustomAccount'{..}
= object
(catMaybes
[("loginUrl" .=) <$> _caLoginURL,
("username" .=) <$> _caUsername,
("password" .=) <$> _caPassword])
data ScanConfig =
ScanConfig'
{ _scLatestRun :: !(Maybe ScanRun)
, _scSchedule :: !(Maybe Schedule)
, _scTargetPlatforms :: !(Maybe [Text])
, _scStartingURLs :: !(Maybe [Text])
, _scAuthentication :: !(Maybe Authentication)
, _scMaxQps :: !(Maybe (Textual Int32))
, _scName :: !(Maybe Text)
, _scExportToSecurityCommandCenter :: !(Maybe ScanConfigExportToSecurityCommandCenter)
, _scDisplayName :: !(Maybe Text)
, _scUserAgent :: !(Maybe ScanConfigUserAgent)
, _scBlackListPatterns :: !(Maybe [Text])
}
deriving (Eq, Show, Data, Typeable, Generic)
scanConfig
:: ScanConfig
scanConfig =
ScanConfig'
{ _scLatestRun = Nothing
, _scSchedule = Nothing
, _scTargetPlatforms = Nothing
, _scStartingURLs = Nothing
, _scAuthentication = Nothing
, _scMaxQps = Nothing
, _scName = Nothing
, _scExportToSecurityCommandCenter = Nothing
, _scDisplayName = Nothing
, _scUserAgent = Nothing
, _scBlackListPatterns = Nothing
}
scLatestRun :: Lens' ScanConfig (Maybe ScanRun)
scLatestRun
= lens _scLatestRun (\ s a -> s{_scLatestRun = a})
scSchedule :: Lens' ScanConfig (Maybe Schedule)
scSchedule
= lens _scSchedule (\ s a -> s{_scSchedule = a})
scTargetPlatforms :: Lens' ScanConfig [Text]
scTargetPlatforms
= lens _scTargetPlatforms
(\ s a -> s{_scTargetPlatforms = a})
. _Default
. _Coerce
scStartingURLs :: Lens' ScanConfig [Text]
scStartingURLs
= lens _scStartingURLs
(\ s a -> s{_scStartingURLs = a})
. _Default
. _Coerce
scAuthentication :: Lens' ScanConfig (Maybe Authentication)
scAuthentication
= lens _scAuthentication
(\ s a -> s{_scAuthentication = a})
scMaxQps :: Lens' ScanConfig (Maybe Int32)
scMaxQps
= lens _scMaxQps (\ s a -> s{_scMaxQps = a}) .
mapping _Coerce
scName :: Lens' ScanConfig (Maybe Text)
scName = lens _scName (\ s a -> s{_scName = a})
scExportToSecurityCommandCenter :: Lens' ScanConfig (Maybe ScanConfigExportToSecurityCommandCenter)
scExportToSecurityCommandCenter
= lens _scExportToSecurityCommandCenter
(\ s a -> s{_scExportToSecurityCommandCenter = a})
scDisplayName :: Lens' ScanConfig (Maybe Text)
scDisplayName
= lens _scDisplayName
(\ s a -> s{_scDisplayName = a})
scUserAgent :: Lens' ScanConfig (Maybe ScanConfigUserAgent)
scUserAgent
= lens _scUserAgent (\ s a -> s{_scUserAgent = a})
scBlackListPatterns :: Lens' ScanConfig [Text]
scBlackListPatterns
= lens _scBlackListPatterns
(\ s a -> s{_scBlackListPatterns = a})
. _Default
. _Coerce
instance FromJSON ScanConfig where
parseJSON
= withObject "ScanConfig"
(\ o ->
ScanConfig' <$>
(o .:? "latestRun") <*> (o .:? "schedule") <*>
(o .:? "targetPlatforms" .!= mempty)
<*> (o .:? "startingUrls" .!= mempty)
<*> (o .:? "authentication")
<*> (o .:? "maxQps")
<*> (o .:? "name")
<*> (o .:? "exportToSecurityCommandCenter")
<*> (o .:? "displayName")
<*> (o .:? "userAgent")
<*> (o .:? "blacklistPatterns" .!= mempty))
instance ToJSON ScanConfig where
toJSON ScanConfig'{..}
= object
(catMaybes
[("latestRun" .=) <$> _scLatestRun,
("schedule" .=) <$> _scSchedule,
("targetPlatforms" .=) <$> _scTargetPlatforms,
("startingUrls" .=) <$> _scStartingURLs,
("authentication" .=) <$> _scAuthentication,
("maxQps" .=) <$> _scMaxQps, ("name" .=) <$> _scName,
("exportToSecurityCommandCenter" .=) <$>
_scExportToSecurityCommandCenter,
("displayName" .=) <$> _scDisplayName,
("userAgent" .=) <$> _scUserAgent,
("blacklistPatterns" .=) <$> _scBlackListPatterns])
data VulnerableHeaders =
VulnerableHeaders'
{ _vhMissingHeaders :: !(Maybe [Header])
, _vhHeaders :: !(Maybe [Header])
}
deriving (Eq, Show, Data, Typeable, Generic)
vulnerableHeaders
:: VulnerableHeaders
vulnerableHeaders =
VulnerableHeaders' {_vhMissingHeaders = Nothing, _vhHeaders = Nothing}
vhMissingHeaders :: Lens' VulnerableHeaders [Header]
vhMissingHeaders
= lens _vhMissingHeaders
(\ s a -> s{_vhMissingHeaders = a})
. _Default
. _Coerce
vhHeaders :: Lens' VulnerableHeaders [Header]
vhHeaders
= lens _vhHeaders (\ s a -> s{_vhHeaders = a}) .
_Default
. _Coerce
instance FromJSON VulnerableHeaders where
parseJSON
= withObject "VulnerableHeaders"
(\ o ->
VulnerableHeaders' <$>
(o .:? "missingHeaders" .!= mempty) <*>
(o .:? "headers" .!= mempty))
instance ToJSON VulnerableHeaders where
toJSON VulnerableHeaders'{..}
= object
(catMaybes
[("missingHeaders" .=) <$> _vhMissingHeaders,
("headers" .=) <$> _vhHeaders])
data ViolatingResource =
ViolatingResource'
{ _vrContentType :: !(Maybe Text)
, _vrResourceURL :: !(Maybe Text)
}
deriving (Eq, Show, Data, Typeable, Generic)
violatingResource
:: ViolatingResource
violatingResource =
ViolatingResource' {_vrContentType = Nothing, _vrResourceURL = Nothing}
vrContentType :: Lens' ViolatingResource (Maybe Text)
vrContentType
= lens _vrContentType
(\ s a -> s{_vrContentType = a})
vrResourceURL :: Lens' ViolatingResource (Maybe Text)
vrResourceURL
= lens _vrResourceURL
(\ s a -> s{_vrResourceURL = a})
instance FromJSON ViolatingResource where
parseJSON
= withObject "ViolatingResource"
(\ o ->
ViolatingResource' <$>
(o .:? "contentType") <*> (o .:? "resourceUrl"))
instance ToJSON ViolatingResource where
toJSON ViolatingResource'{..}
= object
(catMaybes
[("contentType" .=) <$> _vrContentType,
("resourceUrl" .=) <$> _vrResourceURL])
data Form =
Form'
{ _fActionURI :: !(Maybe Text)
, _fFields :: !(Maybe [Text])
}
deriving (Eq, Show, Data, Typeable, Generic)
form
:: Form
form = Form' {_fActionURI = Nothing, _fFields = Nothing}
fActionURI :: Lens' Form (Maybe Text)
fActionURI
= lens _fActionURI (\ s a -> s{_fActionURI = a})
fFields :: Lens' Form [Text]
fFields
= lens _fFields (\ s a -> s{_fFields = a}) . _Default
. _Coerce
instance FromJSON Form where
parseJSON
= withObject "Form"
(\ o ->
Form' <$>
(o .:? "actionUri") <*> (o .:? "fields" .!= mempty))
instance ToJSON Form where
toJSON Form'{..}
= object
(catMaybes
[("actionUri" .=) <$> _fActionURI,
("fields" .=) <$> _fFields])
data ScanRun =
ScanRun'
{ _srStartTime :: !(Maybe DateTime')
, _srHasVulnerabilities :: !(Maybe Bool)
, _srWarningTraces :: !(Maybe [ScanRunWarningTrace])
, _srResultState :: !(Maybe ScanRunResultState)
, _srProgressPercent :: !(Maybe (Textual Int32))
, _srURLsCrawledCount :: !(Maybe (Textual Int64))
, _srURLsTestedCount :: !(Maybe (Textual Int64))
, _srName :: !(Maybe Text)
, _srEndTime :: !(Maybe DateTime')
, _srExecutionState :: !(Maybe ScanRunExecutionState)
, _srErrorTrace :: !(Maybe ScanRunErrorTrace)
}
deriving (Eq, Show, Data, Typeable, Generic)
scanRun
:: ScanRun
scanRun =
ScanRun'
{ _srStartTime = Nothing
, _srHasVulnerabilities = Nothing
, _srWarningTraces = Nothing
, _srResultState = Nothing
, _srProgressPercent = Nothing
, _srURLsCrawledCount = Nothing
, _srURLsTestedCount = Nothing
, _srName = Nothing
, _srEndTime = Nothing
, _srExecutionState = Nothing
, _srErrorTrace = Nothing
}
srStartTime :: Lens' ScanRun (Maybe UTCTime)
srStartTime
= lens _srStartTime (\ s a -> s{_srStartTime = a}) .
mapping _DateTime
srHasVulnerabilities :: Lens' ScanRun (Maybe Bool)
srHasVulnerabilities
= lens _srHasVulnerabilities
(\ s a -> s{_srHasVulnerabilities = a})
srWarningTraces :: Lens' ScanRun [ScanRunWarningTrace]
srWarningTraces
= lens _srWarningTraces
(\ s a -> s{_srWarningTraces = a})
. _Default
. _Coerce
srResultState :: Lens' ScanRun (Maybe ScanRunResultState)
srResultState
= lens _srResultState
(\ s a -> s{_srResultState = a})
srProgressPercent :: Lens' ScanRun (Maybe Int32)
srProgressPercent
= lens _srProgressPercent
(\ s a -> s{_srProgressPercent = a})
. mapping _Coerce
srURLsCrawledCount :: Lens' ScanRun (Maybe Int64)
srURLsCrawledCount
= lens _srURLsCrawledCount
(\ s a -> s{_srURLsCrawledCount = a})
. mapping _Coerce
srURLsTestedCount :: Lens' ScanRun (Maybe Int64)
srURLsTestedCount
= lens _srURLsTestedCount
(\ s a -> s{_srURLsTestedCount = a})
. mapping _Coerce
srName :: Lens' ScanRun (Maybe Text)
srName = lens _srName (\ s a -> s{_srName = a})
srEndTime :: Lens' ScanRun (Maybe UTCTime)
srEndTime
= lens _srEndTime (\ s a -> s{_srEndTime = a}) .
mapping _DateTime
srExecutionState :: Lens' ScanRun (Maybe ScanRunExecutionState)
srExecutionState
= lens _srExecutionState
(\ s a -> s{_srExecutionState = a})
srErrorTrace :: Lens' ScanRun (Maybe ScanRunErrorTrace)
srErrorTrace
= lens _srErrorTrace (\ s a -> s{_srErrorTrace = a})
instance FromJSON ScanRun where
parseJSON
= withObject "ScanRun"
(\ o ->
ScanRun' <$>
(o .:? "startTime") <*> (o .:? "hasVulnerabilities")
<*> (o .:? "warningTraces" .!= mempty)
<*> (o .:? "resultState")
<*> (o .:? "progressPercent")
<*> (o .:? "urlsCrawledCount")
<*> (o .:? "urlsTestedCount")
<*> (o .:? "name")
<*> (o .:? "endTime")
<*> (o .:? "executionState")
<*> (o .:? "errorTrace"))
instance ToJSON ScanRun where
toJSON ScanRun'{..}
= object
(catMaybes
[("startTime" .=) <$> _srStartTime,
("hasVulnerabilities" .=) <$> _srHasVulnerabilities,
("warningTraces" .=) <$> _srWarningTraces,
("resultState" .=) <$> _srResultState,
("progressPercent" .=) <$> _srProgressPercent,
("urlsCrawledCount" .=) <$> _srURLsCrawledCount,
("urlsTestedCount" .=) <$> _srURLsTestedCount,
("name" .=) <$> _srName,
("endTime" .=) <$> _srEndTime,
("executionState" .=) <$> _srExecutionState,
("errorTrace" .=) <$> _srErrorTrace])