{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.AWS.MediaStoreData.Types.Product where
import Network.AWS.Lens
import Network.AWS.MediaStoreData.Types.Sum
import Network.AWS.Prelude
data Item = Item'
{ _iETag :: !(Maybe Text)
, _iContentLength :: !(Maybe Nat)
, _iName :: !(Maybe Text)
, _iType :: !(Maybe ItemType)
, _iLastModified :: !(Maybe POSIX)
, _iContentType :: !(Maybe Text)
} deriving (Eq, Read, Show, Data, Typeable, Generic)
item
:: Item
item =
Item'
{ _iETag = Nothing
, _iContentLength = Nothing
, _iName = Nothing
, _iType = Nothing
, _iLastModified = Nothing
, _iContentType = Nothing
}
iETag :: Lens' Item (Maybe Text)
iETag = lens _iETag (\ s a -> s{_iETag = a})
iContentLength :: Lens' Item (Maybe Natural)
iContentLength = lens _iContentLength (\ s a -> s{_iContentLength = a}) . mapping _Nat
iName :: Lens' Item (Maybe Text)
iName = lens _iName (\ s a -> s{_iName = a})
iType :: Lens' Item (Maybe ItemType)
iType = lens _iType (\ s a -> s{_iType = a})
iLastModified :: Lens' Item (Maybe UTCTime)
iLastModified = lens _iLastModified (\ s a -> s{_iLastModified = a}) . mapping _Time
iContentType :: Lens' Item (Maybe Text)
iContentType = lens _iContentType (\ s a -> s{_iContentType = a})
instance FromJSON Item where
parseJSON
= withObject "Item"
(\ x ->
Item' <$>
(x .:? "ETag") <*> (x .:? "ContentLength") <*>
(x .:? "Name")
<*> (x .:? "Type")
<*> (x .:? "LastModified")
<*> (x .:? "ContentType"))
instance Hashable Item where
instance NFData Item where