{-# 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.FirebaseRules.Types.Product where
import Network.Google.FirebaseRules.Types.Sum
import Network.Google.Prelude
data SourcePosition = SourcePosition'
{ _spLine :: !(Maybe (Textual Int32))
, _spColumn :: !(Maybe (Textual Int32))
, _spFileName :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
sourcePosition
:: SourcePosition
sourcePosition =
SourcePosition'
{ _spLine = Nothing
, _spColumn = Nothing
, _spFileName = Nothing
}
spLine :: Lens' SourcePosition (Maybe Int32)
spLine
= lens _spLine (\ s a -> s{_spLine = a}) .
mapping _Coerce
spColumn :: Lens' SourcePosition (Maybe Int32)
spColumn
= lens _spColumn (\ s a -> s{_spColumn = a}) .
mapping _Coerce
spFileName :: Lens' SourcePosition (Maybe Text)
spFileName
= lens _spFileName (\ s a -> s{_spFileName = a})
instance FromJSON SourcePosition where
parseJSON
= withObject "SourcePosition"
(\ o ->
SourcePosition' <$>
(o .:? "line") <*> (o .:? "column") <*>
(o .:? "fileName"))
instance ToJSON SourcePosition where
toJSON SourcePosition'{..}
= object
(catMaybes
[("line" .=) <$> _spLine,
("column" .=) <$> _spColumn,
("fileName" .=) <$> _spFileName])
data TestCase = TestCase'
{ _tcResource :: !(Maybe JSONValue)
, _tcExpectation :: !(Maybe TestCaseExpectation)
, _tcFunctionMocks :: !(Maybe [FunctionMock])
, _tcRequest :: !(Maybe JSONValue)
} deriving (Eq,Show,Data,Typeable,Generic)
testCase
:: TestCase
testCase =
TestCase'
{ _tcResource = Nothing
, _tcExpectation = Nothing
, _tcFunctionMocks = Nothing
, _tcRequest = Nothing
}
tcResource :: Lens' TestCase (Maybe JSONValue)
tcResource
= lens _tcResource (\ s a -> s{_tcResource = a})
tcExpectation :: Lens' TestCase (Maybe TestCaseExpectation)
tcExpectation
= lens _tcExpectation
(\ s a -> s{_tcExpectation = a})
tcFunctionMocks :: Lens' TestCase [FunctionMock]
tcFunctionMocks
= lens _tcFunctionMocks
(\ s a -> s{_tcFunctionMocks = a})
. _Default
. _Coerce
tcRequest :: Lens' TestCase (Maybe JSONValue)
tcRequest
= lens _tcRequest (\ s a -> s{_tcRequest = a})
instance FromJSON TestCase where
parseJSON
= withObject "TestCase"
(\ o ->
TestCase' <$>
(o .:? "resource") <*> (o .:? "expectation") <*>
(o .:? "functionMocks" .!= mempty)
<*> (o .:? "request"))
instance ToJSON TestCase where
toJSON TestCase'{..}
= object
(catMaybes
[("resource" .=) <$> _tcResource,
("expectation" .=) <$> _tcExpectation,
("functionMocks" .=) <$> _tcFunctionMocks,
("request" .=) <$> _tcRequest])
data VisitedExpression = VisitedExpression'
{ _veSourcePosition :: !(Maybe SourcePosition)
, _veValue :: !(Maybe JSONValue)
} deriving (Eq,Show,Data,Typeable,Generic)
visitedExpression
:: VisitedExpression
visitedExpression =
VisitedExpression'
{ _veSourcePosition = Nothing
, _veValue = Nothing
}
veSourcePosition :: Lens' VisitedExpression (Maybe SourcePosition)
veSourcePosition
= lens _veSourcePosition
(\ s a -> s{_veSourcePosition = a})
veValue :: Lens' VisitedExpression (Maybe JSONValue)
veValue = lens _veValue (\ s a -> s{_veValue = a})
instance FromJSON VisitedExpression where
parseJSON
= withObject "VisitedExpression"
(\ o ->
VisitedExpression' <$>
(o .:? "sourcePosition") <*> (o .:? "value"))
instance ToJSON VisitedExpression where
toJSON VisitedExpression'{..}
= object
(catMaybes
[("sourcePosition" .=) <$> _veSourcePosition,
("value" .=) <$> _veValue])
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 FunctionMock = FunctionMock'
{ _fmArgs :: !(Maybe [Arg])
, _fmFunction :: !(Maybe Text)
, _fmResult :: !(Maybe Result)
} deriving (Eq,Show,Data,Typeable,Generic)
functionMock
:: FunctionMock
functionMock =
FunctionMock'
{ _fmArgs = Nothing
, _fmFunction = Nothing
, _fmResult = Nothing
}
fmArgs :: Lens' FunctionMock [Arg]
fmArgs
= lens _fmArgs (\ s a -> s{_fmArgs = a}) . _Default .
_Coerce
fmFunction :: Lens' FunctionMock (Maybe Text)
fmFunction
= lens _fmFunction (\ s a -> s{_fmFunction = a})
fmResult :: Lens' FunctionMock (Maybe Result)
fmResult = lens _fmResult (\ s a -> s{_fmResult = a})
instance FromJSON FunctionMock where
parseJSON
= withObject "FunctionMock"
(\ o ->
FunctionMock' <$>
(o .:? "args" .!= mempty) <*> (o .:? "function") <*>
(o .:? "result"))
instance ToJSON FunctionMock where
toJSON FunctionMock'{..}
= object
(catMaybes
[("args" .=) <$> _fmArgs,
("function" .=) <$> _fmFunction,
("result" .=) <$> _fmResult])
data FunctionCall = FunctionCall'
{ _fcArgs :: !(Maybe [JSONValue])
, _fcFunction :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
functionCall
:: FunctionCall
functionCall =
FunctionCall'
{ _fcArgs = Nothing
, _fcFunction = Nothing
}
fcArgs :: Lens' FunctionCall [JSONValue]
fcArgs
= lens _fcArgs (\ s a -> s{_fcArgs = a}) . _Default .
_Coerce
fcFunction :: Lens' FunctionCall (Maybe Text)
fcFunction
= lens _fcFunction (\ s a -> s{_fcFunction = a})
instance FromJSON FunctionCall where
parseJSON
= withObject "FunctionCall"
(\ o ->
FunctionCall' <$>
(o .:? "args" .!= mempty) <*> (o .:? "function"))
instance ToJSON FunctionCall where
toJSON FunctionCall'{..}
= object
(catMaybes
[("args" .=) <$> _fcArgs,
("function" .=) <$> _fcFunction])
data ListReleasesResponse = ListReleasesResponse'
{ _lrrNextPageToken :: !(Maybe Text)
, _lrrReleases :: !(Maybe [Release])
} deriving (Eq,Show,Data,Typeable,Generic)
listReleasesResponse
:: ListReleasesResponse
listReleasesResponse =
ListReleasesResponse'
{ _lrrNextPageToken = Nothing
, _lrrReleases = Nothing
}
lrrNextPageToken :: Lens' ListReleasesResponse (Maybe Text)
lrrNextPageToken
= lens _lrrNextPageToken
(\ s a -> s{_lrrNextPageToken = a})
lrrReleases :: Lens' ListReleasesResponse [Release]
lrrReleases
= lens _lrrReleases (\ s a -> s{_lrrReleases = a}) .
_Default
. _Coerce
instance FromJSON ListReleasesResponse where
parseJSON
= withObject "ListReleasesResponse"
(\ o ->
ListReleasesResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "releases" .!= mempty))
instance ToJSON ListReleasesResponse where
toJSON ListReleasesResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lrrNextPageToken,
("releases" .=) <$> _lrrReleases])
data Result = Result'
{ _rValue :: !(Maybe JSONValue)
, _rUndefined :: !(Maybe Empty)
} deriving (Eq,Show,Data,Typeable,Generic)
result
:: Result
result =
Result'
{ _rValue = Nothing
, _rUndefined = Nothing
}
rValue :: Lens' Result (Maybe JSONValue)
rValue = lens _rValue (\ s a -> s{_rValue = a})
rUndefined :: Lens' Result (Maybe Empty)
rUndefined
= lens _rUndefined (\ s a -> s{_rUndefined = a})
instance FromJSON Result where
parseJSON
= withObject "Result"
(\ o ->
Result' <$> (o .:? "value") <*> (o .:? "undefined"))
instance ToJSON Result where
toJSON Result'{..}
= object
(catMaybes
[("value" .=) <$> _rValue,
("undefined" .=) <$> _rUndefined])
data TestRulesetResponse = TestRulesetResponse'
{ _trrTestResults :: !(Maybe [TestResult])
, _trrIssues :: !(Maybe [Issue])
} deriving (Eq,Show,Data,Typeable,Generic)
testRulesetResponse
:: TestRulesetResponse
testRulesetResponse =
TestRulesetResponse'
{ _trrTestResults = Nothing
, _trrIssues = Nothing
}
trrTestResults :: Lens' TestRulesetResponse [TestResult]
trrTestResults
= lens _trrTestResults
(\ s a -> s{_trrTestResults = a})
. _Default
. _Coerce
trrIssues :: Lens' TestRulesetResponse [Issue]
trrIssues
= lens _trrIssues (\ s a -> s{_trrIssues = a}) .
_Default
. _Coerce
instance FromJSON TestRulesetResponse where
parseJSON
= withObject "TestRulesetResponse"
(\ o ->
TestRulesetResponse' <$>
(o .:? "testResults" .!= mempty) <*>
(o .:? "issues" .!= mempty))
instance ToJSON TestRulesetResponse where
toJSON TestRulesetResponse'{..}
= object
(catMaybes
[("testResults" .=) <$> _trrTestResults,
("issues" .=) <$> _trrIssues])
data Release = Release'
{ _rRulesetName :: !(Maybe Text)
, _rUpdateTime :: !(Maybe DateTime')
, _rName :: !(Maybe Text)
, _rCreateTime :: !(Maybe DateTime')
} deriving (Eq,Show,Data,Typeable,Generic)
release
:: Release
release =
Release'
{ _rRulesetName = Nothing
, _rUpdateTime = Nothing
, _rName = Nothing
, _rCreateTime = Nothing
}
rRulesetName :: Lens' Release (Maybe Text)
rRulesetName
= lens _rRulesetName (\ s a -> s{_rRulesetName = a})
rUpdateTime :: Lens' Release (Maybe UTCTime)
rUpdateTime
= lens _rUpdateTime (\ s a -> s{_rUpdateTime = a}) .
mapping _DateTime
rName :: Lens' Release (Maybe Text)
rName = lens _rName (\ s a -> s{_rName = a})
rCreateTime :: Lens' Release (Maybe UTCTime)
rCreateTime
= lens _rCreateTime (\ s a -> s{_rCreateTime = a}) .
mapping _DateTime
instance FromJSON Release where
parseJSON
= withObject "Release"
(\ o ->
Release' <$>
(o .:? "rulesetName") <*> (o .:? "updateTime") <*>
(o .:? "name")
<*> (o .:? "createTime"))
instance ToJSON Release where
toJSON Release'{..}
= object
(catMaybes
[("rulesetName" .=) <$> _rRulesetName,
("updateTime" .=) <$> _rUpdateTime,
("name" .=) <$> _rName,
("createTime" .=) <$> _rCreateTime])
data Arg = Arg'
{ _aAnyValue :: !(Maybe Empty)
, _aExactValue :: !(Maybe JSONValue)
} deriving (Eq,Show,Data,Typeable,Generic)
arg
:: Arg
arg =
Arg'
{ _aAnyValue = Nothing
, _aExactValue = Nothing
}
aAnyValue :: Lens' Arg (Maybe Empty)
aAnyValue
= lens _aAnyValue (\ s a -> s{_aAnyValue = a})
aExactValue :: Lens' Arg (Maybe JSONValue)
aExactValue
= lens _aExactValue (\ s a -> s{_aExactValue = a})
instance FromJSON Arg where
parseJSON
= withObject "Arg"
(\ o ->
Arg' <$> (o .:? "anyValue") <*> (o .:? "exactValue"))
instance ToJSON Arg where
toJSON Arg'{..}
= object
(catMaybes
[("anyValue" .=) <$> _aAnyValue,
("exactValue" .=) <$> _aExactValue])
data Ruleset = Ruleset'
{ _rulName :: !(Maybe Text)
, _rulSource :: !(Maybe Source)
, _rulCreateTime :: !(Maybe DateTime')
} deriving (Eq,Show,Data,Typeable,Generic)
ruleset
:: Ruleset
ruleset =
Ruleset'
{ _rulName = Nothing
, _rulSource = Nothing
, _rulCreateTime = Nothing
}
rulName :: Lens' Ruleset (Maybe Text)
rulName = lens _rulName (\ s a -> s{_rulName = a})
rulSource :: Lens' Ruleset (Maybe Source)
rulSource
= lens _rulSource (\ s a -> s{_rulSource = a})
rulCreateTime :: Lens' Ruleset (Maybe UTCTime)
rulCreateTime
= lens _rulCreateTime
(\ s a -> s{_rulCreateTime = a})
. mapping _DateTime
instance FromJSON Ruleset where
parseJSON
= withObject "Ruleset"
(\ o ->
Ruleset' <$>
(o .:? "name") <*> (o .:? "source") <*>
(o .:? "createTime"))
instance ToJSON Ruleset where
toJSON Ruleset'{..}
= object
(catMaybes
[("name" .=) <$> _rulName,
("source" .=) <$> _rulSource,
("createTime" .=) <$> _rulCreateTime])
data GetReleaseExecutableResponse = GetReleaseExecutableResponse'
{ _grerExecutable :: !(Maybe Bytes)
, _grerRulesetName :: !(Maybe Text)
, _grerUpdateTime :: !(Maybe DateTime')
, _grerSyncTime :: !(Maybe DateTime')
, _grerExecutableVersion :: !(Maybe GetReleaseExecutableResponseExecutableVersion)
, _grerLanguage :: !(Maybe GetReleaseExecutableResponseLanguage)
} deriving (Eq,Show,Data,Typeable,Generic)
getReleaseExecutableResponse
:: GetReleaseExecutableResponse
getReleaseExecutableResponse =
GetReleaseExecutableResponse'
{ _grerExecutable = Nothing
, _grerRulesetName = Nothing
, _grerUpdateTime = Nothing
, _grerSyncTime = Nothing
, _grerExecutableVersion = Nothing
, _grerLanguage = Nothing
}
grerExecutable :: Lens' GetReleaseExecutableResponse (Maybe ByteString)
grerExecutable
= lens _grerExecutable
(\ s a -> s{_grerExecutable = a})
. mapping _Bytes
grerRulesetName :: Lens' GetReleaseExecutableResponse (Maybe Text)
grerRulesetName
= lens _grerRulesetName
(\ s a -> s{_grerRulesetName = a})
grerUpdateTime :: Lens' GetReleaseExecutableResponse (Maybe UTCTime)
grerUpdateTime
= lens _grerUpdateTime
(\ s a -> s{_grerUpdateTime = a})
. mapping _DateTime
grerSyncTime :: Lens' GetReleaseExecutableResponse (Maybe UTCTime)
grerSyncTime
= lens _grerSyncTime (\ s a -> s{_grerSyncTime = a})
. mapping _DateTime
grerExecutableVersion :: Lens' GetReleaseExecutableResponse (Maybe GetReleaseExecutableResponseExecutableVersion)
grerExecutableVersion
= lens _grerExecutableVersion
(\ s a -> s{_grerExecutableVersion = a})
grerLanguage :: Lens' GetReleaseExecutableResponse (Maybe GetReleaseExecutableResponseLanguage)
grerLanguage
= lens _grerLanguage (\ s a -> s{_grerLanguage = a})
instance FromJSON GetReleaseExecutableResponse where
parseJSON
= withObject "GetReleaseExecutableResponse"
(\ o ->
GetReleaseExecutableResponse' <$>
(o .:? "executable") <*> (o .:? "rulesetName") <*>
(o .:? "updateTime")
<*> (o .:? "syncTime")
<*> (o .:? "executableVersion")
<*> (o .:? "language"))
instance ToJSON GetReleaseExecutableResponse where
toJSON GetReleaseExecutableResponse'{..}
= object
(catMaybes
[("executable" .=) <$> _grerExecutable,
("rulesetName" .=) <$> _grerRulesetName,
("updateTime" .=) <$> _grerUpdateTime,
("syncTime" .=) <$> _grerSyncTime,
("executableVersion" .=) <$> _grerExecutableVersion,
("language" .=) <$> _grerLanguage])
data TestResult = TestResult'
{ _trState :: !(Maybe TestResultState)
, _trFunctionCalls :: !(Maybe [FunctionCall])
, _trVisitedExpressions :: !(Maybe [VisitedExpression])
, _trErrorPosition :: !(Maybe SourcePosition)
, _trDebugMessages :: !(Maybe [Text])
} deriving (Eq,Show,Data,Typeable,Generic)
testResult
:: TestResult
testResult =
TestResult'
{ _trState = Nothing
, _trFunctionCalls = Nothing
, _trVisitedExpressions = Nothing
, _trErrorPosition = Nothing
, _trDebugMessages = Nothing
}
trState :: Lens' TestResult (Maybe TestResultState)
trState = lens _trState (\ s a -> s{_trState = a})
trFunctionCalls :: Lens' TestResult [FunctionCall]
trFunctionCalls
= lens _trFunctionCalls
(\ s a -> s{_trFunctionCalls = a})
. _Default
. _Coerce
trVisitedExpressions :: Lens' TestResult [VisitedExpression]
trVisitedExpressions
= lens _trVisitedExpressions
(\ s a -> s{_trVisitedExpressions = a})
. _Default
. _Coerce
trErrorPosition :: Lens' TestResult (Maybe SourcePosition)
trErrorPosition
= lens _trErrorPosition
(\ s a -> s{_trErrorPosition = a})
trDebugMessages :: Lens' TestResult [Text]
trDebugMessages
= lens _trDebugMessages
(\ s a -> s{_trDebugMessages = a})
. _Default
. _Coerce
instance FromJSON TestResult where
parseJSON
= withObject "TestResult"
(\ o ->
TestResult' <$>
(o .:? "state") <*>
(o .:? "functionCalls" .!= mempty)
<*> (o .:? "visitedExpressions" .!= mempty)
<*> (o .:? "errorPosition")
<*> (o .:? "debugMessages" .!= mempty))
instance ToJSON TestResult where
toJSON TestResult'{..}
= object
(catMaybes
[("state" .=) <$> _trState,
("functionCalls" .=) <$> _trFunctionCalls,
("visitedExpressions" .=) <$> _trVisitedExpressions,
("errorPosition" .=) <$> _trErrorPosition,
("debugMessages" .=) <$> _trDebugMessages])
newtype Source = Source'
{ _sFiles :: Maybe [File]
} deriving (Eq,Show,Data,Typeable,Generic)
source
:: Source
source =
Source'
{ _sFiles = Nothing
}
sFiles :: Lens' Source [File]
sFiles
= lens _sFiles (\ s a -> s{_sFiles = a}) . _Default .
_Coerce
instance FromJSON Source where
parseJSON
= withObject "Source"
(\ o -> Source' <$> (o .:? "files" .!= mempty))
instance ToJSON Source where
toJSON Source'{..}
= object (catMaybes [("files" .=) <$> _sFiles])
newtype TestSuite = TestSuite'
{ _tsTestCases :: Maybe [TestCase]
} deriving (Eq,Show,Data,Typeable,Generic)
testSuite
:: TestSuite
testSuite =
TestSuite'
{ _tsTestCases = Nothing
}
tsTestCases :: Lens' TestSuite [TestCase]
tsTestCases
= lens _tsTestCases (\ s a -> s{_tsTestCases = a}) .
_Default
. _Coerce
instance FromJSON TestSuite where
parseJSON
= withObject "TestSuite"
(\ o ->
TestSuite' <$> (o .:? "testCases" .!= mempty))
instance ToJSON TestSuite where
toJSON TestSuite'{..}
= object
(catMaybes [("testCases" .=) <$> _tsTestCases])
data TestRulesetRequest = TestRulesetRequest'
{ _trrSource :: !(Maybe Source)
, _trrTestSuite :: !(Maybe TestSuite)
} deriving (Eq,Show,Data,Typeable,Generic)
testRulesetRequest
:: TestRulesetRequest
testRulesetRequest =
TestRulesetRequest'
{ _trrSource = Nothing
, _trrTestSuite = Nothing
}
trrSource :: Lens' TestRulesetRequest (Maybe Source)
trrSource
= lens _trrSource (\ s a -> s{_trrSource = a})
trrTestSuite :: Lens' TestRulesetRequest (Maybe TestSuite)
trrTestSuite
= lens _trrTestSuite (\ s a -> s{_trrTestSuite = a})
instance FromJSON TestRulesetRequest where
parseJSON
= withObject "TestRulesetRequest"
(\ o ->
TestRulesetRequest' <$>
(o .:? "source") <*> (o .:? "testSuite"))
instance ToJSON TestRulesetRequest where
toJSON TestRulesetRequest'{..}
= object
(catMaybes
[("source" .=) <$> _trrSource,
("testSuite" .=) <$> _trrTestSuite])
data File = File'
{ _fFingerprint :: !(Maybe Bytes)
, _fContent :: !(Maybe Text)
, _fName :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
file
:: File
file =
File'
{ _fFingerprint = Nothing
, _fContent = Nothing
, _fName = Nothing
}
fFingerprint :: Lens' File (Maybe ByteString)
fFingerprint
= lens _fFingerprint (\ s a -> s{_fFingerprint = a})
. mapping _Bytes
fContent :: Lens' File (Maybe Text)
fContent = lens _fContent (\ s a -> s{_fContent = a})
fName :: Lens' File (Maybe Text)
fName = lens _fName (\ s a -> s{_fName = a})
instance FromJSON File where
parseJSON
= withObject "File"
(\ o ->
File' <$>
(o .:? "fingerprint") <*> (o .:? "content") <*>
(o .:? "name"))
instance ToJSON File where
toJSON File'{..}
= object
(catMaybes
[("fingerprint" .=) <$> _fFingerprint,
("content" .=) <$> _fContent,
("name" .=) <$> _fName])
data ListRulesetsResponse = ListRulesetsResponse'
{ _lRulesets :: !(Maybe [Ruleset])
, _lNextPageToken :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
listRulesetsResponse
:: ListRulesetsResponse
listRulesetsResponse =
ListRulesetsResponse'
{ _lRulesets = Nothing
, _lNextPageToken = Nothing
}
lRulesets :: Lens' ListRulesetsResponse [Ruleset]
lRulesets
= lens _lRulesets (\ s a -> s{_lRulesets = a}) .
_Default
. _Coerce
lNextPageToken :: Lens' ListRulesetsResponse (Maybe Text)
lNextPageToken
= lens _lNextPageToken
(\ s a -> s{_lNextPageToken = a})
instance FromJSON ListRulesetsResponse where
parseJSON
= withObject "ListRulesetsResponse"
(\ o ->
ListRulesetsResponse' <$>
(o .:? "rulesets" .!= mempty) <*>
(o .:? "nextPageToken"))
instance ToJSON ListRulesetsResponse where
toJSON ListRulesetsResponse'{..}
= object
(catMaybes
[("rulesets" .=) <$> _lRulesets,
("nextPageToken" .=) <$> _lNextPageToken])
data Issue = Issue'
{ _iSourcePosition :: !(Maybe SourcePosition)
, _iSeverity :: !(Maybe IssueSeverity)
, _iDescription :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
issue
:: Issue
issue =
Issue'
{ _iSourcePosition = Nothing
, _iSeverity = Nothing
, _iDescription = Nothing
}
iSourcePosition :: Lens' Issue (Maybe SourcePosition)
iSourcePosition
= lens _iSourcePosition
(\ s a -> s{_iSourcePosition = a})
iSeverity :: Lens' Issue (Maybe IssueSeverity)
iSeverity
= lens _iSeverity (\ s a -> s{_iSeverity = a})
iDescription :: Lens' Issue (Maybe Text)
iDescription
= lens _iDescription (\ s a -> s{_iDescription = a})
instance FromJSON Issue where
parseJSON
= withObject "Issue"
(\ o ->
Issue' <$>
(o .:? "sourcePosition") <*> (o .:? "severity") <*>
(o .:? "description"))
instance ToJSON Issue where
toJSON Issue'{..}
= object
(catMaybes
[("sourcePosition" .=) <$> _iSourcePosition,
("severity" .=) <$> _iSeverity,
("description" .=) <$> _iDescription])
data UpdateReleaseRequest = UpdateReleaseRequest'
{ _urrUpdateMask :: !(Maybe GFieldMask)
, _urrRelease :: !(Maybe Release)
} deriving (Eq,Show,Data,Typeable,Generic)
updateReleaseRequest
:: UpdateReleaseRequest
updateReleaseRequest =
UpdateReleaseRequest'
{ _urrUpdateMask = Nothing
, _urrRelease = Nothing
}
urrUpdateMask :: Lens' UpdateReleaseRequest (Maybe GFieldMask)
urrUpdateMask
= lens _urrUpdateMask
(\ s a -> s{_urrUpdateMask = a})
urrRelease :: Lens' UpdateReleaseRequest (Maybe Release)
urrRelease
= lens _urrRelease (\ s a -> s{_urrRelease = a})
instance FromJSON UpdateReleaseRequest where
parseJSON
= withObject "UpdateReleaseRequest"
(\ o ->
UpdateReleaseRequest' <$>
(o .:? "updateMask") <*> (o .:? "release"))
instance ToJSON UpdateReleaseRequest where
toJSON UpdateReleaseRequest'{..}
= object
(catMaybes
[("updateMask" .=) <$> _urrUpdateMask,
("release" .=) <$> _urrRelease])