{-# 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.Script.Types.Product where
import Network.Google.Prelude
import Network.Google.Script.Types.Sum
newtype GoogleAppsScriptTypeFunctionSet = GoogleAppsScriptTypeFunctionSet'
{ _gastfsValues :: Maybe [GoogleAppsScriptTypeFunction]
} deriving (Eq,Show,Data,Typeable,Generic)
googleAppsScriptTypeFunctionSet
:: GoogleAppsScriptTypeFunctionSet
googleAppsScriptTypeFunctionSet =
GoogleAppsScriptTypeFunctionSet'
{ _gastfsValues = Nothing
}
gastfsValues :: Lens' GoogleAppsScriptTypeFunctionSet [GoogleAppsScriptTypeFunction]
gastfsValues
= lens _gastfsValues (\ s a -> s{_gastfsValues = a})
. _Default
. _Coerce
instance FromJSON GoogleAppsScriptTypeFunctionSet
where
parseJSON
= withObject "GoogleAppsScriptTypeFunctionSet"
(\ o ->
GoogleAppsScriptTypeFunctionSet' <$>
(o .:? "values" .!= mempty))
instance ToJSON GoogleAppsScriptTypeFunctionSet where
toJSON GoogleAppsScriptTypeFunctionSet'{..}
= object
(catMaybes [("values" .=) <$> _gastfsValues])
newtype GoogleAppsScriptTypeExecutionAPIConfig = GoogleAppsScriptTypeExecutionAPIConfig'
{ _gasteacAccess :: Maybe GoogleAppsScriptTypeExecutionAPIConfigAccess
} deriving (Eq,Show,Data,Typeable,Generic)
googleAppsScriptTypeExecutionAPIConfig
:: GoogleAppsScriptTypeExecutionAPIConfig
googleAppsScriptTypeExecutionAPIConfig =
GoogleAppsScriptTypeExecutionAPIConfig'
{ _gasteacAccess = Nothing
}
gasteacAccess :: Lens' GoogleAppsScriptTypeExecutionAPIConfig (Maybe GoogleAppsScriptTypeExecutionAPIConfigAccess)
gasteacAccess
= lens _gasteacAccess
(\ s a -> s{_gasteacAccess = a})
instance FromJSON
GoogleAppsScriptTypeExecutionAPIConfig where
parseJSON
= withObject "GoogleAppsScriptTypeExecutionAPIConfig"
(\ o ->
GoogleAppsScriptTypeExecutionAPIConfig' <$>
(o .:? "access"))
instance ToJSON
GoogleAppsScriptTypeExecutionAPIConfig where
toJSON GoogleAppsScriptTypeExecutionAPIConfig'{..}
= object
(catMaybes [("access" .=) <$> _gasteacAccess])
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])
data Metrics = Metrics'
{ _mActiveUsers :: !(Maybe [MetricsValue])
, _mFailedExecutions :: !(Maybe [MetricsValue])
, _mTotalExecutions :: !(Maybe [MetricsValue])
} deriving (Eq,Show,Data,Typeable,Generic)
metrics
:: Metrics
metrics =
Metrics'
{ _mActiveUsers = Nothing
, _mFailedExecutions = Nothing
, _mTotalExecutions = Nothing
}
mActiveUsers :: Lens' Metrics [MetricsValue]
mActiveUsers
= lens _mActiveUsers (\ s a -> s{_mActiveUsers = a})
. _Default
. _Coerce
mFailedExecutions :: Lens' Metrics [MetricsValue]
mFailedExecutions
= lens _mFailedExecutions
(\ s a -> s{_mFailedExecutions = a})
. _Default
. _Coerce
mTotalExecutions :: Lens' Metrics [MetricsValue]
mTotalExecutions
= lens _mTotalExecutions
(\ s a -> s{_mTotalExecutions = a})
. _Default
. _Coerce
instance FromJSON Metrics where
parseJSON
= withObject "Metrics"
(\ o ->
Metrics' <$>
(o .:? "activeUsers" .!= mempty) <*>
(o .:? "failedExecutions" .!= mempty)
<*> (o .:? "totalExecutions" .!= mempty))
instance ToJSON Metrics where
toJSON Metrics'{..}
= object
(catMaybes
[("activeUsers" .=) <$> _mActiveUsers,
("failedExecutions" .=) <$> _mFailedExecutions,
("totalExecutions" .=) <$> _mTotalExecutions])
data GoogleAppsScriptTypeProcess = GoogleAppsScriptTypeProcess'
{ _gastpProcessStatus :: !(Maybe GoogleAppsScriptTypeProcessProcessStatus)
, _gastpStartTime :: !(Maybe DateTime')
, _gastpProjectName :: !(Maybe Text)
, _gastpFunctionName :: !(Maybe Text)
, _gastpUserAccessLevel :: !(Maybe GoogleAppsScriptTypeProcessUserAccessLevel)
, _gastpProcessType :: !(Maybe GoogleAppsScriptTypeProcessProcessType)
, _gastpExecutingUser :: !(Maybe Text)
, _gastpDuration :: !(Maybe GDuration)
} deriving (Eq,Show,Data,Typeable,Generic)
googleAppsScriptTypeProcess
:: GoogleAppsScriptTypeProcess
googleAppsScriptTypeProcess =
GoogleAppsScriptTypeProcess'
{ _gastpProcessStatus = Nothing
, _gastpStartTime = Nothing
, _gastpProjectName = Nothing
, _gastpFunctionName = Nothing
, _gastpUserAccessLevel = Nothing
, _gastpProcessType = Nothing
, _gastpExecutingUser = Nothing
, _gastpDuration = Nothing
}
gastpProcessStatus :: Lens' GoogleAppsScriptTypeProcess (Maybe GoogleAppsScriptTypeProcessProcessStatus)
gastpProcessStatus
= lens _gastpProcessStatus
(\ s a -> s{_gastpProcessStatus = a})
gastpStartTime :: Lens' GoogleAppsScriptTypeProcess (Maybe UTCTime)
gastpStartTime
= lens _gastpStartTime
(\ s a -> s{_gastpStartTime = a})
. mapping _DateTime
gastpProjectName :: Lens' GoogleAppsScriptTypeProcess (Maybe Text)
gastpProjectName
= lens _gastpProjectName
(\ s a -> s{_gastpProjectName = a})
gastpFunctionName :: Lens' GoogleAppsScriptTypeProcess (Maybe Text)
gastpFunctionName
= lens _gastpFunctionName
(\ s a -> s{_gastpFunctionName = a})
gastpUserAccessLevel :: Lens' GoogleAppsScriptTypeProcess (Maybe GoogleAppsScriptTypeProcessUserAccessLevel)
gastpUserAccessLevel
= lens _gastpUserAccessLevel
(\ s a -> s{_gastpUserAccessLevel = a})
gastpProcessType :: Lens' GoogleAppsScriptTypeProcess (Maybe GoogleAppsScriptTypeProcessProcessType)
gastpProcessType
= lens _gastpProcessType
(\ s a -> s{_gastpProcessType = a})
gastpExecutingUser :: Lens' GoogleAppsScriptTypeProcess (Maybe Text)
gastpExecutingUser
= lens _gastpExecutingUser
(\ s a -> s{_gastpExecutingUser = a})
gastpDuration :: Lens' GoogleAppsScriptTypeProcess (Maybe Scientific)
gastpDuration
= lens _gastpDuration
(\ s a -> s{_gastpDuration = a})
. mapping _GDuration
instance FromJSON GoogleAppsScriptTypeProcess where
parseJSON
= withObject "GoogleAppsScriptTypeProcess"
(\ o ->
GoogleAppsScriptTypeProcess' <$>
(o .:? "processStatus") <*> (o .:? "startTime") <*>
(o .:? "projectName")
<*> (o .:? "functionName")
<*> (o .:? "userAccessLevel")
<*> (o .:? "processType")
<*> (o .:? "executingUser")
<*> (o .:? "duration"))
instance ToJSON GoogleAppsScriptTypeProcess where
toJSON GoogleAppsScriptTypeProcess'{..}
= object
(catMaybes
[("processStatus" .=) <$> _gastpProcessStatus,
("startTime" .=) <$> _gastpStartTime,
("projectName" .=) <$> _gastpProjectName,
("functionName" .=) <$> _gastpFunctionName,
("userAccessLevel" .=) <$> _gastpUserAccessLevel,
("processType" .=) <$> _gastpProcessType,
("executingUser" .=) <$> _gastpExecutingUser,
("duration" .=) <$> _gastpDuration])
data Project = Project'
{ _pCreator :: !(Maybe GoogleAppsScriptTypeUser)
, _pLastModifyUser :: !(Maybe GoogleAppsScriptTypeUser)
, _pUpdateTime :: !(Maybe DateTime')
, _pScriptId :: !(Maybe Text)
, _pTitle :: !(Maybe Text)
, _pParentId :: !(Maybe Text)
, _pCreateTime :: !(Maybe DateTime')
} deriving (Eq,Show,Data,Typeable,Generic)
project
:: Project
project =
Project'
{ _pCreator = Nothing
, _pLastModifyUser = Nothing
, _pUpdateTime = Nothing
, _pScriptId = Nothing
, _pTitle = Nothing
, _pParentId = Nothing
, _pCreateTime = Nothing
}
pCreator :: Lens' Project (Maybe GoogleAppsScriptTypeUser)
pCreator = lens _pCreator (\ s a -> s{_pCreator = a})
pLastModifyUser :: Lens' Project (Maybe GoogleAppsScriptTypeUser)
pLastModifyUser
= lens _pLastModifyUser
(\ s a -> s{_pLastModifyUser = a})
pUpdateTime :: Lens' Project (Maybe UTCTime)
pUpdateTime
= lens _pUpdateTime (\ s a -> s{_pUpdateTime = a}) .
mapping _DateTime
pScriptId :: Lens' Project (Maybe Text)
pScriptId
= lens _pScriptId (\ s a -> s{_pScriptId = a})
pTitle :: Lens' Project (Maybe Text)
pTitle = lens _pTitle (\ s a -> s{_pTitle = a})
pParentId :: Lens' Project (Maybe Text)
pParentId
= lens _pParentId (\ s a -> s{_pParentId = a})
pCreateTime :: Lens' Project (Maybe UTCTime)
pCreateTime
= lens _pCreateTime (\ s a -> s{_pCreateTime = a}) .
mapping _DateTime
instance FromJSON Project where
parseJSON
= withObject "Project"
(\ o ->
Project' <$>
(o .:? "creator") <*> (o .:? "lastModifyUser") <*>
(o .:? "updateTime")
<*> (o .:? "scriptId")
<*> (o .:? "title")
<*> (o .:? "parentId")
<*> (o .:? "createTime"))
instance ToJSON Project where
toJSON Project'{..}
= object
(catMaybes
[("creator" .=) <$> _pCreator,
("lastModifyUser" .=) <$> _pLastModifyUser,
("updateTime" .=) <$> _pUpdateTime,
("scriptId" .=) <$> _pScriptId,
("title" .=) <$> _pTitle,
("parentId" .=) <$> _pParentId,
("createTime" .=) <$> _pCreateTime])
data Operation = Operation'
{ _oDone :: !(Maybe Bool)
, _oError :: !(Maybe Status)
, _oResponse :: !(Maybe OperationResponse)
} deriving (Eq,Show,Data,Typeable,Generic)
operation
:: Operation
operation =
Operation'
{ _oDone = Nothing
, _oError = Nothing
, _oResponse = Nothing
}
oDone :: Lens' Operation (Maybe Bool)
oDone = lens _oDone (\ s a -> s{_oDone = a})
oError :: Lens' Operation (Maybe Status)
oError = lens _oError (\ s a -> s{_oError = a})
oResponse :: Lens' Operation (Maybe OperationResponse)
oResponse
= lens _oResponse (\ s a -> s{_oResponse = a})
instance FromJSON Operation where
parseJSON
= withObject "Operation"
(\ o ->
Operation' <$>
(o .:? "done") <*> (o .:? "error") <*>
(o .:? "response"))
instance ToJSON Operation where
toJSON Operation'{..}
= object
(catMaybes
[("done" .=) <$> _oDone, ("error" .=) <$> _oError,
("response" .=) <$> _oResponse])
data ListUserProcessesResponse = ListUserProcessesResponse'
{ _luprNextPageToken :: !(Maybe Text)
, _luprProcesses :: !(Maybe [GoogleAppsScriptTypeProcess])
} deriving (Eq,Show,Data,Typeable,Generic)
listUserProcessesResponse
:: ListUserProcessesResponse
listUserProcessesResponse =
ListUserProcessesResponse'
{ _luprNextPageToken = Nothing
, _luprProcesses = Nothing
}
luprNextPageToken :: Lens' ListUserProcessesResponse (Maybe Text)
luprNextPageToken
= lens _luprNextPageToken
(\ s a -> s{_luprNextPageToken = a})
luprProcesses :: Lens' ListUserProcessesResponse [GoogleAppsScriptTypeProcess]
luprProcesses
= lens _luprProcesses
(\ s a -> s{_luprProcesses = a})
. _Default
. _Coerce
instance FromJSON ListUserProcessesResponse where
parseJSON
= withObject "ListUserProcessesResponse"
(\ o ->
ListUserProcessesResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "processes" .!= mempty))
instance ToJSON ListUserProcessesResponse where
toJSON ListUserProcessesResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _luprNextPageToken,
("processes" .=) <$> _luprProcesses])
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 GoogleAppsScriptTypeUser = GoogleAppsScriptTypeUser'
{ _gastuEmail :: !(Maybe Text)
, _gastuPhotoURL :: !(Maybe Text)
, _gastuDomain :: !(Maybe Text)
, _gastuName :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
googleAppsScriptTypeUser
:: GoogleAppsScriptTypeUser
googleAppsScriptTypeUser =
GoogleAppsScriptTypeUser'
{ _gastuEmail = Nothing
, _gastuPhotoURL = Nothing
, _gastuDomain = Nothing
, _gastuName = Nothing
}
gastuEmail :: Lens' GoogleAppsScriptTypeUser (Maybe Text)
gastuEmail
= lens _gastuEmail (\ s a -> s{_gastuEmail = a})
gastuPhotoURL :: Lens' GoogleAppsScriptTypeUser (Maybe Text)
gastuPhotoURL
= lens _gastuPhotoURL
(\ s a -> s{_gastuPhotoURL = a})
gastuDomain :: Lens' GoogleAppsScriptTypeUser (Maybe Text)
gastuDomain
= lens _gastuDomain (\ s a -> s{_gastuDomain = a})
gastuName :: Lens' GoogleAppsScriptTypeUser (Maybe Text)
gastuName
= lens _gastuName (\ s a -> s{_gastuName = a})
instance FromJSON GoogleAppsScriptTypeUser where
parseJSON
= withObject "GoogleAppsScriptTypeUser"
(\ o ->
GoogleAppsScriptTypeUser' <$>
(o .:? "email") <*> (o .:? "photoUrl") <*>
(o .:? "domain")
<*> (o .:? "name"))
instance ToJSON GoogleAppsScriptTypeUser where
toJSON GoogleAppsScriptTypeUser'{..}
= object
(catMaybes
[("email" .=) <$> _gastuEmail,
("photoUrl" .=) <$> _gastuPhotoURL,
("domain" .=) <$> _gastuDomain,
("name" .=) <$> _gastuName])
data EntryPoint = EntryPoint'
{ _epExecutionAPI :: !(Maybe GoogleAppsScriptTypeExecutionAPIEntryPoint)
, _epAddOn :: !(Maybe GoogleAppsScriptTypeAddOnEntryPoint)
, _epEntryPointType :: !(Maybe EntryPointEntryPointType)
, _epWebApp :: !(Maybe GoogleAppsScriptTypeWebAppEntryPoint)
} deriving (Eq,Show,Data,Typeable,Generic)
entryPoint
:: EntryPoint
entryPoint =
EntryPoint'
{ _epExecutionAPI = Nothing
, _epAddOn = Nothing
, _epEntryPointType = Nothing
, _epWebApp = Nothing
}
epExecutionAPI :: Lens' EntryPoint (Maybe GoogleAppsScriptTypeExecutionAPIEntryPoint)
epExecutionAPI
= lens _epExecutionAPI
(\ s a -> s{_epExecutionAPI = a})
epAddOn :: Lens' EntryPoint (Maybe GoogleAppsScriptTypeAddOnEntryPoint)
epAddOn = lens _epAddOn (\ s a -> s{_epAddOn = a})
epEntryPointType :: Lens' EntryPoint (Maybe EntryPointEntryPointType)
epEntryPointType
= lens _epEntryPointType
(\ s a -> s{_epEntryPointType = a})
epWebApp :: Lens' EntryPoint (Maybe GoogleAppsScriptTypeWebAppEntryPoint)
epWebApp = lens _epWebApp (\ s a -> s{_epWebApp = a})
instance FromJSON EntryPoint where
parseJSON
= withObject "EntryPoint"
(\ o ->
EntryPoint' <$>
(o .:? "executionApi") <*> (o .:? "addOn") <*>
(o .:? "entryPointType")
<*> (o .:? "webApp"))
instance ToJSON EntryPoint where
toJSON EntryPoint'{..}
= object
(catMaybes
[("executionApi" .=) <$> _epExecutionAPI,
("addOn" .=) <$> _epAddOn,
("entryPointType" .=) <$> _epEntryPointType,
("webApp" .=) <$> _epWebApp])
data ListVersionsResponse = ListVersionsResponse'
{ _lvrNextPageToken :: !(Maybe Text)
, _lvrVersions :: !(Maybe [Version])
} deriving (Eq,Show,Data,Typeable,Generic)
listVersionsResponse
:: ListVersionsResponse
listVersionsResponse =
ListVersionsResponse'
{ _lvrNextPageToken = Nothing
, _lvrVersions = Nothing
}
lvrNextPageToken :: Lens' ListVersionsResponse (Maybe Text)
lvrNextPageToken
= lens _lvrNextPageToken
(\ s a -> s{_lvrNextPageToken = a})
lvrVersions :: Lens' ListVersionsResponse [Version]
lvrVersions
= lens _lvrVersions (\ s a -> s{_lvrVersions = a}) .
_Default
. _Coerce
instance FromJSON ListVersionsResponse where
parseJSON
= withObject "ListVersionsResponse"
(\ o ->
ListVersionsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "versions" .!= mempty))
instance ToJSON ListVersionsResponse where
toJSON ListVersionsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lvrNextPageToken,
("versions" .=) <$> _lvrVersions])
data ExecutionRequest = ExecutionRequest'
{ _erFunction :: !(Maybe Text)
, _erSessionState :: !(Maybe Text)
, _erDevMode :: !(Maybe Bool)
, _erParameters :: !(Maybe [JSONValue])
} deriving (Eq,Show,Data,Typeable,Generic)
executionRequest
:: ExecutionRequest
executionRequest =
ExecutionRequest'
{ _erFunction = Nothing
, _erSessionState = Nothing
, _erDevMode = Nothing
, _erParameters = Nothing
}
erFunction :: Lens' ExecutionRequest (Maybe Text)
erFunction
= lens _erFunction (\ s a -> s{_erFunction = a})
erSessionState :: Lens' ExecutionRequest (Maybe Text)
erSessionState
= lens _erSessionState
(\ s a -> s{_erSessionState = a})
erDevMode :: Lens' ExecutionRequest (Maybe Bool)
erDevMode
= lens _erDevMode (\ s a -> s{_erDevMode = a})
erParameters :: Lens' ExecutionRequest [JSONValue]
erParameters
= lens _erParameters (\ s a -> s{_erParameters = a})
. _Default
. _Coerce
instance FromJSON ExecutionRequest where
parseJSON
= withObject "ExecutionRequest"
(\ o ->
ExecutionRequest' <$>
(o .:? "function") <*> (o .:? "sessionState") <*>
(o .:? "devMode")
<*> (o .:? "parameters" .!= mempty))
instance ToJSON ExecutionRequest where
toJSON ExecutionRequest'{..}
= object
(catMaybes
[("function" .=) <$> _erFunction,
("sessionState" .=) <$> _erSessionState,
("devMode" .=) <$> _erDevMode,
("parameters" .=) <$> _erParameters])
data ListScriptProcessesResponse = ListScriptProcessesResponse'
{ _lsprNextPageToken :: !(Maybe Text)
, _lsprProcesses :: !(Maybe [GoogleAppsScriptTypeProcess])
} deriving (Eq,Show,Data,Typeable,Generic)
listScriptProcessesResponse
:: ListScriptProcessesResponse
listScriptProcessesResponse =
ListScriptProcessesResponse'
{ _lsprNextPageToken = Nothing
, _lsprProcesses = Nothing
}
lsprNextPageToken :: Lens' ListScriptProcessesResponse (Maybe Text)
lsprNextPageToken
= lens _lsprNextPageToken
(\ s a -> s{_lsprNextPageToken = a})
lsprProcesses :: Lens' ListScriptProcessesResponse [GoogleAppsScriptTypeProcess]
lsprProcesses
= lens _lsprProcesses
(\ s a -> s{_lsprProcesses = a})
. _Default
. _Coerce
instance FromJSON ListScriptProcessesResponse where
parseJSON
= withObject "ListScriptProcessesResponse"
(\ o ->
ListScriptProcessesResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "processes" .!= mempty))
instance ToJSON ListScriptProcessesResponse where
toJSON ListScriptProcessesResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lsprNextPageToken,
("processes" .=) <$> _lsprProcesses])
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 ScriptStackTraceElement = ScriptStackTraceElement'
{ _ssteFunction :: !(Maybe Text)
, _ssteLineNumber :: !(Maybe (Textual Int32))
} deriving (Eq,Show,Data,Typeable,Generic)
scriptStackTraceElement
:: ScriptStackTraceElement
scriptStackTraceElement =
ScriptStackTraceElement'
{ _ssteFunction = Nothing
, _ssteLineNumber = Nothing
}
ssteFunction :: Lens' ScriptStackTraceElement (Maybe Text)
ssteFunction
= lens _ssteFunction (\ s a -> s{_ssteFunction = a})
ssteLineNumber :: Lens' ScriptStackTraceElement (Maybe Int32)
ssteLineNumber
= lens _ssteLineNumber
(\ s a -> s{_ssteLineNumber = a})
. mapping _Coerce
instance FromJSON ScriptStackTraceElement where
parseJSON
= withObject "ScriptStackTraceElement"
(\ o ->
ScriptStackTraceElement' <$>
(o .:? "function") <*> (o .:? "lineNumber"))
instance ToJSON ScriptStackTraceElement where
toJSON ScriptStackTraceElement'{..}
= object
(catMaybes
[("function" .=) <$> _ssteFunction,
("lineNumber" .=) <$> _ssteLineNumber])
data Content = Content'
{ _cScriptId :: !(Maybe Text)
, _cFiles :: !(Maybe [File])
} deriving (Eq,Show,Data,Typeable,Generic)
content
:: Content
content =
Content'
{ _cScriptId = Nothing
, _cFiles = Nothing
}
cScriptId :: Lens' Content (Maybe Text)
cScriptId
= lens _cScriptId (\ s a -> s{_cScriptId = a})
cFiles :: Lens' Content [File]
cFiles
= lens _cFiles (\ s a -> s{_cFiles = a}) . _Default .
_Coerce
instance FromJSON Content where
parseJSON
= withObject "Content"
(\ o ->
Content' <$>
(o .:? "scriptId") <*> (o .:? "files" .!= mempty))
instance ToJSON Content where
toJSON Content'{..}
= object
(catMaybes
[("scriptId" .=) <$> _cScriptId,
("files" .=) <$> _cFiles])
data MetricsValue = MetricsValue'
{ _mvStartTime :: !(Maybe DateTime')
, _mvValue :: !(Maybe (Textual Word64))
, _mvEndTime :: !(Maybe DateTime')
} deriving (Eq,Show,Data,Typeable,Generic)
metricsValue
:: MetricsValue
metricsValue =
MetricsValue'
{ _mvStartTime = Nothing
, _mvValue = Nothing
, _mvEndTime = Nothing
}
mvStartTime :: Lens' MetricsValue (Maybe UTCTime)
mvStartTime
= lens _mvStartTime (\ s a -> s{_mvStartTime = a}) .
mapping _DateTime
mvValue :: Lens' MetricsValue (Maybe Word64)
mvValue
= lens _mvValue (\ s a -> s{_mvValue = a}) .
mapping _Coerce
mvEndTime :: Lens' MetricsValue (Maybe UTCTime)
mvEndTime
= lens _mvEndTime (\ s a -> s{_mvEndTime = a}) .
mapping _DateTime
instance FromJSON MetricsValue where
parseJSON
= withObject "MetricsValue"
(\ o ->
MetricsValue' <$>
(o .:? "startTime") <*> (o .:? "value") <*>
(o .:? "endTime"))
instance ToJSON MetricsValue where
toJSON MetricsValue'{..}
= object
(catMaybes
[("startTime" .=) <$> _mvStartTime,
("value" .=) <$> _mvValue,
("endTime" .=) <$> _mvEndTime])
data GoogleAppsScriptTypeAddOnEntryPoint = GoogleAppsScriptTypeAddOnEntryPoint'
{ _gastaoepPostInstallTipURL :: !(Maybe Text)
, _gastaoepAddOnType :: !(Maybe GoogleAppsScriptTypeAddOnEntryPointAddOnType)
, _gastaoepReportIssueURL :: !(Maybe Text)
, _gastaoepHelpURL :: !(Maybe Text)
, _gastaoepTitle :: !(Maybe Text)
, _gastaoepDescription :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
googleAppsScriptTypeAddOnEntryPoint
:: GoogleAppsScriptTypeAddOnEntryPoint
googleAppsScriptTypeAddOnEntryPoint =
GoogleAppsScriptTypeAddOnEntryPoint'
{ _gastaoepPostInstallTipURL = Nothing
, _gastaoepAddOnType = Nothing
, _gastaoepReportIssueURL = Nothing
, _gastaoepHelpURL = Nothing
, _gastaoepTitle = Nothing
, _gastaoepDescription = Nothing
}
gastaoepPostInstallTipURL :: Lens' GoogleAppsScriptTypeAddOnEntryPoint (Maybe Text)
gastaoepPostInstallTipURL
= lens _gastaoepPostInstallTipURL
(\ s a -> s{_gastaoepPostInstallTipURL = a})
gastaoepAddOnType :: Lens' GoogleAppsScriptTypeAddOnEntryPoint (Maybe GoogleAppsScriptTypeAddOnEntryPointAddOnType)
gastaoepAddOnType
= lens _gastaoepAddOnType
(\ s a -> s{_gastaoepAddOnType = a})
gastaoepReportIssueURL :: Lens' GoogleAppsScriptTypeAddOnEntryPoint (Maybe Text)
gastaoepReportIssueURL
= lens _gastaoepReportIssueURL
(\ s a -> s{_gastaoepReportIssueURL = a})
gastaoepHelpURL :: Lens' GoogleAppsScriptTypeAddOnEntryPoint (Maybe Text)
gastaoepHelpURL
= lens _gastaoepHelpURL
(\ s a -> s{_gastaoepHelpURL = a})
gastaoepTitle :: Lens' GoogleAppsScriptTypeAddOnEntryPoint (Maybe Text)
gastaoepTitle
= lens _gastaoepTitle
(\ s a -> s{_gastaoepTitle = a})
gastaoepDescription :: Lens' GoogleAppsScriptTypeAddOnEntryPoint (Maybe Text)
gastaoepDescription
= lens _gastaoepDescription
(\ s a -> s{_gastaoepDescription = a})
instance FromJSON GoogleAppsScriptTypeAddOnEntryPoint
where
parseJSON
= withObject "GoogleAppsScriptTypeAddOnEntryPoint"
(\ o ->
GoogleAppsScriptTypeAddOnEntryPoint' <$>
(o .:? "postInstallTipUrl") <*> (o .:? "addOnType")
<*> (o .:? "reportIssueUrl")
<*> (o .:? "helpUrl")
<*> (o .:? "title")
<*> (o .:? "description"))
instance ToJSON GoogleAppsScriptTypeAddOnEntryPoint
where
toJSON GoogleAppsScriptTypeAddOnEntryPoint'{..}
= object
(catMaybes
[("postInstallTipUrl" .=) <$>
_gastaoepPostInstallTipURL,
("addOnType" .=) <$> _gastaoepAddOnType,
("reportIssueUrl" .=) <$> _gastaoepReportIssueURL,
("helpUrl" .=) <$> _gastaoepHelpURL,
("title" .=) <$> _gastaoepTitle,
("description" .=) <$> _gastaoepDescription])
data GoogleAppsScriptTypeWebAppConfig = GoogleAppsScriptTypeWebAppConfig'
{ _gastwacAccess :: !(Maybe GoogleAppsScriptTypeWebAppConfigAccess)
, _gastwacExecuteAs :: !(Maybe GoogleAppsScriptTypeWebAppConfigExecuteAs)
} deriving (Eq,Show,Data,Typeable,Generic)
googleAppsScriptTypeWebAppConfig
:: GoogleAppsScriptTypeWebAppConfig
googleAppsScriptTypeWebAppConfig =
GoogleAppsScriptTypeWebAppConfig'
{ _gastwacAccess = Nothing
, _gastwacExecuteAs = Nothing
}
gastwacAccess :: Lens' GoogleAppsScriptTypeWebAppConfig (Maybe GoogleAppsScriptTypeWebAppConfigAccess)
gastwacAccess
= lens _gastwacAccess
(\ s a -> s{_gastwacAccess = a})
gastwacExecuteAs :: Lens' GoogleAppsScriptTypeWebAppConfig (Maybe GoogleAppsScriptTypeWebAppConfigExecuteAs)
gastwacExecuteAs
= lens _gastwacExecuteAs
(\ s a -> s{_gastwacExecuteAs = a})
instance FromJSON GoogleAppsScriptTypeWebAppConfig
where
parseJSON
= withObject "GoogleAppsScriptTypeWebAppConfig"
(\ o ->
GoogleAppsScriptTypeWebAppConfig' <$>
(o .:? "access") <*> (o .:? "executeAs"))
instance ToJSON GoogleAppsScriptTypeWebAppConfig
where
toJSON GoogleAppsScriptTypeWebAppConfig'{..}
= object
(catMaybes
[("access" .=) <$> _gastwacAccess,
("executeAs" .=) <$> _gastwacExecuteAs])
data Version = Version'
{ _vVersionNumber :: !(Maybe (Textual Int32))
, _vScriptId :: !(Maybe Text)
, _vDescription :: !(Maybe Text)
, _vCreateTime :: !(Maybe DateTime')
} deriving (Eq,Show,Data,Typeable,Generic)
version
:: Version
version =
Version'
{ _vVersionNumber = Nothing
, _vScriptId = Nothing
, _vDescription = Nothing
, _vCreateTime = Nothing
}
vVersionNumber :: Lens' Version (Maybe Int32)
vVersionNumber
= lens _vVersionNumber
(\ s a -> s{_vVersionNumber = a})
. mapping _Coerce
vScriptId :: Lens' Version (Maybe Text)
vScriptId
= lens _vScriptId (\ s a -> s{_vScriptId = a})
vDescription :: Lens' Version (Maybe Text)
vDescription
= lens _vDescription (\ s a -> s{_vDescription = a})
vCreateTime :: Lens' Version (Maybe UTCTime)
vCreateTime
= lens _vCreateTime (\ s a -> s{_vCreateTime = a}) .
mapping _DateTime
instance FromJSON Version where
parseJSON
= withObject "Version"
(\ o ->
Version' <$>
(o .:? "versionNumber") <*> (o .:? "scriptId") <*>
(o .:? "description")
<*> (o .:? "createTime"))
instance ToJSON Version where
toJSON Version'{..}
= object
(catMaybes
[("versionNumber" .=) <$> _vVersionNumber,
("scriptId" .=) <$> _vScriptId,
("description" .=) <$> _vDescription,
("createTime" .=) <$> _vCreateTime])
data ExecutionError = ExecutionError'
{ _eeScriptStackTraceElements :: !(Maybe [ScriptStackTraceElement])
, _eeErrorType :: !(Maybe Text)
, _eeErrorMessage :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
executionError
:: ExecutionError
executionError =
ExecutionError'
{ _eeScriptStackTraceElements = Nothing
, _eeErrorType = Nothing
, _eeErrorMessage = Nothing
}
eeScriptStackTraceElements :: Lens' ExecutionError [ScriptStackTraceElement]
eeScriptStackTraceElements
= lens _eeScriptStackTraceElements
(\ s a -> s{_eeScriptStackTraceElements = a})
. _Default
. _Coerce
eeErrorType :: Lens' ExecutionError (Maybe Text)
eeErrorType
= lens _eeErrorType (\ s a -> s{_eeErrorType = a})
eeErrorMessage :: Lens' ExecutionError (Maybe Text)
eeErrorMessage
= lens _eeErrorMessage
(\ s a -> s{_eeErrorMessage = a})
instance FromJSON ExecutionError where
parseJSON
= withObject "ExecutionError"
(\ o ->
ExecutionError' <$>
(o .:? "scriptStackTraceElements" .!= mempty) <*>
(o .:? "errorType")
<*> (o .:? "errorMessage"))
instance ToJSON ExecutionError where
toJSON ExecutionError'{..}
= object
(catMaybes
[("scriptStackTraceElements" .=) <$>
_eeScriptStackTraceElements,
("errorType" .=) <$> _eeErrorType,
("errorMessage" .=) <$> _eeErrorMessage])
data GoogleAppsScriptTypeWebAppEntryPoint = GoogleAppsScriptTypeWebAppEntryPoint'
{ _gastwaepEntryPointConfig :: !(Maybe GoogleAppsScriptTypeWebAppConfig)
, _gastwaepURL :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
googleAppsScriptTypeWebAppEntryPoint
:: GoogleAppsScriptTypeWebAppEntryPoint
googleAppsScriptTypeWebAppEntryPoint =
GoogleAppsScriptTypeWebAppEntryPoint'
{ _gastwaepEntryPointConfig = Nothing
, _gastwaepURL = Nothing
}
gastwaepEntryPointConfig :: Lens' GoogleAppsScriptTypeWebAppEntryPoint (Maybe GoogleAppsScriptTypeWebAppConfig)
gastwaepEntryPointConfig
= lens _gastwaepEntryPointConfig
(\ s a -> s{_gastwaepEntryPointConfig = a})
gastwaepURL :: Lens' GoogleAppsScriptTypeWebAppEntryPoint (Maybe Text)
gastwaepURL
= lens _gastwaepURL (\ s a -> s{_gastwaepURL = a})
instance FromJSON
GoogleAppsScriptTypeWebAppEntryPoint where
parseJSON
= withObject "GoogleAppsScriptTypeWebAppEntryPoint"
(\ o ->
GoogleAppsScriptTypeWebAppEntryPoint' <$>
(o .:? "entryPointConfig") <*> (o .:? "url"))
instance ToJSON GoogleAppsScriptTypeWebAppEntryPoint
where
toJSON GoogleAppsScriptTypeWebAppEntryPoint'{..}
= object
(catMaybes
[("entryPointConfig" .=) <$>
_gastwaepEntryPointConfig,
("url" .=) <$> _gastwaepURL])
data CreateProjectRequest = CreateProjectRequest'
{ _cprTitle :: !(Maybe Text)
, _cprParentId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
createProjectRequest
:: CreateProjectRequest
createProjectRequest =
CreateProjectRequest'
{ _cprTitle = Nothing
, _cprParentId = Nothing
}
cprTitle :: Lens' CreateProjectRequest (Maybe Text)
cprTitle = lens _cprTitle (\ s a -> s{_cprTitle = a})
cprParentId :: Lens' CreateProjectRequest (Maybe Text)
cprParentId
= lens _cprParentId (\ s a -> s{_cprParentId = a})
instance FromJSON CreateProjectRequest where
parseJSON
= withObject "CreateProjectRequest"
(\ o ->
CreateProjectRequest' <$>
(o .:? "title") <*> (o .:? "parentId"))
instance ToJSON CreateProjectRequest where
toJSON CreateProjectRequest'{..}
= object
(catMaybes
[("title" .=) <$> _cprTitle,
("parentId" .=) <$> _cprParentId])
data DeploymentConfig = DeploymentConfig'
{ _dcVersionNumber :: !(Maybe (Textual Int32))
, _dcScriptId :: !(Maybe Text)
, _dcManifestFileName :: !(Maybe Text)
, _dcDescription :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
deploymentConfig
:: DeploymentConfig
deploymentConfig =
DeploymentConfig'
{ _dcVersionNumber = Nothing
, _dcScriptId = Nothing
, _dcManifestFileName = Nothing
, _dcDescription = Nothing
}
dcVersionNumber :: Lens' DeploymentConfig (Maybe Int32)
dcVersionNumber
= lens _dcVersionNumber
(\ s a -> s{_dcVersionNumber = a})
. mapping _Coerce
dcScriptId :: Lens' DeploymentConfig (Maybe Text)
dcScriptId
= lens _dcScriptId (\ s a -> s{_dcScriptId = a})
dcManifestFileName :: Lens' DeploymentConfig (Maybe Text)
dcManifestFileName
= lens _dcManifestFileName
(\ s a -> s{_dcManifestFileName = a})
dcDescription :: Lens' DeploymentConfig (Maybe Text)
dcDescription
= lens _dcDescription
(\ s a -> s{_dcDescription = a})
instance FromJSON DeploymentConfig where
parseJSON
= withObject "DeploymentConfig"
(\ o ->
DeploymentConfig' <$>
(o .:? "versionNumber") <*> (o .:? "scriptId") <*>
(o .:? "manifestFileName")
<*> (o .:? "description"))
instance ToJSON DeploymentConfig where
toJSON DeploymentConfig'{..}
= object
(catMaybes
[("versionNumber" .=) <$> _dcVersionNumber,
("scriptId" .=) <$> _dcScriptId,
("manifestFileName" .=) <$> _dcManifestFileName,
("description" .=) <$> _dcDescription])
data ListDeploymentsResponse = ListDeploymentsResponse'
{ _ldrNextPageToken :: !(Maybe Text)
, _ldrDeployments :: !(Maybe [Deployment])
} deriving (Eq,Show,Data,Typeable,Generic)
listDeploymentsResponse
:: ListDeploymentsResponse
listDeploymentsResponse =
ListDeploymentsResponse'
{ _ldrNextPageToken = Nothing
, _ldrDeployments = Nothing
}
ldrNextPageToken :: Lens' ListDeploymentsResponse (Maybe Text)
ldrNextPageToken
= lens _ldrNextPageToken
(\ s a -> s{_ldrNextPageToken = a})
ldrDeployments :: Lens' ListDeploymentsResponse [Deployment]
ldrDeployments
= lens _ldrDeployments
(\ s a -> s{_ldrDeployments = a})
. _Default
. _Coerce
instance FromJSON ListDeploymentsResponse where
parseJSON
= withObject "ListDeploymentsResponse"
(\ o ->
ListDeploymentsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "deployments" .!= mempty))
instance ToJSON ListDeploymentsResponse where
toJSON ListDeploymentsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _ldrNextPageToken,
("deployments" .=) <$> _ldrDeployments])
newtype GoogleAppsScriptTypeFunction = GoogleAppsScriptTypeFunction'
{ _gastfName :: Maybe Text
} deriving (Eq,Show,Data,Typeable,Generic)
googleAppsScriptTypeFunction
:: GoogleAppsScriptTypeFunction
googleAppsScriptTypeFunction =
GoogleAppsScriptTypeFunction'
{ _gastfName = Nothing
}
gastfName :: Lens' GoogleAppsScriptTypeFunction (Maybe Text)
gastfName
= lens _gastfName (\ s a -> s{_gastfName = a})
instance FromJSON GoogleAppsScriptTypeFunction where
parseJSON
= withObject "GoogleAppsScriptTypeFunction"
(\ o ->
GoogleAppsScriptTypeFunction' <$> (o .:? "name"))
instance ToJSON GoogleAppsScriptTypeFunction where
toJSON GoogleAppsScriptTypeFunction'{..}
= object (catMaybes [("name" .=) <$> _gastfName])
data File = File'
{ _fFunctionSet :: !(Maybe GoogleAppsScriptTypeFunctionSet)
, _fLastModifyUser :: !(Maybe GoogleAppsScriptTypeUser)
, _fUpdateTime :: !(Maybe DateTime')
, _fName :: !(Maybe Text)
, _fSource :: !(Maybe Text)
, _fType :: !(Maybe FileType)
, _fCreateTime :: !(Maybe DateTime')
} deriving (Eq,Show,Data,Typeable,Generic)
file
:: File
file =
File'
{ _fFunctionSet = Nothing
, _fLastModifyUser = Nothing
, _fUpdateTime = Nothing
, _fName = Nothing
, _fSource = Nothing
, _fType = Nothing
, _fCreateTime = Nothing
}
fFunctionSet :: Lens' File (Maybe GoogleAppsScriptTypeFunctionSet)
fFunctionSet
= lens _fFunctionSet (\ s a -> s{_fFunctionSet = a})
fLastModifyUser :: Lens' File (Maybe GoogleAppsScriptTypeUser)
fLastModifyUser
= lens _fLastModifyUser
(\ s a -> s{_fLastModifyUser = a})
fUpdateTime :: Lens' File (Maybe UTCTime)
fUpdateTime
= lens _fUpdateTime (\ s a -> s{_fUpdateTime = a}) .
mapping _DateTime
fName :: Lens' File (Maybe Text)
fName = lens _fName (\ s a -> s{_fName = a})
fSource :: Lens' File (Maybe Text)
fSource = lens _fSource (\ s a -> s{_fSource = a})
fType :: Lens' File (Maybe FileType)
fType = lens _fType (\ s a -> s{_fType = a})
fCreateTime :: Lens' File (Maybe UTCTime)
fCreateTime
= lens _fCreateTime (\ s a -> s{_fCreateTime = a}) .
mapping _DateTime
instance FromJSON File where
parseJSON
= withObject "File"
(\ o ->
File' <$>
(o .:? "functionSet") <*> (o .:? "lastModifyUser")
<*> (o .:? "updateTime")
<*> (o .:? "name")
<*> (o .:? "source")
<*> (o .:? "type")
<*> (o .:? "createTime"))
instance ToJSON File where
toJSON File'{..}
= object
(catMaybes
[("functionSet" .=) <$> _fFunctionSet,
("lastModifyUser" .=) <$> _fLastModifyUser,
("updateTime" .=) <$> _fUpdateTime,
("name" .=) <$> _fName, ("source" .=) <$> _fSource,
("type" .=) <$> _fType,
("createTime" .=) <$> _fCreateTime])
newtype GoogleAppsScriptTypeExecutionAPIEntryPoint = GoogleAppsScriptTypeExecutionAPIEntryPoint'
{ _gasteaepEntryPointConfig :: Maybe GoogleAppsScriptTypeExecutionAPIConfig
} deriving (Eq,Show,Data,Typeable,Generic)
googleAppsScriptTypeExecutionAPIEntryPoint
:: GoogleAppsScriptTypeExecutionAPIEntryPoint
googleAppsScriptTypeExecutionAPIEntryPoint =
GoogleAppsScriptTypeExecutionAPIEntryPoint'
{ _gasteaepEntryPointConfig = Nothing
}
gasteaepEntryPointConfig :: Lens' GoogleAppsScriptTypeExecutionAPIEntryPoint (Maybe GoogleAppsScriptTypeExecutionAPIConfig)
gasteaepEntryPointConfig
= lens _gasteaepEntryPointConfig
(\ s a -> s{_gasteaepEntryPointConfig = a})
instance FromJSON
GoogleAppsScriptTypeExecutionAPIEntryPoint where
parseJSON
= withObject
"GoogleAppsScriptTypeExecutionAPIEntryPoint"
(\ o ->
GoogleAppsScriptTypeExecutionAPIEntryPoint' <$>
(o .:? "entryPointConfig"))
instance ToJSON
GoogleAppsScriptTypeExecutionAPIEntryPoint where
toJSON
GoogleAppsScriptTypeExecutionAPIEntryPoint'{..}
= object
(catMaybes
[("entryPointConfig" .=) <$>
_gasteaepEntryPointConfig])
newtype OperationResponse = OperationResponse'
{ _orAddtional :: HashMap Text JSONValue
} deriving (Eq,Show,Data,Typeable,Generic)
operationResponse
:: HashMap Text JSONValue
-> OperationResponse
operationResponse pOrAddtional_ =
OperationResponse'
{ _orAddtional = _Coerce # pOrAddtional_
}
orAddtional :: Lens' OperationResponse (HashMap Text JSONValue)
orAddtional
= lens _orAddtional (\ s a -> s{_orAddtional = a}) .
_Coerce
instance FromJSON OperationResponse where
parseJSON
= withObject "OperationResponse"
(\ o -> OperationResponse' <$> (parseJSONObject o))
instance ToJSON OperationResponse where
toJSON = toJSON . _orAddtional
newtype ExecutionResponse = ExecutionResponse'
{ _erResult :: Maybe JSONValue
} deriving (Eq,Show,Data,Typeable,Generic)
executionResponse
:: ExecutionResponse
executionResponse =
ExecutionResponse'
{ _erResult = Nothing
}
erResult :: Lens' ExecutionResponse (Maybe JSONValue)
erResult = lens _erResult (\ s a -> s{_erResult = a})
instance FromJSON ExecutionResponse where
parseJSON
= withObject "ExecutionResponse"
(\ o -> ExecutionResponse' <$> (o .:? "result"))
instance ToJSON ExecutionResponse where
toJSON ExecutionResponse'{..}
= object (catMaybes [("result" .=) <$> _erResult])
data Deployment = Deployment'
{ _dDeploymentId :: !(Maybe Text)
, _dUpdateTime :: !(Maybe DateTime')
, _dEntryPoints :: !(Maybe [EntryPoint])
, _dDeploymentConfig :: !(Maybe DeploymentConfig)
} deriving (Eq,Show,Data,Typeable,Generic)
deployment
:: Deployment
deployment =
Deployment'
{ _dDeploymentId = Nothing
, _dUpdateTime = Nothing
, _dEntryPoints = Nothing
, _dDeploymentConfig = Nothing
}
dDeploymentId :: Lens' Deployment (Maybe Text)
dDeploymentId
= lens _dDeploymentId
(\ s a -> s{_dDeploymentId = a})
dUpdateTime :: Lens' Deployment (Maybe UTCTime)
dUpdateTime
= lens _dUpdateTime (\ s a -> s{_dUpdateTime = a}) .
mapping _DateTime
dEntryPoints :: Lens' Deployment [EntryPoint]
dEntryPoints
= lens _dEntryPoints (\ s a -> s{_dEntryPoints = a})
. _Default
. _Coerce
dDeploymentConfig :: Lens' Deployment (Maybe DeploymentConfig)
dDeploymentConfig
= lens _dDeploymentConfig
(\ s a -> s{_dDeploymentConfig = a})
instance FromJSON Deployment where
parseJSON
= withObject "Deployment"
(\ o ->
Deployment' <$>
(o .:? "deploymentId") <*> (o .:? "updateTime") <*>
(o .:? "entryPoints" .!= mempty)
<*> (o .:? "deploymentConfig"))
instance ToJSON Deployment where
toJSON Deployment'{..}
= object
(catMaybes
[("deploymentId" .=) <$> _dDeploymentId,
("updateTime" .=) <$> _dUpdateTime,
("entryPoints" .=) <$> _dEntryPoints,
("deploymentConfig" .=) <$> _dDeploymentConfig])
newtype UpdateDeploymentRequest = UpdateDeploymentRequest'
{ _udrDeploymentConfig :: Maybe DeploymentConfig
} deriving (Eq,Show,Data,Typeable,Generic)
updateDeploymentRequest
:: UpdateDeploymentRequest
updateDeploymentRequest =
UpdateDeploymentRequest'
{ _udrDeploymentConfig = Nothing
}
udrDeploymentConfig :: Lens' UpdateDeploymentRequest (Maybe DeploymentConfig)
udrDeploymentConfig
= lens _udrDeploymentConfig
(\ s a -> s{_udrDeploymentConfig = a})
instance FromJSON UpdateDeploymentRequest where
parseJSON
= withObject "UpdateDeploymentRequest"
(\ o ->
UpdateDeploymentRequest' <$>
(o .:? "deploymentConfig"))
instance ToJSON UpdateDeploymentRequest where
toJSON UpdateDeploymentRequest'{..}
= object
(catMaybes
[("deploymentConfig" .=) <$> _udrDeploymentConfig])