{-# 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.StorageTransfer.Types.Product where
import Network.Google.Prelude
import Network.Google.StorageTransfer.Types.Sum
data ErrorSummary = ErrorSummary'
{ _esErrorCount :: !(Maybe (Textual Int64))
, _esErrorCode :: !(Maybe ErrorSummaryErrorCode)
, _esErrorLogEntries :: !(Maybe [ErrorLogEntry])
} deriving (Eq,Show,Data,Typeable,Generic)
errorSummary
:: ErrorSummary
errorSummary =
ErrorSummary'
{ _esErrorCount = Nothing
, _esErrorCode = Nothing
, _esErrorLogEntries = Nothing
}
esErrorCount :: Lens' ErrorSummary (Maybe Int64)
esErrorCount
= lens _esErrorCount (\ s a -> s{_esErrorCount = a})
. mapping _Coerce
esErrorCode :: Lens' ErrorSummary (Maybe ErrorSummaryErrorCode)
esErrorCode
= lens _esErrorCode (\ s a -> s{_esErrorCode = a})
esErrorLogEntries :: Lens' ErrorSummary [ErrorLogEntry]
esErrorLogEntries
= lens _esErrorLogEntries
(\ s a -> s{_esErrorLogEntries = a})
. _Default
. _Coerce
instance FromJSON ErrorSummary where
parseJSON
= withObject "ErrorSummary"
(\ o ->
ErrorSummary' <$>
(o .:? "errorCount") <*> (o .:? "errorCode") <*>
(o .:? "errorLogEntries" .!= mempty))
instance ToJSON ErrorSummary where
toJSON ErrorSummary'{..}
= object
(catMaybes
[("errorCount" .=) <$> _esErrorCount,
("errorCode" .=) <$> _esErrorCode,
("errorLogEntries" .=) <$> _esErrorLogEntries])
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 Schedule = Schedule'
{ _sScheduleEndDate :: !(Maybe Date)
, _sScheduleStartDate :: !(Maybe Date)
, _sStartTimeOfDay :: !(Maybe TimeOfDay')
} deriving (Eq,Show,Data,Typeable,Generic)
schedule
:: Schedule
schedule =
Schedule'
{ _sScheduleEndDate = Nothing
, _sScheduleStartDate = Nothing
, _sStartTimeOfDay = Nothing
}
sScheduleEndDate :: Lens' Schedule (Maybe Date)
sScheduleEndDate
= lens _sScheduleEndDate
(\ s a -> s{_sScheduleEndDate = a})
sScheduleStartDate :: Lens' Schedule (Maybe Date)
sScheduleStartDate
= lens _sScheduleStartDate
(\ s a -> s{_sScheduleStartDate = a})
sStartTimeOfDay :: Lens' Schedule (Maybe TimeOfDay')
sStartTimeOfDay
= lens _sStartTimeOfDay
(\ s a -> s{_sStartTimeOfDay = a})
instance FromJSON Schedule where
parseJSON
= withObject "Schedule"
(\ o ->
Schedule' <$>
(o .:? "scheduleEndDate") <*>
(o .:? "scheduleStartDate")
<*> (o .:? "startTimeOfDay"))
instance ToJSON Schedule where
toJSON Schedule'{..}
= object
(catMaybes
[("scheduleEndDate" .=) <$> _sScheduleEndDate,
("scheduleStartDate" .=) <$> _sScheduleStartDate,
("startTimeOfDay" .=) <$> _sStartTimeOfDay])
data ObjectConditions = ObjectConditions'
{ _ocMinTimeElapsedSinceLastModification :: !(Maybe GDuration)
, _ocIncludePrefixes :: !(Maybe [Text])
, _ocMaxTimeElapsedSinceLastModification :: !(Maybe GDuration)
, _ocExcludePrefixes :: !(Maybe [Text])
} deriving (Eq,Show,Data,Typeable,Generic)
objectConditions
:: ObjectConditions
objectConditions =
ObjectConditions'
{ _ocMinTimeElapsedSinceLastModification = Nothing
, _ocIncludePrefixes = Nothing
, _ocMaxTimeElapsedSinceLastModification = Nothing
, _ocExcludePrefixes = Nothing
}
ocMinTimeElapsedSinceLastModification :: Lens' ObjectConditions (Maybe Scientific)
ocMinTimeElapsedSinceLastModification
= lens _ocMinTimeElapsedSinceLastModification
(\ s a ->
s{_ocMinTimeElapsedSinceLastModification = a})
. mapping _GDuration
ocIncludePrefixes :: Lens' ObjectConditions [Text]
ocIncludePrefixes
= lens _ocIncludePrefixes
(\ s a -> s{_ocIncludePrefixes = a})
. _Default
. _Coerce
ocMaxTimeElapsedSinceLastModification :: Lens' ObjectConditions (Maybe Scientific)
ocMaxTimeElapsedSinceLastModification
= lens _ocMaxTimeElapsedSinceLastModification
(\ s a ->
s{_ocMaxTimeElapsedSinceLastModification = a})
. mapping _GDuration
ocExcludePrefixes :: Lens' ObjectConditions [Text]
ocExcludePrefixes
= lens _ocExcludePrefixes
(\ s a -> s{_ocExcludePrefixes = a})
. _Default
. _Coerce
instance FromJSON ObjectConditions where
parseJSON
= withObject "ObjectConditions"
(\ o ->
ObjectConditions' <$>
(o .:? "minTimeElapsedSinceLastModification") <*>
(o .:? "includePrefixes" .!= mempty)
<*> (o .:? "maxTimeElapsedSinceLastModification")
<*> (o .:? "excludePrefixes" .!= mempty))
instance ToJSON ObjectConditions where
toJSON ObjectConditions'{..}
= object
(catMaybes
[("minTimeElapsedSinceLastModification" .=) <$>
_ocMinTimeElapsedSinceLastModification,
("includePrefixes" .=) <$> _ocIncludePrefixes,
("maxTimeElapsedSinceLastModification" .=) <$>
_ocMaxTimeElapsedSinceLastModification,
("excludePrefixes" .=) <$> _ocExcludePrefixes])
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
data PauseTransferOperationRequest =
PauseTransferOperationRequest'
deriving (Eq,Show,Data,Typeable,Generic)
pauseTransferOperationRequest
:: PauseTransferOperationRequest
pauseTransferOperationRequest = PauseTransferOperationRequest'
instance FromJSON PauseTransferOperationRequest where
parseJSON
= withObject "PauseTransferOperationRequest"
(\ o -> pure PauseTransferOperationRequest')
instance ToJSON PauseTransferOperationRequest where
toJSON = const emptyObject
newtype GoogleServiceAccount = GoogleServiceAccount'
{ _gsaAccountEmail :: Maybe Text
} deriving (Eq,Show,Data,Typeable,Generic)
googleServiceAccount
:: GoogleServiceAccount
googleServiceAccount =
GoogleServiceAccount'
{ _gsaAccountEmail = Nothing
}
gsaAccountEmail :: Lens' GoogleServiceAccount (Maybe Text)
gsaAccountEmail
= lens _gsaAccountEmail
(\ s a -> s{_gsaAccountEmail = a})
instance FromJSON GoogleServiceAccount where
parseJSON
= withObject "GoogleServiceAccount"
(\ o ->
GoogleServiceAccount' <$> (o .:? "accountEmail"))
instance ToJSON GoogleServiceAccount where
toJSON GoogleServiceAccount'{..}
= object
(catMaybes
[("accountEmail" .=) <$> _gsaAccountEmail])
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 Date = Date'
{ _dDay :: !(Maybe (Textual Int32))
, _dYear :: !(Maybe (Textual Int32))
, _dMonth :: !(Maybe (Textual Int32))
} deriving (Eq,Show,Data,Typeable,Generic)
date
:: Date
date =
Date'
{ _dDay = Nothing
, _dYear = Nothing
, _dMonth = Nothing
}
dDay :: Lens' Date (Maybe Int32)
dDay
= lens _dDay (\ s a -> s{_dDay = a}) .
mapping _Coerce
dYear :: Lens' Date (Maybe Int32)
dYear
= lens _dYear (\ s a -> s{_dYear = a}) .
mapping _Coerce
dMonth :: Lens' Date (Maybe Int32)
dMonth
= lens _dMonth (\ s a -> s{_dMonth = a}) .
mapping _Coerce
instance FromJSON Date where
parseJSON
= withObject "Date"
(\ o ->
Date' <$>
(o .:? "day") <*> (o .:? "year") <*> (o .:? "month"))
instance ToJSON Date where
toJSON Date'{..}
= object
(catMaybes
[("day" .=) <$> _dDay, ("year" .=) <$> _dYear,
("month" .=) <$> _dMonth])
data UpdateTransferJobRequest = UpdateTransferJobRequest'
{ _utjrTransferJob :: !(Maybe TransferJob)
, _utjrProjectId :: !(Maybe Text)
, _utjrUpdateTransferJobFieldMask :: !(Maybe GFieldMask)
} deriving (Eq,Show,Data,Typeable,Generic)
updateTransferJobRequest
:: UpdateTransferJobRequest
updateTransferJobRequest =
UpdateTransferJobRequest'
{ _utjrTransferJob = Nothing
, _utjrProjectId = Nothing
, _utjrUpdateTransferJobFieldMask = Nothing
}
utjrTransferJob :: Lens' UpdateTransferJobRequest (Maybe TransferJob)
utjrTransferJob
= lens _utjrTransferJob
(\ s a -> s{_utjrTransferJob = a})
utjrProjectId :: Lens' UpdateTransferJobRequest (Maybe Text)
utjrProjectId
= lens _utjrProjectId
(\ s a -> s{_utjrProjectId = a})
utjrUpdateTransferJobFieldMask :: Lens' UpdateTransferJobRequest (Maybe GFieldMask)
utjrUpdateTransferJobFieldMask
= lens _utjrUpdateTransferJobFieldMask
(\ s a -> s{_utjrUpdateTransferJobFieldMask = a})
instance FromJSON UpdateTransferJobRequest where
parseJSON
= withObject "UpdateTransferJobRequest"
(\ o ->
UpdateTransferJobRequest' <$>
(o .:? "transferJob") <*> (o .:? "projectId") <*>
(o .:? "updateTransferJobFieldMask"))
instance ToJSON UpdateTransferJobRequest where
toJSON UpdateTransferJobRequest'{..}
= object
(catMaybes
[("transferJob" .=) <$> _utjrTransferJob,
("projectId" .=) <$> _utjrProjectId,
("updateTransferJobFieldMask" .=) <$>
_utjrUpdateTransferJobFieldMask])
data TransferCounters = TransferCounters'
{ _tcBytesFoundOnlyFromSink :: !(Maybe (Textual Int64))
, _tcBytesDeletedFromSink :: !(Maybe (Textual Int64))
, _tcObjectsDeletedFromSource :: !(Maybe (Textual Int64))
, _tcObjectsFoundFromSource :: !(Maybe (Textual Int64))
, _tcBytesFailedToDeleteFromSink :: !(Maybe (Textual Int64))
, _tcBytesFromSourceFailed :: !(Maybe (Textual Int64))
, _tcBytesCopiedToSink :: !(Maybe (Textual Int64))
, _tcBytesFoundFromSource :: !(Maybe (Textual Int64))
, _tcBytesDeletedFromSource :: !(Maybe (Textual Int64))
, _tcObjectsDeletedFromSink :: !(Maybe (Textual Int64))
, _tcObjectsFoundOnlyFromSink :: !(Maybe (Textual Int64))
, _tcBytesFromSourceSkippedBySync :: !(Maybe (Textual Int64))
, _tcObjectsCopiedToSink :: !(Maybe (Textual Int64))
, _tcObjectsFromSourceFailed :: !(Maybe (Textual Int64))
, _tcObjectsFailedToDeleteFromSink :: !(Maybe (Textual Int64))
, _tcObjectsFromSourceSkippedBySync :: !(Maybe (Textual Int64))
} deriving (Eq,Show,Data,Typeable,Generic)
transferCounters
:: TransferCounters
transferCounters =
TransferCounters'
{ _tcBytesFoundOnlyFromSink = Nothing
, _tcBytesDeletedFromSink = Nothing
, _tcObjectsDeletedFromSource = Nothing
, _tcObjectsFoundFromSource = Nothing
, _tcBytesFailedToDeleteFromSink = Nothing
, _tcBytesFromSourceFailed = Nothing
, _tcBytesCopiedToSink = Nothing
, _tcBytesFoundFromSource = Nothing
, _tcBytesDeletedFromSource = Nothing
, _tcObjectsDeletedFromSink = Nothing
, _tcObjectsFoundOnlyFromSink = Nothing
, _tcBytesFromSourceSkippedBySync = Nothing
, _tcObjectsCopiedToSink = Nothing
, _tcObjectsFromSourceFailed = Nothing
, _tcObjectsFailedToDeleteFromSink = Nothing
, _tcObjectsFromSourceSkippedBySync = Nothing
}
tcBytesFoundOnlyFromSink :: Lens' TransferCounters (Maybe Int64)
tcBytesFoundOnlyFromSink
= lens _tcBytesFoundOnlyFromSink
(\ s a -> s{_tcBytesFoundOnlyFromSink = a})
. mapping _Coerce
tcBytesDeletedFromSink :: Lens' TransferCounters (Maybe Int64)
tcBytesDeletedFromSink
= lens _tcBytesDeletedFromSink
(\ s a -> s{_tcBytesDeletedFromSink = a})
. mapping _Coerce
tcObjectsDeletedFromSource :: Lens' TransferCounters (Maybe Int64)
tcObjectsDeletedFromSource
= lens _tcObjectsDeletedFromSource
(\ s a -> s{_tcObjectsDeletedFromSource = a})
. mapping _Coerce
tcObjectsFoundFromSource :: Lens' TransferCounters (Maybe Int64)
tcObjectsFoundFromSource
= lens _tcObjectsFoundFromSource
(\ s a -> s{_tcObjectsFoundFromSource = a})
. mapping _Coerce
tcBytesFailedToDeleteFromSink :: Lens' TransferCounters (Maybe Int64)
tcBytesFailedToDeleteFromSink
= lens _tcBytesFailedToDeleteFromSink
(\ s a -> s{_tcBytesFailedToDeleteFromSink = a})
. mapping _Coerce
tcBytesFromSourceFailed :: Lens' TransferCounters (Maybe Int64)
tcBytesFromSourceFailed
= lens _tcBytesFromSourceFailed
(\ s a -> s{_tcBytesFromSourceFailed = a})
. mapping _Coerce
tcBytesCopiedToSink :: Lens' TransferCounters (Maybe Int64)
tcBytesCopiedToSink
= lens _tcBytesCopiedToSink
(\ s a -> s{_tcBytesCopiedToSink = a})
. mapping _Coerce
tcBytesFoundFromSource :: Lens' TransferCounters (Maybe Int64)
tcBytesFoundFromSource
= lens _tcBytesFoundFromSource
(\ s a -> s{_tcBytesFoundFromSource = a})
. mapping _Coerce
tcBytesDeletedFromSource :: Lens' TransferCounters (Maybe Int64)
tcBytesDeletedFromSource
= lens _tcBytesDeletedFromSource
(\ s a -> s{_tcBytesDeletedFromSource = a})
. mapping _Coerce
tcObjectsDeletedFromSink :: Lens' TransferCounters (Maybe Int64)
tcObjectsDeletedFromSink
= lens _tcObjectsDeletedFromSink
(\ s a -> s{_tcObjectsDeletedFromSink = a})
. mapping _Coerce
tcObjectsFoundOnlyFromSink :: Lens' TransferCounters (Maybe Int64)
tcObjectsFoundOnlyFromSink
= lens _tcObjectsFoundOnlyFromSink
(\ s a -> s{_tcObjectsFoundOnlyFromSink = a})
. mapping _Coerce
tcBytesFromSourceSkippedBySync :: Lens' TransferCounters (Maybe Int64)
tcBytesFromSourceSkippedBySync
= lens _tcBytesFromSourceSkippedBySync
(\ s a -> s{_tcBytesFromSourceSkippedBySync = a})
. mapping _Coerce
tcObjectsCopiedToSink :: Lens' TransferCounters (Maybe Int64)
tcObjectsCopiedToSink
= lens _tcObjectsCopiedToSink
(\ s a -> s{_tcObjectsCopiedToSink = a})
. mapping _Coerce
tcObjectsFromSourceFailed :: Lens' TransferCounters (Maybe Int64)
tcObjectsFromSourceFailed
= lens _tcObjectsFromSourceFailed
(\ s a -> s{_tcObjectsFromSourceFailed = a})
. mapping _Coerce
tcObjectsFailedToDeleteFromSink :: Lens' TransferCounters (Maybe Int64)
tcObjectsFailedToDeleteFromSink
= lens _tcObjectsFailedToDeleteFromSink
(\ s a -> s{_tcObjectsFailedToDeleteFromSink = a})
. mapping _Coerce
tcObjectsFromSourceSkippedBySync :: Lens' TransferCounters (Maybe Int64)
tcObjectsFromSourceSkippedBySync
= lens _tcObjectsFromSourceSkippedBySync
(\ s a -> s{_tcObjectsFromSourceSkippedBySync = a})
. mapping _Coerce
instance FromJSON TransferCounters where
parseJSON
= withObject "TransferCounters"
(\ o ->
TransferCounters' <$>
(o .:? "bytesFoundOnlyFromSink") <*>
(o .:? "bytesDeletedFromSink")
<*> (o .:? "objectsDeletedFromSource")
<*> (o .:? "objectsFoundFromSource")
<*> (o .:? "bytesFailedToDeleteFromSink")
<*> (o .:? "bytesFromSourceFailed")
<*> (o .:? "bytesCopiedToSink")
<*> (o .:? "bytesFoundFromSource")
<*> (o .:? "bytesDeletedFromSource")
<*> (o .:? "objectsDeletedFromSink")
<*> (o .:? "objectsFoundOnlyFromSink")
<*> (o .:? "bytesFromSourceSkippedBySync")
<*> (o .:? "objectsCopiedToSink")
<*> (o .:? "objectsFromSourceFailed")
<*> (o .:? "objectsFailedToDeleteFromSink")
<*> (o .:? "objectsFromSourceSkippedBySync"))
instance ToJSON TransferCounters where
toJSON TransferCounters'{..}
= object
(catMaybes
[("bytesFoundOnlyFromSink" .=) <$>
_tcBytesFoundOnlyFromSink,
("bytesDeletedFromSink" .=) <$>
_tcBytesDeletedFromSink,
("objectsDeletedFromSource" .=) <$>
_tcObjectsDeletedFromSource,
("objectsFoundFromSource" .=) <$>
_tcObjectsFoundFromSource,
("bytesFailedToDeleteFromSink" .=) <$>
_tcBytesFailedToDeleteFromSink,
("bytesFromSourceFailed" .=) <$>
_tcBytesFromSourceFailed,
("bytesCopiedToSink" .=) <$> _tcBytesCopiedToSink,
("bytesFoundFromSource" .=) <$>
_tcBytesFoundFromSource,
("bytesDeletedFromSource" .=) <$>
_tcBytesDeletedFromSource,
("objectsDeletedFromSink" .=) <$>
_tcObjectsDeletedFromSink,
("objectsFoundOnlyFromSink" .=) <$>
_tcObjectsFoundOnlyFromSink,
("bytesFromSourceSkippedBySync" .=) <$>
_tcBytesFromSourceSkippedBySync,
("objectsCopiedToSink" .=) <$>
_tcObjectsCopiedToSink,
("objectsFromSourceFailed" .=) <$>
_tcObjectsFromSourceFailed,
("objectsFailedToDeleteFromSink" .=) <$>
_tcObjectsFailedToDeleteFromSink,
("objectsFromSourceSkippedBySync" .=) <$>
_tcObjectsFromSourceSkippedBySync])
data TransferJob = TransferJob'
{ _tjCreationTime :: !(Maybe DateTime')
, _tjStatus :: !(Maybe TransferJobStatus)
, _tjSchedule :: !(Maybe Schedule)
, _tjDeletionTime :: !(Maybe DateTime')
, _tjName :: !(Maybe Text)
, _tjProjectId :: !(Maybe Text)
, _tjTransferSpec :: !(Maybe TransferSpec)
, _tjDescription :: !(Maybe Text)
, _tjLastModificationTime :: !(Maybe DateTime')
} deriving (Eq,Show,Data,Typeable,Generic)
transferJob
:: TransferJob
transferJob =
TransferJob'
{ _tjCreationTime = Nothing
, _tjStatus = Nothing
, _tjSchedule = Nothing
, _tjDeletionTime = Nothing
, _tjName = Nothing
, _tjProjectId = Nothing
, _tjTransferSpec = Nothing
, _tjDescription = Nothing
, _tjLastModificationTime = Nothing
}
tjCreationTime :: Lens' TransferJob (Maybe UTCTime)
tjCreationTime
= lens _tjCreationTime
(\ s a -> s{_tjCreationTime = a})
. mapping _DateTime
tjStatus :: Lens' TransferJob (Maybe TransferJobStatus)
tjStatus = lens _tjStatus (\ s a -> s{_tjStatus = a})
tjSchedule :: Lens' TransferJob (Maybe Schedule)
tjSchedule
= lens _tjSchedule (\ s a -> s{_tjSchedule = a})
tjDeletionTime :: Lens' TransferJob (Maybe UTCTime)
tjDeletionTime
= lens _tjDeletionTime
(\ s a -> s{_tjDeletionTime = a})
. mapping _DateTime
tjName :: Lens' TransferJob (Maybe Text)
tjName = lens _tjName (\ s a -> s{_tjName = a})
tjProjectId :: Lens' TransferJob (Maybe Text)
tjProjectId
= lens _tjProjectId (\ s a -> s{_tjProjectId = a})
tjTransferSpec :: Lens' TransferJob (Maybe TransferSpec)
tjTransferSpec
= lens _tjTransferSpec
(\ s a -> s{_tjTransferSpec = a})
tjDescription :: Lens' TransferJob (Maybe Text)
tjDescription
= lens _tjDescription
(\ s a -> s{_tjDescription = a})
tjLastModificationTime :: Lens' TransferJob (Maybe UTCTime)
tjLastModificationTime
= lens _tjLastModificationTime
(\ s a -> s{_tjLastModificationTime = a})
. mapping _DateTime
instance FromJSON TransferJob where
parseJSON
= withObject "TransferJob"
(\ o ->
TransferJob' <$>
(o .:? "creationTime") <*> (o .:? "status") <*>
(o .:? "schedule")
<*> (o .:? "deletionTime")
<*> (o .:? "name")
<*> (o .:? "projectId")
<*> (o .:? "transferSpec")
<*> (o .:? "description")
<*> (o .:? "lastModificationTime"))
instance ToJSON TransferJob where
toJSON TransferJob'{..}
= object
(catMaybes
[("creationTime" .=) <$> _tjCreationTime,
("status" .=) <$> _tjStatus,
("schedule" .=) <$> _tjSchedule,
("deletionTime" .=) <$> _tjDeletionTime,
("name" .=) <$> _tjName,
("projectId" .=) <$> _tjProjectId,
("transferSpec" .=) <$> _tjTransferSpec,
("description" .=) <$> _tjDescription,
("lastModificationTime" .=) <$>
_tjLastModificationTime])
newtype GcsData = GcsData'
{ _gdBucketName :: Maybe Text
} deriving (Eq,Show,Data,Typeable,Generic)
gcsData
:: GcsData
gcsData =
GcsData'
{ _gdBucketName = Nothing
}
gdBucketName :: Lens' GcsData (Maybe Text)
gdBucketName
= lens _gdBucketName (\ s a -> s{_gdBucketName = a})
instance FromJSON GcsData where
parseJSON
= withObject "GcsData"
(\ o -> GcsData' <$> (o .:? "bucketName"))
instance ToJSON GcsData where
toJSON GcsData'{..}
= object
(catMaybes [("bucketName" .=) <$> _gdBucketName])
data AwsS3Data = AwsS3Data'
{ _asdBucketName :: !(Maybe Text)
, _asdAwsAccessKey :: !(Maybe AwsAccessKey)
} deriving (Eq,Show,Data,Typeable,Generic)
awsS3Data
:: AwsS3Data
awsS3Data =
AwsS3Data'
{ _asdBucketName = Nothing
, _asdAwsAccessKey = Nothing
}
asdBucketName :: Lens' AwsS3Data (Maybe Text)
asdBucketName
= lens _asdBucketName
(\ s a -> s{_asdBucketName = a})
asdAwsAccessKey :: Lens' AwsS3Data (Maybe AwsAccessKey)
asdAwsAccessKey
= lens _asdAwsAccessKey
(\ s a -> s{_asdAwsAccessKey = a})
instance FromJSON AwsS3Data where
parseJSON
= withObject "AwsS3Data"
(\ o ->
AwsS3Data' <$>
(o .:? "bucketName") <*> (o .:? "awsAccessKey"))
instance ToJSON AwsS3Data where
toJSON AwsS3Data'{..}
= object
(catMaybes
[("bucketName" .=) <$> _asdBucketName,
("awsAccessKey" .=) <$> _asdAwsAccessKey])
newtype HTTPData = HTTPData'
{ _httpdListURL :: Maybe Text
} deriving (Eq,Show,Data,Typeable,Generic)
hTTPData
:: HTTPData
hTTPData =
HTTPData'
{ _httpdListURL = Nothing
}
httpdListURL :: Lens' HTTPData (Maybe Text)
httpdListURL
= lens _httpdListURL (\ s a -> s{_httpdListURL = a})
instance FromJSON HTTPData where
parseJSON
= withObject "HTTPData"
(\ o -> HTTPData' <$> (o .:? "listUrl"))
instance ToJSON HTTPData where
toJSON HTTPData'{..}
= object
(catMaybes [("listUrl" .=) <$> _httpdListURL])
data TimeOfDay' = TimeOfDay''
{ _todNanos :: !(Maybe (Textual Int32))
, _todHours :: !(Maybe (Textual Int32))
, _todMinutes :: !(Maybe (Textual Int32))
, _todSeconds :: !(Maybe (Textual Int32))
} deriving (Eq,Show,Data,Typeable,Generic)
timeOfDay
:: TimeOfDay'
timeOfDay =
TimeOfDay''
{ _todNanos = Nothing
, _todHours = Nothing
, _todMinutes = Nothing
, _todSeconds = Nothing
}
todNanos :: Lens' TimeOfDay' (Maybe Int32)
todNanos
= lens _todNanos (\ s a -> s{_todNanos = a}) .
mapping _Coerce
todHours :: Lens' TimeOfDay' (Maybe Int32)
todHours
= lens _todHours (\ s a -> s{_todHours = a}) .
mapping _Coerce
todMinutes :: Lens' TimeOfDay' (Maybe Int32)
todMinutes
= lens _todMinutes (\ s a -> s{_todMinutes = a}) .
mapping _Coerce
todSeconds :: Lens' TimeOfDay' (Maybe Int32)
todSeconds
= lens _todSeconds (\ s a -> s{_todSeconds = a}) .
mapping _Coerce
instance FromJSON TimeOfDay' where
parseJSON
= withObject "TimeOfDay"
(\ o ->
TimeOfDay'' <$>
(o .:? "nanos") <*> (o .:? "hours") <*>
(o .:? "minutes")
<*> (o .:? "seconds"))
instance ToJSON TimeOfDay' where
toJSON TimeOfDay''{..}
= object
(catMaybes
[("nanos" .=) <$> _todNanos,
("hours" .=) <$> _todHours,
("minutes" .=) <$> _todMinutes,
("seconds" .=) <$> _todSeconds])
data ErrorLogEntry = ErrorLogEntry'
{ _eleURL :: !(Maybe Text)
, _eleErrorDetails :: !(Maybe [Text])
} deriving (Eq,Show,Data,Typeable,Generic)
errorLogEntry
:: ErrorLogEntry
errorLogEntry =
ErrorLogEntry'
{ _eleURL = Nothing
, _eleErrorDetails = Nothing
}
eleURL :: Lens' ErrorLogEntry (Maybe Text)
eleURL = lens _eleURL (\ s a -> s{_eleURL = a})
eleErrorDetails :: Lens' ErrorLogEntry [Text]
eleErrorDetails
= lens _eleErrorDetails
(\ s a -> s{_eleErrorDetails = a})
. _Default
. _Coerce
instance FromJSON ErrorLogEntry where
parseJSON
= withObject "ErrorLogEntry"
(\ o ->
ErrorLogEntry' <$>
(o .:? "url") <*> (o .:? "errorDetails" .!= mempty))
instance ToJSON ErrorLogEntry where
toJSON ErrorLogEntry'{..}
= object
(catMaybes
[("url" .=) <$> _eleURL,
("errorDetails" .=) <$> _eleErrorDetails])
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
data TransferOptions = TransferOptions'
{ _toDeleteObjectsUniqueInSink :: !(Maybe Bool)
, _toDeleteObjectsFromSourceAfterTransfer :: !(Maybe Bool)
, _toOverwriteObjectsAlreadyExistingInSink :: !(Maybe Bool)
} deriving (Eq,Show,Data,Typeable,Generic)
transferOptions
:: TransferOptions
transferOptions =
TransferOptions'
{ _toDeleteObjectsUniqueInSink = Nothing
, _toDeleteObjectsFromSourceAfterTransfer = Nothing
, _toOverwriteObjectsAlreadyExistingInSink = Nothing
}
toDeleteObjectsUniqueInSink :: Lens' TransferOptions (Maybe Bool)
toDeleteObjectsUniqueInSink
= lens _toDeleteObjectsUniqueInSink
(\ s a -> s{_toDeleteObjectsUniqueInSink = a})
toDeleteObjectsFromSourceAfterTransfer :: Lens' TransferOptions (Maybe Bool)
toDeleteObjectsFromSourceAfterTransfer
= lens _toDeleteObjectsFromSourceAfterTransfer
(\ s a ->
s{_toDeleteObjectsFromSourceAfterTransfer = a})
toOverwriteObjectsAlreadyExistingInSink :: Lens' TransferOptions (Maybe Bool)
toOverwriteObjectsAlreadyExistingInSink
= lens _toOverwriteObjectsAlreadyExistingInSink
(\ s a ->
s{_toOverwriteObjectsAlreadyExistingInSink = a})
instance FromJSON TransferOptions where
parseJSON
= withObject "TransferOptions"
(\ o ->
TransferOptions' <$>
(o .:? "deleteObjectsUniqueInSink") <*>
(o .:? "deleteObjectsFromSourceAfterTransfer")
<*> (o .:? "overwriteObjectsAlreadyExistingInSink"))
instance ToJSON TransferOptions where
toJSON TransferOptions'{..}
= object
(catMaybes
[("deleteObjectsUniqueInSink" .=) <$>
_toDeleteObjectsUniqueInSink,
("deleteObjectsFromSourceAfterTransfer" .=) <$>
_toDeleteObjectsFromSourceAfterTransfer,
("overwriteObjectsAlreadyExistingInSink" .=) <$>
_toOverwriteObjectsAlreadyExistingInSink])
data TransferOperation = TransferOperation'
{ _toStatus :: !(Maybe TransferOperationStatus)
, _toCounters :: !(Maybe TransferCounters)
, _toStartTime :: !(Maybe DateTime')
, _toTransferJobName :: !(Maybe Text)
, _toName :: !(Maybe Text)
, _toEndTime :: !(Maybe DateTime')
, _toProjectId :: !(Maybe Text)
, _toTransferSpec :: !(Maybe TransferSpec)
, _toErrorBreakdowns :: !(Maybe [ErrorSummary])
} deriving (Eq,Show,Data,Typeable,Generic)
transferOperation
:: TransferOperation
transferOperation =
TransferOperation'
{ _toStatus = Nothing
, _toCounters = Nothing
, _toStartTime = Nothing
, _toTransferJobName = Nothing
, _toName = Nothing
, _toEndTime = Nothing
, _toProjectId = Nothing
, _toTransferSpec = Nothing
, _toErrorBreakdowns = Nothing
}
toStatus :: Lens' TransferOperation (Maybe TransferOperationStatus)
toStatus = lens _toStatus (\ s a -> s{_toStatus = a})
toCounters :: Lens' TransferOperation (Maybe TransferCounters)
toCounters
= lens _toCounters (\ s a -> s{_toCounters = a})
toStartTime :: Lens' TransferOperation (Maybe UTCTime)
toStartTime
= lens _toStartTime (\ s a -> s{_toStartTime = a}) .
mapping _DateTime
toTransferJobName :: Lens' TransferOperation (Maybe Text)
toTransferJobName
= lens _toTransferJobName
(\ s a -> s{_toTransferJobName = a})
toName :: Lens' TransferOperation (Maybe Text)
toName = lens _toName (\ s a -> s{_toName = a})
toEndTime :: Lens' TransferOperation (Maybe UTCTime)
toEndTime
= lens _toEndTime (\ s a -> s{_toEndTime = a}) .
mapping _DateTime
toProjectId :: Lens' TransferOperation (Maybe Text)
toProjectId
= lens _toProjectId (\ s a -> s{_toProjectId = a})
toTransferSpec :: Lens' TransferOperation (Maybe TransferSpec)
toTransferSpec
= lens _toTransferSpec
(\ s a -> s{_toTransferSpec = a})
toErrorBreakdowns :: Lens' TransferOperation [ErrorSummary]
toErrorBreakdowns
= lens _toErrorBreakdowns
(\ s a -> s{_toErrorBreakdowns = a})
. _Default
. _Coerce
instance FromJSON TransferOperation where
parseJSON
= withObject "TransferOperation"
(\ o ->
TransferOperation' <$>
(o .:? "status") <*> (o .:? "counters") <*>
(o .:? "startTime")
<*> (o .:? "transferJobName")
<*> (o .:? "name")
<*> (o .:? "endTime")
<*> (o .:? "projectId")
<*> (o .:? "transferSpec")
<*> (o .:? "errorBreakdowns" .!= mempty))
instance ToJSON TransferOperation where
toJSON TransferOperation'{..}
= object
(catMaybes
[("status" .=) <$> _toStatus,
("counters" .=) <$> _toCounters,
("startTime" .=) <$> _toStartTime,
("transferJobName" .=) <$> _toTransferJobName,
("name" .=) <$> _toName,
("endTime" .=) <$> _toEndTime,
("projectId" .=) <$> _toProjectId,
("transferSpec" .=) <$> _toTransferSpec,
("errorBreakdowns" .=) <$> _toErrorBreakdowns])
data TransferSpec = TransferSpec'
{ _tsGcsDataSource :: !(Maybe GcsData)
, _tsObjectConditions :: !(Maybe ObjectConditions)
, _tsHTTPDataSource :: !(Maybe HTTPData)
, _tsAwsS3DataSource :: !(Maybe AwsS3Data)
, _tsGcsDataSink :: !(Maybe GcsData)
, _tsTransferOptions :: !(Maybe TransferOptions)
} deriving (Eq,Show,Data,Typeable,Generic)
transferSpec
:: TransferSpec
transferSpec =
TransferSpec'
{ _tsGcsDataSource = Nothing
, _tsObjectConditions = Nothing
, _tsHTTPDataSource = Nothing
, _tsAwsS3DataSource = Nothing
, _tsGcsDataSink = Nothing
, _tsTransferOptions = Nothing
}
tsGcsDataSource :: Lens' TransferSpec (Maybe GcsData)
tsGcsDataSource
= lens _tsGcsDataSource
(\ s a -> s{_tsGcsDataSource = a})
tsObjectConditions :: Lens' TransferSpec (Maybe ObjectConditions)
tsObjectConditions
= lens _tsObjectConditions
(\ s a -> s{_tsObjectConditions = a})
tsHTTPDataSource :: Lens' TransferSpec (Maybe HTTPData)
tsHTTPDataSource
= lens _tsHTTPDataSource
(\ s a -> s{_tsHTTPDataSource = a})
tsAwsS3DataSource :: Lens' TransferSpec (Maybe AwsS3Data)
tsAwsS3DataSource
= lens _tsAwsS3DataSource
(\ s a -> s{_tsAwsS3DataSource = a})
tsGcsDataSink :: Lens' TransferSpec (Maybe GcsData)
tsGcsDataSink
= lens _tsGcsDataSink
(\ s a -> s{_tsGcsDataSink = a})
tsTransferOptions :: Lens' TransferSpec (Maybe TransferOptions)
tsTransferOptions
= lens _tsTransferOptions
(\ s a -> s{_tsTransferOptions = a})
instance FromJSON TransferSpec where
parseJSON
= withObject "TransferSpec"
(\ o ->
TransferSpec' <$>
(o .:? "gcsDataSource") <*>
(o .:? "objectConditions")
<*> (o .:? "httpDataSource")
<*> (o .:? "awsS3DataSource")
<*> (o .:? "gcsDataSink")
<*> (o .:? "transferOptions"))
instance ToJSON TransferSpec where
toJSON TransferSpec'{..}
= object
(catMaybes
[("gcsDataSource" .=) <$> _tsGcsDataSource,
("objectConditions" .=) <$> _tsObjectConditions,
("httpDataSource" .=) <$> _tsHTTPDataSource,
("awsS3DataSource" .=) <$> _tsAwsS3DataSource,
("gcsDataSink" .=) <$> _tsGcsDataSink,
("transferOptions" .=) <$> _tsTransferOptions])
data ListTransferJobsResponse = ListTransferJobsResponse'
{ _ltjrNextPageToken :: !(Maybe Text)
, _ltjrTransferJobs :: !(Maybe [TransferJob])
} deriving (Eq,Show,Data,Typeable,Generic)
listTransferJobsResponse
:: ListTransferJobsResponse
listTransferJobsResponse =
ListTransferJobsResponse'
{ _ltjrNextPageToken = Nothing
, _ltjrTransferJobs = Nothing
}
ltjrNextPageToken :: Lens' ListTransferJobsResponse (Maybe Text)
ltjrNextPageToken
= lens _ltjrNextPageToken
(\ s a -> s{_ltjrNextPageToken = a})
ltjrTransferJobs :: Lens' ListTransferJobsResponse [TransferJob]
ltjrTransferJobs
= lens _ltjrTransferJobs
(\ s a -> s{_ltjrTransferJobs = a})
. _Default
. _Coerce
instance FromJSON ListTransferJobsResponse where
parseJSON
= withObject "ListTransferJobsResponse"
(\ o ->
ListTransferJobsResponse' <$>
(o .:? "nextPageToken") <*>
(o .:? "transferJobs" .!= mempty))
instance ToJSON ListTransferJobsResponse where
toJSON ListTransferJobsResponse'{..}
= object
(catMaybes
[("nextPageToken" .=) <$> _ltjrNextPageToken,
("transferJobs" .=) <$> _ltjrTransferJobs])
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 ResumeTransferOperationRequest =
ResumeTransferOperationRequest'
deriving (Eq,Show,Data,Typeable,Generic)
resumeTransferOperationRequest
:: ResumeTransferOperationRequest
resumeTransferOperationRequest = ResumeTransferOperationRequest'
instance FromJSON ResumeTransferOperationRequest
where
parseJSON
= withObject "ResumeTransferOperationRequest"
(\ o -> pure ResumeTransferOperationRequest')
instance ToJSON ResumeTransferOperationRequest where
toJSON = const emptyObject
data AwsAccessKey = AwsAccessKey'
{ _aakSecretAccessKey :: !(Maybe Text)
, _aakAccessKeyId :: !(Maybe Text)
} deriving (Eq,Show,Data,Typeable,Generic)
awsAccessKey
:: AwsAccessKey
awsAccessKey =
AwsAccessKey'
{ _aakSecretAccessKey = Nothing
, _aakAccessKeyId = Nothing
}
aakSecretAccessKey :: Lens' AwsAccessKey (Maybe Text)
aakSecretAccessKey
= lens _aakSecretAccessKey
(\ s a -> s{_aakSecretAccessKey = a})
aakAccessKeyId :: Lens' AwsAccessKey (Maybe Text)
aakAccessKeyId
= lens _aakAccessKeyId
(\ s a -> s{_aakAccessKeyId = a})
instance FromJSON AwsAccessKey where
parseJSON
= withObject "AwsAccessKey"
(\ o ->
AwsAccessKey' <$>
(o .:? "secretAccessKey") <*> (o .:? "accessKeyId"))
instance ToJSON AwsAccessKey where
toJSON AwsAccessKey'{..}
= object
(catMaybes
[("secretAccessKey" .=) <$> _aakSecretAccessKey,
("accessKeyId" .=) <$> _aakAccessKeyId])