{-# 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.ContainerBuilder.Types.Product where
import Network.Google.ContainerBuilder.Types.Sum
import Network.Google.Prelude
data BuildStep = BuildStep'
{ _bsDir :: !(Maybe Text)
, _bsArgs :: !(Maybe [Text])
, _bsEnv :: !(Maybe [Text])
, _bsWaitFor :: !(Maybe [Text])
, _bsName :: !(Maybe Text)
, _bsId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
buildStep
:: BuildStep
buildStep =
BuildStep'
{ _bsDir = Nothing
, _bsArgs = Nothing
, _bsEnv = Nothing
, _bsWaitFor = Nothing
, _bsName = Nothing
, _bsId = Nothing
}
bsDir :: Lens' BuildStep (Maybe Text)
bsDir = lens _bsDir (\ s a -> s{_bsDir = a})
bsArgs :: Lens' BuildStep [Text]
bsArgs
= lens _bsArgs (\ s a -> s{_bsArgs = a}) . _Default .
_Coerce
bsEnv :: Lens' BuildStep [Text]
bsEnv
= lens _bsEnv (\ s a -> s{_bsEnv = a}) . _Default .
_Coerce
bsWaitFor :: Lens' BuildStep [Text]
bsWaitFor
= lens _bsWaitFor (\ s a -> s{_bsWaitFor = a}) .
_Default
. _Coerce
bsName :: Lens' BuildStep (Maybe Text)
bsName = lens _bsName (\ s a -> s{_bsName = a})
bsId :: Lens' BuildStep (Maybe Text)
bsId = lens _bsId (\ s a -> s{_bsId = a})
instance FromJSON BuildStep where
parseJSON
= withObject "BuildStep"
(\ o ->
BuildStep' <$>
(o .:? "dir") <*> (o .:? "args" .!= mempty) <*>
(o .:? "env" .!= mempty)
<*> (o .:? "waitFor" .!= mempty)
<*> (o .:? "name")
<*> (o .:? "id"))
instance ToJSON BuildStep where
toJSON BuildStep'{..}
= object
(catMaybes
[("dir" .=) <$> _bsDir, ("args" .=) <$> _bsArgs,
("env" .=) <$> _bsEnv, ("waitFor" .=) <$> _bsWaitFor,
("name" .=) <$> _bsName, ("id" .=) <$> _bsId])
data SourceProvenance = SourceProvenance'
{ _spResolvedRepoSource :: !(Maybe RepoSource)
, _spResolvedStorageSource :: !(Maybe StorageSource)
, _spFileHashes :: !(Maybe SourceProvenanceFileHashes)
} deriving (Eq,Show,Data,Typeable,Generic)
sourceProvenance
:: SourceProvenance
sourceProvenance =
SourceProvenance'
{ _spResolvedRepoSource = Nothing
, _spResolvedStorageSource = Nothing
, _spFileHashes = Nothing
}
spResolvedRepoSource :: Lens' SourceProvenance (Maybe RepoSource)
spResolvedRepoSource
= lens _spResolvedRepoSource
(\ s a -> s{_spResolvedRepoSource = a})
spResolvedStorageSource :: Lens' SourceProvenance (Maybe StorageSource)
spResolvedStorageSource
= lens _spResolvedStorageSource
(\ s a -> s{_spResolvedStorageSource = a})
spFileHashes :: Lens' SourceProvenance (Maybe SourceProvenanceFileHashes)
spFileHashes
= lens _spFileHashes (\ s a -> s{_spFileHashes = a})
instance FromJSON SourceProvenance where
parseJSON
= withObject "SourceProvenance"
(\ o ->
SourceProvenance' <$>
(o .:? "resolvedRepoSource") <*>
(o .:? "resolvedStorageSource")
<*> (o .:? "fileHashes"))
instance ToJSON SourceProvenance where
toJSON SourceProvenance'{..}
= object
(catMaybes
[("resolvedRepoSource" .=) <$> _spResolvedRepoSource,
("resolvedStorageSource" .=) <$>
_spResolvedStorageSource,
("fileHashes" .=) <$> _spFileHashes])
data ListBuildsResponse = ListBuildsResponse'
{ _lbrNextPageToken :: !(Maybe Text)
, _lbrBuilds :: !(Maybe [Build])
} deriving (Eq,Show,Data,Typeable,Generic)
listBuildsResponse
:: ListBuildsResponse
listBuildsResponse =
ListBuildsResponse'
{ _lbrNextPageToken = Nothing
, _lbrBuilds = Nothing
}
lbrNextPageToken :: Lens' ListBuildsResponse (Maybe Text)
lbrNextPageToken
= lens _lbrNextPageToken
(\ s a -> s{_lbrNextPageToken = a})
lbrBuilds :: Lens' ListBuildsResponse [Build]
lbrBuilds
= lens _lbrBuilds (\ s a -> s{_lbrBuilds = a}) .
_Default
. _Coerce
instance FromJSON ListBuildsResponse where
parseJSON
= withObject "ListBuildsResponse"
(\ o ->
ListBuildsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "builds" .!= mempty))
instance ToJSON ListBuildsResponse where
toJSON ListBuildsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lbrNextPageToken,
("builds" .=) <$> _lbrBuilds])
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 ListOperationsResponse = ListOperationsResponse'
{ _lorNextPageToken :: !(Maybe Text)
, _lorOperations :: !(Maybe [Operation])
} deriving (Eq,Show,Data,Typeable,Generic)
listOperationsResponse
:: ListOperationsResponse
listOperationsResponse =
ListOperationsResponse'
{ _lorNextPageToken = Nothing
, _lorOperations = Nothing
}
lorNextPageToken :: Lens' ListOperationsResponse (Maybe Text)
lorNextPageToken
= lens _lorNextPageToken
(\ s a -> s{_lorNextPageToken = a})
lorOperations :: Lens' ListOperationsResponse [Operation]
lorOperations
= lens _lorOperations
(\ s a -> s{_lorOperations = a})
. _Default
. _Coerce
instance FromJSON ListOperationsResponse where
parseJSON
= withObject "ListOperationsResponse"
(\ o ->
ListOperationsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "operations" .!= mempty))
instance ToJSON ListOperationsResponse where
toJSON ListOperationsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _lorNextPageToken,
("operations" .=) <$> _lorOperations])
data Hash = Hash'
{ _hValue :: !(Maybe Base64)
, _hType :: !(Maybe HashType)
} deriving (Eq,Show,Data,Typeable,Generic)
hash
:: Hash
hash =
Hash'
{ _hValue = Nothing
, _hType = Nothing
}
hValue :: Lens' Hash (Maybe ByteString)
hValue
= lens _hValue (\ s a -> s{_hValue = a}) .
mapping _Base64
hType :: Lens' Hash (Maybe HashType)
hType = lens _hType (\ s a -> s{_hType = a})
instance FromJSON Hash where
parseJSON
= withObject "Hash"
(\ o -> Hash' <$> (o .:? "value") <*> (o .:? "type"))
instance ToJSON Hash where
toJSON Hash'{..}
= object
(catMaybes
[("value" .=) <$> _hValue, ("type" .=) <$> _hType])
data Results = Results'
{ _rImages :: !(Maybe [BuiltImage])
, _rBuildStepImages :: !(Maybe [Text])
} deriving (Eq,Show,Data,Typeable,Generic)
results
:: Results
results =
Results'
{ _rImages = Nothing
, _rBuildStepImages = Nothing
}
rImages :: Lens' Results [BuiltImage]
rImages
= lens _rImages (\ s a -> s{_rImages = a}) . _Default
. _Coerce
rBuildStepImages :: Lens' Results [Text]
rBuildStepImages
= lens _rBuildStepImages
(\ s a -> s{_rBuildStepImages = a})
. _Default
. _Coerce
instance FromJSON Results where
parseJSON
= withObject "Results"
(\ o ->
Results' <$>
(o .:? "images" .!= mempty) <*>
(o .:? "buildStepImages" .!= mempty))
instance ToJSON Results where
toJSON Results'{..}
= object
(catMaybes
[("images" .=) <$> _rImages,
("buildStepImages" .=) <$> _rBuildStepImages])
data RepoSource = RepoSource'
{ _rsRepoName :: !(Maybe Text)
, _rsCommitSha :: !(Maybe Text)
, _rsBranchName :: !(Maybe Text)
, _rsTagName :: !(Maybe Text)
, _rsProjectId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
repoSource
:: RepoSource
repoSource =
RepoSource'
{ _rsRepoName = Nothing
, _rsCommitSha = Nothing
, _rsBranchName = Nothing
, _rsTagName = Nothing
, _rsProjectId = Nothing
}
rsRepoName :: Lens' RepoSource (Maybe Text)
rsRepoName
= lens _rsRepoName (\ s a -> s{_rsRepoName = a})
rsCommitSha :: Lens' RepoSource (Maybe Text)
rsCommitSha
= lens _rsCommitSha (\ s a -> s{_rsCommitSha = a})
rsBranchName :: Lens' RepoSource (Maybe Text)
rsBranchName
= lens _rsBranchName (\ s a -> s{_rsBranchName = a})
rsTagName :: Lens' RepoSource (Maybe Text)
rsTagName
= lens _rsTagName (\ s a -> s{_rsTagName = a})
rsProjectId :: Lens' RepoSource (Maybe Text)
rsProjectId
= lens _rsProjectId (\ s a -> s{_rsProjectId = a})
instance FromJSON RepoSource where
parseJSON
= withObject "RepoSource"
(\ o ->
RepoSource' <$>
(o .:? "repoName") <*> (o .:? "commitSha") <*>
(o .:? "branchName")
<*> (o .:? "tagName")
<*> (o .:? "projectId"))
instance ToJSON RepoSource where
toJSON RepoSource'{..}
= object
(catMaybes
[("repoName" .=) <$> _rsRepoName,
("commitSha" .=) <$> _rsCommitSha,
("branchName" .=) <$> _rsBranchName,
("tagName" .=) <$> _rsTagName,
("projectId" .=) <$> _rsProjectId])
data Operation = Operation'
{ _oDone :: !(Maybe Bool)
, _oError :: !(Maybe Status)
, _oResponse :: !(Maybe OperationResponse)
, _oName :: !(Maybe Text)
, _oMetadata :: !(Maybe OperationMetadata)
} deriving (Eq,Show,Data,Typeable,Generic)
operation
:: Operation
operation =
Operation'
{ _oDone = Nothing
, _oError = Nothing
, _oResponse = Nothing
, _oName = Nothing
, _oMetadata = 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})
oName :: Lens' Operation (Maybe Text)
oName = lens _oName (\ s a -> s{_oName = a})
oMetadata :: Lens' Operation (Maybe OperationMetadata)
oMetadata
= lens _oMetadata (\ s a -> s{_oMetadata = a})
instance FromJSON Operation where
parseJSON
= withObject "Operation"
(\ o ->
Operation' <$>
(o .:? "done") <*> (o .:? "error") <*>
(o .:? "response")
<*> (o .:? "name")
<*> (o .:? "metadata"))
instance ToJSON Operation where
toJSON Operation'{..}
= object
(catMaybes
[("done" .=) <$> _oDone, ("error" .=) <$> _oError,
("response" .=) <$> _oResponse,
("name" .=) <$> _oName,
("metadata" .=) <$> _oMetadata])
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 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 Build = Build'
{ _bImages :: !(Maybe [Text])
, _bStatus :: !(Maybe BuildStatus)
, _bSourceProvenance :: !(Maybe SourceProvenance)
, _bLogURL :: !(Maybe Text)
, _bResults :: !(Maybe Results)
, _bStartTime :: !(Maybe DateTime')
, _bLogsBucket :: !(Maybe Text)
, _bSteps :: !(Maybe [BuildStep])
, _bStatusDetail :: !(Maybe Text)
, _bSource :: !(Maybe Source)
, _bId :: !(Maybe Text)
, _bOptions :: !(Maybe BuildOptions)
, _bProjectId :: !(Maybe Text)
, _bTimeout :: !(Maybe Duration)
, _bFinishTime :: !(Maybe DateTime')
, _bCreateTime :: !(Maybe DateTime')
} deriving (Eq,Show,Data,Typeable,Generic)
build
:: Build
build =
Build'
{ _bImages = Nothing
, _bStatus = Nothing
, _bSourceProvenance = Nothing
, _bLogURL = Nothing
, _bResults = Nothing
, _bStartTime = Nothing
, _bLogsBucket = Nothing
, _bSteps = Nothing
, _bStatusDetail = Nothing
, _bSource = Nothing
, _bId = Nothing
, _bOptions = Nothing
, _bProjectId = Nothing
, _bTimeout = Nothing
, _bFinishTime = Nothing
, _bCreateTime = Nothing
}
bImages :: Lens' Build [Text]
bImages
= lens _bImages (\ s a -> s{_bImages = a}) . _Default
. _Coerce
bStatus :: Lens' Build (Maybe BuildStatus)
bStatus = lens _bStatus (\ s a -> s{_bStatus = a})
bSourceProvenance :: Lens' Build (Maybe SourceProvenance)
bSourceProvenance
= lens _bSourceProvenance
(\ s a -> s{_bSourceProvenance = a})
bLogURL :: Lens' Build (Maybe Text)
bLogURL = lens _bLogURL (\ s a -> s{_bLogURL = a})
bResults :: Lens' Build (Maybe Results)
bResults = lens _bResults (\ s a -> s{_bResults = a})
bStartTime :: Lens' Build (Maybe UTCTime)
bStartTime
= lens _bStartTime (\ s a -> s{_bStartTime = a}) .
mapping _DateTime
bLogsBucket :: Lens' Build (Maybe Text)
bLogsBucket
= lens _bLogsBucket (\ s a -> s{_bLogsBucket = a})
bSteps :: Lens' Build [BuildStep]
bSteps
= lens _bSteps (\ s a -> s{_bSteps = a}) . _Default .
_Coerce
bStatusDetail :: Lens' Build (Maybe Text)
bStatusDetail
= lens _bStatusDetail
(\ s a -> s{_bStatusDetail = a})
bSource :: Lens' Build (Maybe Source)
bSource = lens _bSource (\ s a -> s{_bSource = a})
bId :: Lens' Build (Maybe Text)
bId = lens _bId (\ s a -> s{_bId = a})
bOptions :: Lens' Build (Maybe BuildOptions)
bOptions = lens _bOptions (\ s a -> s{_bOptions = a})
bProjectId :: Lens' Build (Maybe Text)
bProjectId
= lens _bProjectId (\ s a -> s{_bProjectId = a})
bTimeout :: Lens' Build (Maybe Scientific)
bTimeout
= lens _bTimeout (\ s a -> s{_bTimeout = a}) .
mapping _Duration
bFinishTime :: Lens' Build (Maybe UTCTime)
bFinishTime
= lens _bFinishTime (\ s a -> s{_bFinishTime = a}) .
mapping _DateTime
bCreateTime :: Lens' Build (Maybe UTCTime)
bCreateTime
= lens _bCreateTime (\ s a -> s{_bCreateTime = a}) .
mapping _DateTime
instance FromJSON Build where
parseJSON
= withObject "Build"
(\ o ->
Build' <$>
(o .:? "images" .!= mempty) <*> (o .:? "status") <*>
(o .:? "sourceProvenance")
<*> (o .:? "logUrl")
<*> (o .:? "results")
<*> (o .:? "startTime")
<*> (o .:? "logsBucket")
<*> (o .:? "steps" .!= mempty)
<*> (o .:? "statusDetail")
<*> (o .:? "source")
<*> (o .:? "id")
<*> (o .:? "options")
<*> (o .:? "projectId")
<*> (o .:? "timeout")
<*> (o .:? "finishTime")
<*> (o .:? "createTime"))
instance ToJSON Build where
toJSON Build'{..}
= object
(catMaybes
[("images" .=) <$> _bImages,
("status" .=) <$> _bStatus,
("sourceProvenance" .=) <$> _bSourceProvenance,
("logUrl" .=) <$> _bLogURL,
("results" .=) <$> _bResults,
("startTime" .=) <$> _bStartTime,
("logsBucket" .=) <$> _bLogsBucket,
("steps" .=) <$> _bSteps,
("statusDetail" .=) <$> _bStatusDetail,
("source" .=) <$> _bSource, ("id" .=) <$> _bId,
("options" .=) <$> _bOptions,
("projectId" .=) <$> _bProjectId,
("timeout" .=) <$> _bTimeout,
("finishTime" .=) <$> _bFinishTime,
("createTime" .=) <$> _bCreateTime])
newtype SourceProvenanceFileHashes = SourceProvenanceFileHashes'
{ _spfhAddtional :: HashMap Text FileHashes
} deriving (Eq,Show,Data,Typeable,Generic)
sourceProvenanceFileHashes
:: HashMap Text FileHashes
-> SourceProvenanceFileHashes
sourceProvenanceFileHashes pSpfhAddtional_ =
SourceProvenanceFileHashes'
{ _spfhAddtional = _Coerce # pSpfhAddtional_
}
spfhAddtional :: Lens' SourceProvenanceFileHashes (HashMap Text FileHashes)
spfhAddtional
= lens _spfhAddtional
(\ s a -> s{_spfhAddtional = a})
. _Coerce
instance FromJSON SourceProvenanceFileHashes where
parseJSON
= withObject "SourceProvenanceFileHashes"
(\ o ->
SourceProvenanceFileHashes' <$> (parseJSONObject o))
instance ToJSON SourceProvenanceFileHashes where
toJSON = toJSON . _spfhAddtional
data CancelBuildRequest =
CancelBuildRequest'
deriving (Eq,Show,Data,Typeable,Generic)
cancelBuildRequest
:: CancelBuildRequest
cancelBuildRequest = CancelBuildRequest'
instance FromJSON CancelBuildRequest where
parseJSON
= withObject "CancelBuildRequest"
(\ o -> pure CancelBuildRequest')
instance ToJSON CancelBuildRequest where
toJSON = const emptyObject
data StorageSource = StorageSource'
{ _ssBucket :: !(Maybe Text)
, _ssObject :: !(Maybe Text)
, _ssGeneration :: !(Maybe (Textual Int64))
} deriving (Eq,Show,Data,Typeable,Generic)
storageSource
:: StorageSource
storageSource =
StorageSource'
{ _ssBucket = Nothing
, _ssObject = Nothing
, _ssGeneration = Nothing
}
ssBucket :: Lens' StorageSource (Maybe Text)
ssBucket = lens _ssBucket (\ s a -> s{_ssBucket = a})
ssObject :: Lens' StorageSource (Maybe Text)
ssObject = lens _ssObject (\ s a -> s{_ssObject = a})
ssGeneration :: Lens' StorageSource (Maybe Int64)
ssGeneration
= lens _ssGeneration (\ s a -> s{_ssGeneration = a})
. mapping _Coerce
instance FromJSON StorageSource where
parseJSON
= withObject "StorageSource"
(\ o ->
StorageSource' <$>
(o .:? "bucket") <*> (o .:? "object") <*>
(o .:? "generation"))
instance ToJSON StorageSource where
toJSON StorageSource'{..}
= object
(catMaybes
[("bucket" .=) <$> _ssBucket,
("object" .=) <$> _ssObject,
("generation" .=) <$> _ssGeneration])
newtype ListBuildTriggersResponse = ListBuildTriggersResponse'
{ _lbtrTriggers :: Maybe [BuildTrigger]
} deriving (Eq,Show,Data,Typeable,Generic)
listBuildTriggersResponse
:: ListBuildTriggersResponse
listBuildTriggersResponse =
ListBuildTriggersResponse'
{ _lbtrTriggers = Nothing
}
lbtrTriggers :: Lens' ListBuildTriggersResponse [BuildTrigger]
lbtrTriggers
= lens _lbtrTriggers (\ s a -> s{_lbtrTriggers = a})
. _Default
. _Coerce
instance FromJSON ListBuildTriggersResponse where
parseJSON
= withObject "ListBuildTriggersResponse"
(\ o ->
ListBuildTriggersResponse' <$>
(o .:? "triggers" .!= mempty))
instance ToJSON ListBuildTriggersResponse where
toJSON ListBuildTriggersResponse'{..}
= object
(catMaybes [("triggers" .=) <$> _lbtrTriggers])
newtype FileHashes = FileHashes'
{ _fhFileHash :: Maybe [Hash]
} deriving (Eq,Show,Data,Typeable,Generic)
fileHashes
:: FileHashes
fileHashes =
FileHashes'
{ _fhFileHash = Nothing
}
fhFileHash :: Lens' FileHashes [Hash]
fhFileHash
= lens _fhFileHash (\ s a -> s{_fhFileHash = a}) .
_Default
. _Coerce
instance FromJSON FileHashes where
parseJSON
= withObject "FileHashes"
(\ o ->
FileHashes' <$> (o .:? "fileHash" .!= mempty))
instance ToJSON FileHashes where
toJSON FileHashes'{..}
= object
(catMaybes [("fileHash" .=) <$> _fhFileHash])
data Source = Source'
{ _sRepoSource :: !(Maybe RepoSource)
, _sStorageSource :: !(Maybe StorageSource)
} deriving (Eq,Show,Data,Typeable,Generic)
source
:: Source
source =
Source'
{ _sRepoSource = Nothing
, _sStorageSource = Nothing
}
sRepoSource :: Lens' Source (Maybe RepoSource)
sRepoSource
= lens _sRepoSource (\ s a -> s{_sRepoSource = a})
sStorageSource :: Lens' Source (Maybe StorageSource)
sStorageSource
= lens _sStorageSource
(\ s a -> s{_sStorageSource = a})
instance FromJSON Source where
parseJSON
= withObject "Source"
(\ o ->
Source' <$>
(o .:? "repoSource") <*> (o .:? "storageSource"))
instance ToJSON Source where
toJSON Source'{..}
= object
(catMaybes
[("repoSource" .=) <$> _sRepoSource,
("storageSource" .=) <$> _sStorageSource])
newtype OperationMetadata = OperationMetadata'
{ _omAddtional :: HashMap Text JSONValue
} deriving (Eq,Show,Data,Typeable,Generic)
operationMetadata
:: HashMap Text JSONValue
-> OperationMetadata
operationMetadata pOmAddtional_ =
OperationMetadata'
{ _omAddtional = _Coerce # pOmAddtional_
}
omAddtional :: Lens' OperationMetadata (HashMap Text JSONValue)
omAddtional
= lens _omAddtional (\ s a -> s{_omAddtional = a}) .
_Coerce
instance FromJSON OperationMetadata where
parseJSON
= withObject "OperationMetadata"
(\ o -> OperationMetadata' <$> (parseJSONObject o))
instance ToJSON OperationMetadata where
toJSON = toJSON . _omAddtional
newtype BuildOperationMetadata = BuildOperationMetadata'
{ _bomBuild :: Maybe Build
} deriving (Eq,Show,Data,Typeable,Generic)
buildOperationMetadata
:: BuildOperationMetadata
buildOperationMetadata =
BuildOperationMetadata'
{ _bomBuild = Nothing
}
bomBuild :: Lens' BuildOperationMetadata (Maybe Build)
bomBuild = lens _bomBuild (\ s a -> s{_bomBuild = a})
instance FromJSON BuildOperationMetadata where
parseJSON
= withObject "BuildOperationMetadata"
(\ o -> BuildOperationMetadata' <$> (o .:? "build"))
instance ToJSON BuildOperationMetadata where
toJSON BuildOperationMetadata'{..}
= object (catMaybes [("build" .=) <$> _bomBuild])
data BuildOptions = BuildOptions'
{ _boRequestedVerifyOption :: !(Maybe BuildOptionsRequestedVerifyOption)
, _boSourceProvenanceHash :: !(Maybe [Text])
} deriving (Eq,Show,Data,Typeable,Generic)
buildOptions
:: BuildOptions
buildOptions =
BuildOptions'
{ _boRequestedVerifyOption = Nothing
, _boSourceProvenanceHash = Nothing
}
boRequestedVerifyOption :: Lens' BuildOptions (Maybe BuildOptionsRequestedVerifyOption)
boRequestedVerifyOption
= lens _boRequestedVerifyOption
(\ s a -> s{_boRequestedVerifyOption = a})
boSourceProvenanceHash :: Lens' BuildOptions [Text]
boSourceProvenanceHash
= lens _boSourceProvenanceHash
(\ s a -> s{_boSourceProvenanceHash = a})
. _Default
. _Coerce
instance FromJSON BuildOptions where
parseJSON
= withObject "BuildOptions"
(\ o ->
BuildOptions' <$>
(o .:? "requestedVerifyOption") <*>
(o .:? "sourceProvenanceHash" .!= mempty))
instance ToJSON BuildOptions where
toJSON BuildOptions'{..}
= object
(catMaybes
[("requestedVerifyOption" .=) <$>
_boRequestedVerifyOption,
("sourceProvenanceHash" .=) <$>
_boSourceProvenanceHash])
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
data BuildTrigger = BuildTrigger'
{ _btDisabled :: !(Maybe Bool)
, _btTriggerTemplate :: !(Maybe RepoSource)
, _btBuild :: !(Maybe Build)
, _btId :: !(Maybe Text)
, _btDescription :: !(Maybe Text)
, _btFilename :: !(Maybe Text)
, _btCreateTime :: !(Maybe DateTime')
} deriving (Eq,Show,Data,Typeable,Generic)
buildTrigger
:: BuildTrigger
buildTrigger =
BuildTrigger'
{ _btDisabled = Nothing
, _btTriggerTemplate = Nothing
, _btBuild = Nothing
, _btId = Nothing
, _btDescription = Nothing
, _btFilename = Nothing
, _btCreateTime = Nothing
}
btDisabled :: Lens' BuildTrigger (Maybe Bool)
btDisabled
= lens _btDisabled (\ s a -> s{_btDisabled = a})
btTriggerTemplate :: Lens' BuildTrigger (Maybe RepoSource)
btTriggerTemplate
= lens _btTriggerTemplate
(\ s a -> s{_btTriggerTemplate = a})
btBuild :: Lens' BuildTrigger (Maybe Build)
btBuild = lens _btBuild (\ s a -> s{_btBuild = a})
btId :: Lens' BuildTrigger (Maybe Text)
btId = lens _btId (\ s a -> s{_btId = a})
btDescription :: Lens' BuildTrigger (Maybe Text)
btDescription
= lens _btDescription
(\ s a -> s{_btDescription = a})
btFilename :: Lens' BuildTrigger (Maybe Text)
btFilename
= lens _btFilename (\ s a -> s{_btFilename = a})
btCreateTime :: Lens' BuildTrigger (Maybe UTCTime)
btCreateTime
= lens _btCreateTime (\ s a -> s{_btCreateTime = a})
. mapping _DateTime
instance FromJSON BuildTrigger where
parseJSON
= withObject "BuildTrigger"
(\ o ->
BuildTrigger' <$>
(o .:? "disabled") <*> (o .:? "triggerTemplate") <*>
(o .:? "build")
<*> (o .:? "id")
<*> (o .:? "description")
<*> (o .:? "filename")
<*> (o .:? "createTime"))
instance ToJSON BuildTrigger where
toJSON BuildTrigger'{..}
= object
(catMaybes
[("disabled" .=) <$> _btDisabled,
("triggerTemplate" .=) <$> _btTriggerTemplate,
("build" .=) <$> _btBuild, ("id" .=) <$> _btId,
("description" .=) <$> _btDescription,
("filename" .=) <$> _btFilename,
("createTime" .=) <$> _btCreateTime])
data BuiltImage = BuiltImage'
{ _biName :: !(Maybe Text)
, _biDigest :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
builtImage
:: BuiltImage
builtImage =
BuiltImage'
{ _biName = Nothing
, _biDigest = Nothing
}
biName :: Lens' BuiltImage (Maybe Text)
biName = lens _biName (\ s a -> s{_biName = a})
biDigest :: Lens' BuiltImage (Maybe Text)
biDigest = lens _biDigest (\ s a -> s{_biDigest = a})
instance FromJSON BuiltImage where
parseJSON
= withObject "BuiltImage"
(\ o ->
BuiltImage' <$> (o .:? "name") <*> (o .:? "digest"))
instance ToJSON BuiltImage where
toJSON BuiltImage'{..}
= object
(catMaybes
[("name" .=) <$> _biName,
("digest" .=) <$> _biDigest])