{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.AWS.Snowball.Types.Product where
import Network.AWS.Lens
import Network.AWS.Prelude
import Network.AWS.Snowball.Types.Sum
data Address = Address'
{ _aStreet3 :: !(Maybe Text)
, _aLandmark :: !(Maybe Text)
, _aPostalCode :: !(Maybe Text)
, _aCountry :: !(Maybe Text)
, _aStateOrProvince :: !(Maybe Text)
, _aStreet2 :: !(Maybe Text)
, _aAddressId :: !(Maybe Text)
, _aCity :: !(Maybe Text)
, _aPhoneNumber :: !(Maybe Text)
, _aCompany :: !(Maybe Text)
, _aName :: !(Maybe Text)
, _aPrefectureOrDistrict :: !(Maybe Text)
, _aStreet1 :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
address
:: Address
address =
Address'
{ _aStreet3 = Nothing
, _aLandmark = Nothing
, _aPostalCode = Nothing
, _aCountry = Nothing
, _aStateOrProvince = Nothing
, _aStreet2 = Nothing
, _aAddressId = Nothing
, _aCity = Nothing
, _aPhoneNumber = Nothing
, _aCompany = Nothing
, _aName = Nothing
, _aPrefectureOrDistrict = Nothing
, _aStreet1 = Nothing
}
aStreet3 :: Lens' Address (Maybe Text)
aStreet3 = lens _aStreet3 (\ s a -> s{_aStreet3 = a});
aLandmark :: Lens' Address (Maybe Text)
aLandmark = lens _aLandmark (\ s a -> s{_aLandmark = a});
aPostalCode :: Lens' Address (Maybe Text)
aPostalCode = lens _aPostalCode (\ s a -> s{_aPostalCode = a});
aCountry :: Lens' Address (Maybe Text)
aCountry = lens _aCountry (\ s a -> s{_aCountry = a});
aStateOrProvince :: Lens' Address (Maybe Text)
aStateOrProvince = lens _aStateOrProvince (\ s a -> s{_aStateOrProvince = a});
aStreet2 :: Lens' Address (Maybe Text)
aStreet2 = lens _aStreet2 (\ s a -> s{_aStreet2 = a});
aAddressId :: Lens' Address (Maybe Text)
aAddressId = lens _aAddressId (\ s a -> s{_aAddressId = a});
aCity :: Lens' Address (Maybe Text)
aCity = lens _aCity (\ s a -> s{_aCity = a});
aPhoneNumber :: Lens' Address (Maybe Text)
aPhoneNumber = lens _aPhoneNumber (\ s a -> s{_aPhoneNumber = a});
aCompany :: Lens' Address (Maybe Text)
aCompany = lens _aCompany (\ s a -> s{_aCompany = a});
aName :: Lens' Address (Maybe Text)
aName = lens _aName (\ s a -> s{_aName = a});
aPrefectureOrDistrict :: Lens' Address (Maybe Text)
aPrefectureOrDistrict = lens _aPrefectureOrDistrict (\ s a -> s{_aPrefectureOrDistrict = a});
aStreet1 :: Lens' Address (Maybe Text)
aStreet1 = lens _aStreet1 (\ s a -> s{_aStreet1 = a});
instance FromJSON Address where
parseJSON
= withObject "Address"
(\ x ->
Address' <$>
(x .:? "Street3") <*> (x .:? "Landmark") <*>
(x .:? "PostalCode")
<*> (x .:? "Country")
<*> (x .:? "StateOrProvince")
<*> (x .:? "Street2")
<*> (x .:? "AddressId")
<*> (x .:? "City")
<*> (x .:? "PhoneNumber")
<*> (x .:? "Company")
<*> (x .:? "Name")
<*> (x .:? "PrefectureOrDistrict")
<*> (x .:? "Street1"))
instance Hashable Address
instance NFData Address
instance ToJSON Address where
toJSON Address'{..}
= object
(catMaybes
[("Street3" .=) <$> _aStreet3,
("Landmark" .=) <$> _aLandmark,
("PostalCode" .=) <$> _aPostalCode,
("Country" .=) <$> _aCountry,
("StateOrProvince" .=) <$> _aStateOrProvince,
("Street2" .=) <$> _aStreet2,
("AddressId" .=) <$> _aAddressId,
("City" .=) <$> _aCity,
("PhoneNumber" .=) <$> _aPhoneNumber,
("Company" .=) <$> _aCompany, ("Name" .=) <$> _aName,
("PrefectureOrDistrict" .=) <$>
_aPrefectureOrDistrict,
("Street1" .=) <$> _aStreet1])
data DataTransfer = DataTransfer'
{ _dtTotalObjects :: !(Maybe Integer)
, _dtTotalBytes :: !(Maybe Integer)
, _dtObjectsTransferred :: !(Maybe Integer)
, _dtBytesTransferred :: !(Maybe Integer)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
dataTransfer
:: DataTransfer
dataTransfer =
DataTransfer'
{ _dtTotalObjects = Nothing
, _dtTotalBytes = Nothing
, _dtObjectsTransferred = Nothing
, _dtBytesTransferred = Nothing
}
dtTotalObjects :: Lens' DataTransfer (Maybe Integer)
dtTotalObjects = lens _dtTotalObjects (\ s a -> s{_dtTotalObjects = a});
dtTotalBytes :: Lens' DataTransfer (Maybe Integer)
dtTotalBytes = lens _dtTotalBytes (\ s a -> s{_dtTotalBytes = a});
dtObjectsTransferred :: Lens' DataTransfer (Maybe Integer)
dtObjectsTransferred = lens _dtObjectsTransferred (\ s a -> s{_dtObjectsTransferred = a});
dtBytesTransferred :: Lens' DataTransfer (Maybe Integer)
dtBytesTransferred = lens _dtBytesTransferred (\ s a -> s{_dtBytesTransferred = a});
instance FromJSON DataTransfer where
parseJSON
= withObject "DataTransfer"
(\ x ->
DataTransfer' <$>
(x .:? "TotalObjects") <*> (x .:? "TotalBytes") <*>
(x .:? "ObjectsTransferred")
<*> (x .:? "BytesTransferred"))
instance Hashable DataTransfer
instance NFData DataTransfer
data JobListEntry = JobListEntry'
{ _jleJobId :: !(Maybe Text)
, _jleJobState :: !(Maybe JobState)
, _jleIsMaster :: !(Maybe Bool)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
jobListEntry
:: JobListEntry
jobListEntry =
JobListEntry'
{ _jleJobId = Nothing
, _jleJobState = Nothing
, _jleIsMaster = Nothing
}
jleJobId :: Lens' JobListEntry (Maybe Text)
jleJobId = lens _jleJobId (\ s a -> s{_jleJobId = a});
jleJobState :: Lens' JobListEntry (Maybe JobState)
jleJobState = lens _jleJobState (\ s a -> s{_jleJobState = a});
jleIsMaster :: Lens' JobListEntry (Maybe Bool)
jleIsMaster = lens _jleIsMaster (\ s a -> s{_jleIsMaster = a});
instance FromJSON JobListEntry where
parseJSON
= withObject "JobListEntry"
(\ x ->
JobListEntry' <$>
(x .:? "JobId") <*> (x .:? "JobState") <*>
(x .:? "IsMaster"))
instance Hashable JobListEntry
instance NFData JobListEntry
data JobLogs = JobLogs'
{ _jlJobFailureLogURI :: !(Maybe Text)
, _jlJobCompletionReportURI :: !(Maybe Text)
, _jlJobSuccessLogURI :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
jobLogs
:: JobLogs
jobLogs =
JobLogs'
{ _jlJobFailureLogURI = Nothing
, _jlJobCompletionReportURI = Nothing
, _jlJobSuccessLogURI = Nothing
}
jlJobFailureLogURI :: Lens' JobLogs (Maybe Text)
jlJobFailureLogURI = lens _jlJobFailureLogURI (\ s a -> s{_jlJobFailureLogURI = a});
jlJobCompletionReportURI :: Lens' JobLogs (Maybe Text)
jlJobCompletionReportURI = lens _jlJobCompletionReportURI (\ s a -> s{_jlJobCompletionReportURI = a});
jlJobSuccessLogURI :: Lens' JobLogs (Maybe Text)
jlJobSuccessLogURI = lens _jlJobSuccessLogURI (\ s a -> s{_jlJobSuccessLogURI = a});
instance FromJSON JobLogs where
parseJSON
= withObject "JobLogs"
(\ x ->
JobLogs' <$>
(x .:? "JobFailureLogURI") <*>
(x .:? "JobCompletionReportURI")
<*> (x .:? "JobSuccessLogURI"))
instance Hashable JobLogs
instance NFData JobLogs
data JobMetadata = JobMetadata'
{ _jmJobType :: !(Maybe JobType)
, _jmKMSKeyARN :: !(Maybe Text)
, _jmJobId :: !(Maybe Text)
, _jmJobLogInfo :: !(Maybe JobLogs)
, _jmNotification :: !(Maybe Notification)
, _jmJobState :: !(Maybe JobState)
, _jmShippingDetails :: !(Maybe ShippingDetails)
, _jmAddressId :: !(Maybe Text)
, _jmDataTransferProgress :: !(Maybe DataTransfer)
, _jmResources :: !(Maybe JobResource)
, _jmCreationDate :: !(Maybe POSIX)
, _jmDescription :: !(Maybe Text)
, _jmRoleARN :: !(Maybe Text)
, _jmSnowballCapacityPreference :: !(Maybe SnowballCapacity)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
jobMetadata
:: JobMetadata
jobMetadata =
JobMetadata'
{ _jmJobType = Nothing
, _jmKMSKeyARN = Nothing
, _jmJobId = Nothing
, _jmJobLogInfo = Nothing
, _jmNotification = Nothing
, _jmJobState = Nothing
, _jmShippingDetails = Nothing
, _jmAddressId = Nothing
, _jmDataTransferProgress = Nothing
, _jmResources = Nothing
, _jmCreationDate = Nothing
, _jmDescription = Nothing
, _jmRoleARN = Nothing
, _jmSnowballCapacityPreference = Nothing
}
jmJobType :: Lens' JobMetadata (Maybe JobType)
jmJobType = lens _jmJobType (\ s a -> s{_jmJobType = a});
jmKMSKeyARN :: Lens' JobMetadata (Maybe Text)
jmKMSKeyARN = lens _jmKMSKeyARN (\ s a -> s{_jmKMSKeyARN = a});
jmJobId :: Lens' JobMetadata (Maybe Text)
jmJobId = lens _jmJobId (\ s a -> s{_jmJobId = a});
jmJobLogInfo :: Lens' JobMetadata (Maybe JobLogs)
jmJobLogInfo = lens _jmJobLogInfo (\ s a -> s{_jmJobLogInfo = a});
jmNotification :: Lens' JobMetadata (Maybe Notification)
jmNotification = lens _jmNotification (\ s a -> s{_jmNotification = a});
jmJobState :: Lens' JobMetadata (Maybe JobState)
jmJobState = lens _jmJobState (\ s a -> s{_jmJobState = a});
jmShippingDetails :: Lens' JobMetadata (Maybe ShippingDetails)
jmShippingDetails = lens _jmShippingDetails (\ s a -> s{_jmShippingDetails = a});
jmAddressId :: Lens' JobMetadata (Maybe Text)
jmAddressId = lens _jmAddressId (\ s a -> s{_jmAddressId = a});
jmDataTransferProgress :: Lens' JobMetadata (Maybe DataTransfer)
jmDataTransferProgress = lens _jmDataTransferProgress (\ s a -> s{_jmDataTransferProgress = a});
jmResources :: Lens' JobMetadata (Maybe JobResource)
jmResources = lens _jmResources (\ s a -> s{_jmResources = a});
jmCreationDate :: Lens' JobMetadata (Maybe UTCTime)
jmCreationDate = lens _jmCreationDate (\ s a -> s{_jmCreationDate = a}) . mapping _Time;
jmDescription :: Lens' JobMetadata (Maybe Text)
jmDescription = lens _jmDescription (\ s a -> s{_jmDescription = a});
jmRoleARN :: Lens' JobMetadata (Maybe Text)
jmRoleARN = lens _jmRoleARN (\ s a -> s{_jmRoleARN = a});
jmSnowballCapacityPreference :: Lens' JobMetadata (Maybe SnowballCapacity)
jmSnowballCapacityPreference = lens _jmSnowballCapacityPreference (\ s a -> s{_jmSnowballCapacityPreference = a});
instance FromJSON JobMetadata where
parseJSON
= withObject "JobMetadata"
(\ x ->
JobMetadata' <$>
(x .:? "JobType") <*> (x .:? "KmsKeyARN") <*>
(x .:? "JobId")
<*> (x .:? "JobLogInfo")
<*> (x .:? "Notification")
<*> (x .:? "JobState")
<*> (x .:? "ShippingDetails")
<*> (x .:? "AddressId")
<*> (x .:? "DataTransferProgress")
<*> (x .:? "Resources")
<*> (x .:? "CreationDate")
<*> (x .:? "Description")
<*> (x .:? "RoleARN")
<*> (x .:? "SnowballCapacityPreference"))
instance Hashable JobMetadata
instance NFData JobMetadata
newtype JobResource = JobResource'
{ _jrS3Resources :: Maybe [S3Resource]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
jobResource
:: JobResource
jobResource =
JobResource'
{ _jrS3Resources = Nothing
}
jrS3Resources :: Lens' JobResource [S3Resource]
jrS3Resources = lens _jrS3Resources (\ s a -> s{_jrS3Resources = a}) . _Default . _Coerce;
instance FromJSON JobResource where
parseJSON
= withObject "JobResource"
(\ x ->
JobResource' <$> (x .:? "S3Resources" .!= mempty))
instance Hashable JobResource
instance NFData JobResource
instance ToJSON JobResource where
toJSON JobResource'{..}
= object
(catMaybes [("S3Resources" .=) <$> _jrS3Resources])
data KeyRange = KeyRange'
{ _krEndMarker :: !(Maybe Text)
, _krBeginMarker :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
keyRange
:: KeyRange
keyRange =
KeyRange'
{ _krEndMarker = Nothing
, _krBeginMarker = Nothing
}
krEndMarker :: Lens' KeyRange (Maybe Text)
krEndMarker = lens _krEndMarker (\ s a -> s{_krEndMarker = a});
krBeginMarker :: Lens' KeyRange (Maybe Text)
krBeginMarker = lens _krBeginMarker (\ s a -> s{_krBeginMarker = a});
instance FromJSON KeyRange where
parseJSON
= withObject "KeyRange"
(\ x ->
KeyRange' <$>
(x .:? "EndMarker") <*> (x .:? "BeginMarker"))
instance Hashable KeyRange
instance NFData KeyRange
instance ToJSON KeyRange where
toJSON KeyRange'{..}
= object
(catMaybes
[("EndMarker" .=) <$> _krEndMarker,
("BeginMarker" .=) <$> _krBeginMarker])
data Notification = Notification'
{ _nNotifyAll :: !(Maybe Bool)
, _nSNSTopicARN :: !(Maybe Text)
, _nJobStatesToNotify :: !(Maybe [JobState])
} deriving (Eq,Read,Show,Data,Typeable,Generic)
notification
:: Notification
notification =
Notification'
{ _nNotifyAll = Nothing
, _nSNSTopicARN = Nothing
, _nJobStatesToNotify = Nothing
}
nNotifyAll :: Lens' Notification (Maybe Bool)
nNotifyAll = lens _nNotifyAll (\ s a -> s{_nNotifyAll = a});
nSNSTopicARN :: Lens' Notification (Maybe Text)
nSNSTopicARN = lens _nSNSTopicARN (\ s a -> s{_nSNSTopicARN = a});
nJobStatesToNotify :: Lens' Notification [JobState]
nJobStatesToNotify = lens _nJobStatesToNotify (\ s a -> s{_nJobStatesToNotify = a}) . _Default . _Coerce;
instance FromJSON Notification where
parseJSON
= withObject "Notification"
(\ x ->
Notification' <$>
(x .:? "NotifyAll") <*> (x .:? "SnsTopicARN") <*>
(x .:? "JobStatesToNotify" .!= mempty))
instance Hashable Notification
instance NFData Notification
instance ToJSON Notification where
toJSON Notification'{..}
= object
(catMaybes
[("NotifyAll" .=) <$> _nNotifyAll,
("SnsTopicARN" .=) <$> _nSNSTopicARN,
("JobStatesToNotify" .=) <$> _nJobStatesToNotify])
data S3Resource = S3Resource'
{ _srKeyRange :: !(Maybe KeyRange)
, _srBucketARN :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
s3Resource
:: S3Resource
s3Resource =
S3Resource'
{ _srKeyRange = Nothing
, _srBucketARN = Nothing
}
srKeyRange :: Lens' S3Resource (Maybe KeyRange)
srKeyRange = lens _srKeyRange (\ s a -> s{_srKeyRange = a});
srBucketARN :: Lens' S3Resource (Maybe Text)
srBucketARN = lens _srBucketARN (\ s a -> s{_srBucketARN = a});
instance FromJSON S3Resource where
parseJSON
= withObject "S3Resource"
(\ x ->
S3Resource' <$>
(x .:? "KeyRange") <*> (x .:? "BucketArn"))
instance Hashable S3Resource
instance NFData S3Resource
instance ToJSON S3Resource where
toJSON S3Resource'{..}
= object
(catMaybes
[("KeyRange" .=) <$> _srKeyRange,
("BucketArn" .=) <$> _srBucketARN])
data Shipment = Shipment'
{ _sStatus :: !(Maybe Text)
, _sTrackingNumber :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
shipment
:: Shipment
shipment =
Shipment'
{ _sStatus = Nothing
, _sTrackingNumber = Nothing
}
sStatus :: Lens' Shipment (Maybe Text)
sStatus = lens _sStatus (\ s a -> s{_sStatus = a});
sTrackingNumber :: Lens' Shipment (Maybe Text)
sTrackingNumber = lens _sTrackingNumber (\ s a -> s{_sTrackingNumber = a});
instance FromJSON Shipment where
parseJSON
= withObject "Shipment"
(\ x ->
Shipment' <$>
(x .:? "Status") <*> (x .:? "TrackingNumber"))
instance Hashable Shipment
instance NFData Shipment
data ShippingDetails = ShippingDetails'
{ _sdShippingOption :: !(Maybe ShippingOption)
, _sdOutboundShipment :: !(Maybe Shipment)
, _sdInboundShipment :: !(Maybe Shipment)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
shippingDetails
:: ShippingDetails
shippingDetails =
ShippingDetails'
{ _sdShippingOption = Nothing
, _sdOutboundShipment = Nothing
, _sdInboundShipment = Nothing
}
sdShippingOption :: Lens' ShippingDetails (Maybe ShippingOption)
sdShippingOption = lens _sdShippingOption (\ s a -> s{_sdShippingOption = a});
sdOutboundShipment :: Lens' ShippingDetails (Maybe Shipment)
sdOutboundShipment = lens _sdOutboundShipment (\ s a -> s{_sdOutboundShipment = a});
sdInboundShipment :: Lens' ShippingDetails (Maybe Shipment)
sdInboundShipment = lens _sdInboundShipment (\ s a -> s{_sdInboundShipment = a});
instance FromJSON ShippingDetails where
parseJSON
= withObject "ShippingDetails"
(\ x ->
ShippingDetails' <$>
(x .:? "ShippingOption") <*>
(x .:? "OutboundShipment")
<*> (x .:? "InboundShipment"))
instance Hashable ShippingDetails
instance NFData ShippingDetails