module Network.AWS.S3.Types.Product where
import Network.AWS.Prelude
import Network.AWS.S3.Internal
import Network.AWS.S3.Types.Sum
data AccessControlPolicy = AccessControlPolicy'
{ _acpGrants :: !(Maybe [Grant])
, _acpOwner :: !(Maybe Owner)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
accessControlPolicy
:: AccessControlPolicy
accessControlPolicy =
AccessControlPolicy'
{ _acpGrants = Nothing
, _acpOwner = Nothing
}
acpGrants :: Lens' AccessControlPolicy [Grant]
acpGrants = lens _acpGrants (\ s a -> s{_acpGrants = a}) . _Default . _Coerce;
acpOwner :: Lens' AccessControlPolicy (Maybe Owner)
acpOwner = lens _acpOwner (\ s a -> s{_acpOwner = a});
instance ToXML AccessControlPolicy where
toXML AccessControlPolicy'{..}
= mconcat
["AccessControlList" @=
toXML (toXMLList "Grant" <$> _acpGrants),
"Owner" @= _acpOwner]
data Bucket = Bucket'
{ _bCreationDate :: !RFC822
, _bName :: !BucketName
} deriving (Eq,Read,Show,Data,Typeable,Generic)
bucket
:: UTCTime
-> BucketName
-> Bucket
bucket pCreationDate_ pName_ =
Bucket'
{ _bCreationDate = _Time # pCreationDate_
, _bName = pName_
}
bCreationDate :: Lens' Bucket UTCTime
bCreationDate = lens _bCreationDate (\ s a -> s{_bCreationDate = a}) . _Time;
bName :: Lens' Bucket BucketName
bName = lens _bName (\ s a -> s{_bName = a});
instance FromXML Bucket where
parseXML x
= Bucket' <$> (x .@ "CreationDate") <*> (x .@ "Name")
newtype BucketLifecycleConfiguration = BucketLifecycleConfiguration'
{ _blcRules :: [LifecycleRule]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
bucketLifecycleConfiguration
:: BucketLifecycleConfiguration
bucketLifecycleConfiguration =
BucketLifecycleConfiguration'
{ _blcRules = mempty
}
blcRules :: Lens' BucketLifecycleConfiguration [LifecycleRule]
blcRules = lens _blcRules (\ s a -> s{_blcRules = a}) . _Coerce;
instance ToXML BucketLifecycleConfiguration where
toXML BucketLifecycleConfiguration'{..}
= mconcat [toXMLList "Rule" _blcRules]
newtype BucketLoggingStatus = BucketLoggingStatus'
{ _blsLoggingEnabled :: Maybe LoggingEnabled
} deriving (Eq,Read,Show,Data,Typeable,Generic)
bucketLoggingStatus
:: BucketLoggingStatus
bucketLoggingStatus =
BucketLoggingStatus'
{ _blsLoggingEnabled = Nothing
}
blsLoggingEnabled :: Lens' BucketLoggingStatus (Maybe LoggingEnabled)
blsLoggingEnabled = lens _blsLoggingEnabled (\ s a -> s{_blsLoggingEnabled = a});
instance ToXML BucketLoggingStatus where
toXML BucketLoggingStatus'{..}
= mconcat ["LoggingEnabled" @= _blsLoggingEnabled]
newtype CORSConfiguration = CORSConfiguration'
{ _ccCORSRules :: [CORSRule]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
corsConfiguration
:: CORSConfiguration
corsConfiguration =
CORSConfiguration'
{ _ccCORSRules = mempty
}
ccCORSRules :: Lens' CORSConfiguration [CORSRule]
ccCORSRules = lens _ccCORSRules (\ s a -> s{_ccCORSRules = a}) . _Coerce;
instance ToXML CORSConfiguration where
toXML CORSConfiguration'{..}
= mconcat [toXMLList "CORSRule" _ccCORSRules]
data CORSRule = CORSRule'
{ _crMaxAgeSeconds :: !(Maybe Int)
, _crAllowedHeaders :: !(Maybe [Text])
, _crExposeHeaders :: !(Maybe [Text])
, _crAllowedMethods :: ![Text]
, _crAllowedOrigins :: ![Text]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
corsRule
:: CORSRule
corsRule =
CORSRule'
{ _crMaxAgeSeconds = Nothing
, _crAllowedHeaders = Nothing
, _crExposeHeaders = Nothing
, _crAllowedMethods = mempty
, _crAllowedOrigins = mempty
}
crMaxAgeSeconds :: Lens' CORSRule (Maybe Int)
crMaxAgeSeconds = lens _crMaxAgeSeconds (\ s a -> s{_crMaxAgeSeconds = a});
crAllowedHeaders :: Lens' CORSRule [Text]
crAllowedHeaders = lens _crAllowedHeaders (\ s a -> s{_crAllowedHeaders = a}) . _Default . _Coerce;
crExposeHeaders :: Lens' CORSRule [Text]
crExposeHeaders = lens _crExposeHeaders (\ s a -> s{_crExposeHeaders = a}) . _Default . _Coerce;
crAllowedMethods :: Lens' CORSRule [Text]
crAllowedMethods = lens _crAllowedMethods (\ s a -> s{_crAllowedMethods = a}) . _Coerce;
crAllowedOrigins :: Lens' CORSRule [Text]
crAllowedOrigins = lens _crAllowedOrigins (\ s a -> s{_crAllowedOrigins = a}) . _Coerce;
instance FromXML CORSRule where
parseXML x
= CORSRule' <$>
(x .@? "MaxAgeSeconds") <*>
(may (parseXMLList "AllowedHeader") x)
<*> (may (parseXMLList "ExposeHeader") x)
<*> (parseXMLList "AllowedMethod" x)
<*> (parseXMLList "AllowedOrigin" x)
instance ToXML CORSRule where
toXML CORSRule'{..}
= mconcat
["MaxAgeSeconds" @= _crMaxAgeSeconds,
toXML
(toXMLList "AllowedHeader" <$> _crAllowedHeaders),
toXML
(toXMLList "ExposeHeader" <$> _crExposeHeaders),
toXMLList "AllowedMethod" _crAllowedMethods,
toXMLList "AllowedOrigin" _crAllowedOrigins]
newtype CommonPrefix = CommonPrefix'
{ _cpPrefix :: Maybe Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
commonPrefix
:: CommonPrefix
commonPrefix =
CommonPrefix'
{ _cpPrefix = Nothing
}
cpPrefix :: Lens' CommonPrefix (Maybe Text)
cpPrefix = lens _cpPrefix (\ s a -> s{_cpPrefix = a});
instance FromXML CommonPrefix where
parseXML x = CommonPrefix' <$> (x .@? "Prefix")
newtype CompletedMultipartUpload = CompletedMultipartUpload'
{ _cmuParts :: Maybe (List1 CompletedPart)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
completedMultipartUpload
:: CompletedMultipartUpload
completedMultipartUpload =
CompletedMultipartUpload'
{ _cmuParts = Nothing
}
cmuParts :: Lens' CompletedMultipartUpload (Maybe (NonEmpty CompletedPart))
cmuParts = lens _cmuParts (\ s a -> s{_cmuParts = a}) . mapping _List1;
instance ToXML CompletedMultipartUpload where
toXML CompletedMultipartUpload'{..}
= mconcat [toXML (toXMLList "Part" <$> _cmuParts)]
data CompletedPart = CompletedPart'
{ _cpPartNumber :: !Int
, _cpETag :: !ETag
} deriving (Eq,Read,Show,Data,Typeable,Generic)
completedPart
:: Int
-> ETag
-> CompletedPart
completedPart pPartNumber_ pETag_ =
CompletedPart'
{ _cpPartNumber = pPartNumber_
, _cpETag = pETag_
}
cpPartNumber :: Lens' CompletedPart Int
cpPartNumber = lens _cpPartNumber (\ s a -> s{_cpPartNumber = a});
cpETag :: Lens' CompletedPart ETag
cpETag = lens _cpETag (\ s a -> s{_cpETag = a});
instance ToXML CompletedPart where
toXML CompletedPart'{..}
= mconcat
["PartNumber" @= _cpPartNumber, "ETag" @= _cpETag]
data Condition = Condition'
{ _cKeyPrefixEquals :: !(Maybe Text)
, _cHTTPErrorCodeReturnedEquals :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
condition
:: Condition
condition =
Condition'
{ _cKeyPrefixEquals = Nothing
, _cHTTPErrorCodeReturnedEquals = Nothing
}
cKeyPrefixEquals :: Lens' Condition (Maybe Text)
cKeyPrefixEquals = lens _cKeyPrefixEquals (\ s a -> s{_cKeyPrefixEquals = a});
cHTTPErrorCodeReturnedEquals :: Lens' Condition (Maybe Text)
cHTTPErrorCodeReturnedEquals = lens _cHTTPErrorCodeReturnedEquals (\ s a -> s{_cHTTPErrorCodeReturnedEquals = a});
instance FromXML Condition where
parseXML x
= Condition' <$>
(x .@? "KeyPrefixEquals") <*>
(x .@? "HttpErrorCodeReturnedEquals")
instance ToXML Condition where
toXML Condition'{..}
= mconcat
["KeyPrefixEquals" @= _cKeyPrefixEquals,
"HttpErrorCodeReturnedEquals" @=
_cHTTPErrorCodeReturnedEquals]
data CopyObjectResult = CopyObjectResult'
{ _corETag :: !(Maybe ETag)
, _corLastModified :: !(Maybe RFC822)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
copyObjectResult
:: CopyObjectResult
copyObjectResult =
CopyObjectResult'
{ _corETag = Nothing
, _corLastModified = Nothing
}
corETag :: Lens' CopyObjectResult (Maybe ETag)
corETag = lens _corETag (\ s a -> s{_corETag = a});
corLastModified :: Lens' CopyObjectResult (Maybe UTCTime)
corLastModified = lens _corLastModified (\ s a -> s{_corLastModified = a}) . mapping _Time;
instance FromXML CopyObjectResult where
parseXML x
= CopyObjectResult' <$>
(x .@? "ETag") <*> (x .@? "LastModified")
data CopyPartResult = CopyPartResult'
{ _cprETag :: !(Maybe ETag)
, _cprLastModified :: !(Maybe RFC822)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
copyPartResult
:: CopyPartResult
copyPartResult =
CopyPartResult'
{ _cprETag = Nothing
, _cprLastModified = Nothing
}
cprETag :: Lens' CopyPartResult (Maybe ETag)
cprETag = lens _cprETag (\ s a -> s{_cprETag = a});
cprLastModified :: Lens' CopyPartResult (Maybe UTCTime)
cprLastModified = lens _cprLastModified (\ s a -> s{_cprLastModified = a}) . mapping _Time;
instance FromXML CopyPartResult where
parseXML x
= CopyPartResult' <$>
(x .@? "ETag") <*> (x .@? "LastModified")
newtype CreateBucketConfiguration = CreateBucketConfiguration'
{ _cbcLocationConstraint :: Maybe Region
} deriving (Eq,Read,Show,Data,Typeable,Generic)
createBucketConfiguration
:: CreateBucketConfiguration
createBucketConfiguration =
CreateBucketConfiguration'
{ _cbcLocationConstraint = Nothing
}
cbcLocationConstraint :: Lens' CreateBucketConfiguration (Maybe Region)
cbcLocationConstraint = lens _cbcLocationConstraint (\ s a -> s{_cbcLocationConstraint = a});
instance ToXML CreateBucketConfiguration where
toXML CreateBucketConfiguration'{..}
= mconcat
["LocationConstraint" @= _cbcLocationConstraint]
data Delete = Delete'
{ _dQuiet :: !(Maybe Bool)
, _dObjects :: ![ObjectIdentifier]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
delete'
:: Delete
delete' =
Delete'
{ _dQuiet = Nothing
, _dObjects = mempty
}
dQuiet :: Lens' Delete (Maybe Bool)
dQuiet = lens _dQuiet (\ s a -> s{_dQuiet = a});
dObjects :: Lens' Delete [ObjectIdentifier]
dObjects = lens _dObjects (\ s a -> s{_dObjects = a}) . _Coerce;
instance ToXML Delete where
toXML Delete'{..}
= mconcat
["Quiet" @= _dQuiet, toXMLList "Object" _dObjects]
data DeleteMarkerEntry = DeleteMarkerEntry'
{ _dmeVersionId :: !(Maybe ObjectVersionId)
, _dmeIsLatest :: !(Maybe Bool)
, _dmeOwner :: !(Maybe Owner)
, _dmeKey :: !(Maybe ObjectKey)
, _dmeLastModified :: !(Maybe RFC822)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deleteMarkerEntry
:: DeleteMarkerEntry
deleteMarkerEntry =
DeleteMarkerEntry'
{ _dmeVersionId = Nothing
, _dmeIsLatest = Nothing
, _dmeOwner = Nothing
, _dmeKey = Nothing
, _dmeLastModified = Nothing
}
dmeVersionId :: Lens' DeleteMarkerEntry (Maybe ObjectVersionId)
dmeVersionId = lens _dmeVersionId (\ s a -> s{_dmeVersionId = a});
dmeIsLatest :: Lens' DeleteMarkerEntry (Maybe Bool)
dmeIsLatest = lens _dmeIsLatest (\ s a -> s{_dmeIsLatest = a});
dmeOwner :: Lens' DeleteMarkerEntry (Maybe Owner)
dmeOwner = lens _dmeOwner (\ s a -> s{_dmeOwner = a});
dmeKey :: Lens' DeleteMarkerEntry (Maybe ObjectKey)
dmeKey = lens _dmeKey (\ s a -> s{_dmeKey = a});
dmeLastModified :: Lens' DeleteMarkerEntry (Maybe UTCTime)
dmeLastModified = lens _dmeLastModified (\ s a -> s{_dmeLastModified = a}) . mapping _Time;
instance FromXML DeleteMarkerEntry where
parseXML x
= DeleteMarkerEntry' <$>
(x .@? "VersionId") <*> (x .@? "IsLatest") <*>
(x .@? "Owner")
<*> (x .@? "Key")
<*> (x .@? "LastModified")
data DeletedObject = DeletedObject'
{ _dVersionId :: !(Maybe ObjectVersionId)
, _dDeleteMarker :: !(Maybe Bool)
, _dDeleteMarkerVersionId :: !(Maybe Text)
, _dKey :: !(Maybe ObjectKey)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
deletedObject
:: DeletedObject
deletedObject =
DeletedObject'
{ _dVersionId = Nothing
, _dDeleteMarker = Nothing
, _dDeleteMarkerVersionId = Nothing
, _dKey = Nothing
}
dVersionId :: Lens' DeletedObject (Maybe ObjectVersionId)
dVersionId = lens _dVersionId (\ s a -> s{_dVersionId = a});
dDeleteMarker :: Lens' DeletedObject (Maybe Bool)
dDeleteMarker = lens _dDeleteMarker (\ s a -> s{_dDeleteMarker = a});
dDeleteMarkerVersionId :: Lens' DeletedObject (Maybe Text)
dDeleteMarkerVersionId = lens _dDeleteMarkerVersionId (\ s a -> s{_dDeleteMarkerVersionId = a});
dKey :: Lens' DeletedObject (Maybe ObjectKey)
dKey = lens _dKey (\ s a -> s{_dKey = a});
instance FromXML DeletedObject where
parseXML x
= DeletedObject' <$>
(x .@? "VersionId") <*> (x .@? "DeleteMarker") <*>
(x .@? "DeleteMarkerVersionId")
<*> (x .@? "Key")
data Destination = Destination'
{ _dStorageClass :: !(Maybe StorageClass)
, _dBucket :: !BucketName
} deriving (Eq,Read,Show,Data,Typeable,Generic)
destination
:: BucketName
-> Destination
destination pBucket_ =
Destination'
{ _dStorageClass = Nothing
, _dBucket = pBucket_
}
dStorageClass :: Lens' Destination (Maybe StorageClass)
dStorageClass = lens _dStorageClass (\ s a -> s{_dStorageClass = a});
dBucket :: Lens' Destination BucketName
dBucket = lens _dBucket (\ s a -> s{_dBucket = a});
instance FromXML Destination where
parseXML x
= Destination' <$>
(x .@? "StorageClass") <*> (x .@ "Bucket")
instance ToXML Destination where
toXML Destination'{..}
= mconcat
["StorageClass" @= _dStorageClass,
"Bucket" @= _dBucket]
newtype ErrorDocument = ErrorDocument'
{ _edKey :: ObjectKey
} deriving (Eq,Read,Show,Data,Typeable,Generic)
errorDocument
:: ObjectKey
-> ErrorDocument
errorDocument pKey_ =
ErrorDocument'
{ _edKey = pKey_
}
edKey :: Lens' ErrorDocument ObjectKey
edKey = lens _edKey (\ s a -> s{_edKey = a});
instance FromXML ErrorDocument where
parseXML x = ErrorDocument' <$> (x .@ "Key")
instance ToXML ErrorDocument where
toXML ErrorDocument'{..} = mconcat ["Key" @= _edKey]
data FilterRule = FilterRule'
{ _frValue :: !(Maybe Text)
, _frName :: !(Maybe FilterRuleName)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
filterRule
:: FilterRule
filterRule =
FilterRule'
{ _frValue = Nothing
, _frName = Nothing
}
frValue :: Lens' FilterRule (Maybe Text)
frValue = lens _frValue (\ s a -> s{_frValue = a});
frName :: Lens' FilterRule (Maybe FilterRuleName)
frName = lens _frName (\ s a -> s{_frName = a});
instance FromXML FilterRule where
parseXML x
= FilterRule' <$> (x .@? "Value") <*> (x .@? "Name")
instance ToXML FilterRule where
toXML FilterRule'{..}
= mconcat ["Value" @= _frValue, "Name" @= _frName]
data Grant = Grant'
{ _gPermission :: !(Maybe Permission)
, _gGrantee :: !(Maybe Grantee)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
grant
:: Grant
grant =
Grant'
{ _gPermission = Nothing
, _gGrantee = Nothing
}
gPermission :: Lens' Grant (Maybe Permission)
gPermission = lens _gPermission (\ s a -> s{_gPermission = a});
gGrantee :: Lens' Grant (Maybe Grantee)
gGrantee = lens _gGrantee (\ s a -> s{_gGrantee = a});
instance FromXML Grant where
parseXML x
= Grant' <$>
(x .@? "Permission") <*> (x .@? "Grantee")
instance ToXML Grant where
toXML Grant'{..}
= mconcat
["Permission" @= _gPermission,
"Grantee" @= _gGrantee]
data Grantee = Grantee'
{ _gURI :: !(Maybe Text)
, _gEmailAddress :: !(Maybe Text)
, _gDisplayName :: !(Maybe Text)
, _gId :: !(Maybe Text)
, _gType :: !Type
} deriving (Eq,Read,Show,Data,Typeable,Generic)
grantee
:: Type
-> Grantee
grantee pType_ =
Grantee'
{ _gURI = Nothing
, _gEmailAddress = Nothing
, _gDisplayName = Nothing
, _gId = Nothing
, _gType = pType_
}
gURI :: Lens' Grantee (Maybe Text)
gURI = lens _gURI (\ s a -> s{_gURI = a});
gEmailAddress :: Lens' Grantee (Maybe Text)
gEmailAddress = lens _gEmailAddress (\ s a -> s{_gEmailAddress = a});
gDisplayName :: Lens' Grantee (Maybe Text)
gDisplayName = lens _gDisplayName (\ s a -> s{_gDisplayName = a});
gId :: Lens' Grantee (Maybe Text)
gId = lens _gId (\ s a -> s{_gId = a});
gType :: Lens' Grantee Type
gType = lens _gType (\ s a -> s{_gType = a});
instance FromXML Grantee where
parseXML x
= Grantee' <$>
(x .@? "URI") <*> (x .@? "EmailAddress") <*>
(x .@? "DisplayName")
<*> (x .@? "ID")
<*> (x .@ "xsi:type")
instance ToXML Grantee where
toXML Grantee'{..}
= mconcat
["URI" @= _gURI, "EmailAddress" @= _gEmailAddress,
"DisplayName" @= _gDisplayName, "ID" @= _gId,
"xsi:type" @= _gType]
newtype IndexDocument = IndexDocument'
{ _idSuffix :: Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
indexDocument
:: Text
-> IndexDocument
indexDocument pSuffix_ =
IndexDocument'
{ _idSuffix = pSuffix_
}
idSuffix :: Lens' IndexDocument Text
idSuffix = lens _idSuffix (\ s a -> s{_idSuffix = a});
instance FromXML IndexDocument where
parseXML x = IndexDocument' <$> (x .@ "Suffix")
instance ToXML IndexDocument where
toXML IndexDocument'{..}
= mconcat ["Suffix" @= _idSuffix]
data Initiator = Initiator'
{ _iDisplayName :: !(Maybe Text)
, _iId :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
initiator
:: Initiator
initiator =
Initiator'
{ _iDisplayName = Nothing
, _iId = Nothing
}
iDisplayName :: Lens' Initiator (Maybe Text)
iDisplayName = lens _iDisplayName (\ s a -> s{_iDisplayName = a});
iId :: Lens' Initiator (Maybe Text)
iId = lens _iId (\ s a -> s{_iId = a});
instance FromXML Initiator where
parseXML x
= Initiator' <$>
(x .@? "DisplayName") <*> (x .@? "ID")
data LambdaFunctionConfiguration = LambdaFunctionConfiguration'
{ _lfcId :: !(Maybe Text)
, _lfcFilter :: !(Maybe NotificationConfigurationFilter)
, _lfcLambdaFunctionARN :: !Text
, _lfcEvents :: ![Event]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
lambdaFunctionConfiguration
:: Text
-> LambdaFunctionConfiguration
lambdaFunctionConfiguration pLambdaFunctionARN_ =
LambdaFunctionConfiguration'
{ _lfcId = Nothing
, _lfcFilter = Nothing
, _lfcLambdaFunctionARN = pLambdaFunctionARN_
, _lfcEvents = mempty
}
lfcId :: Lens' LambdaFunctionConfiguration (Maybe Text)
lfcId = lens _lfcId (\ s a -> s{_lfcId = a});
lfcFilter :: Lens' LambdaFunctionConfiguration (Maybe NotificationConfigurationFilter)
lfcFilter = lens _lfcFilter (\ s a -> s{_lfcFilter = a});
lfcLambdaFunctionARN :: Lens' LambdaFunctionConfiguration Text
lfcLambdaFunctionARN = lens _lfcLambdaFunctionARN (\ s a -> s{_lfcLambdaFunctionARN = a});
lfcEvents :: Lens' LambdaFunctionConfiguration [Event]
lfcEvents = lens _lfcEvents (\ s a -> s{_lfcEvents = a}) . _Coerce;
instance FromXML LambdaFunctionConfiguration where
parseXML x
= LambdaFunctionConfiguration' <$>
(x .@? "Id") <*> (x .@? "Filter") <*>
(x .@ "CloudFunction")
<*> (parseXMLList "Event" x)
instance ToXML LambdaFunctionConfiguration where
toXML LambdaFunctionConfiguration'{..}
= mconcat
["Id" @= _lfcId, "Filter" @= _lfcFilter,
"CloudFunction" @= _lfcLambdaFunctionARN,
toXMLList "Event" _lfcEvents]
data LifecycleExpiration = LifecycleExpiration'
{ _leDays :: !(Maybe Int)
, _leDate :: !(Maybe RFC822)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
lifecycleExpiration
:: LifecycleExpiration
lifecycleExpiration =
LifecycleExpiration'
{ _leDays = Nothing
, _leDate = Nothing
}
leDays :: Lens' LifecycleExpiration (Maybe Int)
leDays = lens _leDays (\ s a -> s{_leDays = a});
leDate :: Lens' LifecycleExpiration (Maybe UTCTime)
leDate = lens _leDate (\ s a -> s{_leDate = a}) . mapping _Time;
instance FromXML LifecycleExpiration where
parseXML x
= LifecycleExpiration' <$>
(x .@? "Days") <*> (x .@? "Date")
instance ToXML LifecycleExpiration where
toXML LifecycleExpiration'{..}
= mconcat ["Days" @= _leDays, "Date" @= _leDate]
data LifecycleRule = LifecycleRule'
{ _lrTransitions :: !(Maybe [Transition])
, _lrNoncurrentVersionExpiration :: !(Maybe NoncurrentVersionExpiration)
, _lrNoncurrentVersionTransitions :: !(Maybe [NoncurrentVersionTransition])
, _lrExpiration :: !(Maybe LifecycleExpiration)
, _lrId :: !(Maybe Text)
, _lrPrefix :: !Text
, _lrStatus :: !ExpirationStatus
} deriving (Eq,Read,Show,Data,Typeable,Generic)
lifecycleRule
:: Text
-> ExpirationStatus
-> LifecycleRule
lifecycleRule pPrefix_ pStatus_ =
LifecycleRule'
{ _lrTransitions = Nothing
, _lrNoncurrentVersionExpiration = Nothing
, _lrNoncurrentVersionTransitions = Nothing
, _lrExpiration = Nothing
, _lrId = Nothing
, _lrPrefix = pPrefix_
, _lrStatus = pStatus_
}
lrTransitions :: Lens' LifecycleRule [Transition]
lrTransitions = lens _lrTransitions (\ s a -> s{_lrTransitions = a}) . _Default . _Coerce;
lrNoncurrentVersionExpiration :: Lens' LifecycleRule (Maybe NoncurrentVersionExpiration)
lrNoncurrentVersionExpiration = lens _lrNoncurrentVersionExpiration (\ s a -> s{_lrNoncurrentVersionExpiration = a});
lrNoncurrentVersionTransitions :: Lens' LifecycleRule [NoncurrentVersionTransition]
lrNoncurrentVersionTransitions = lens _lrNoncurrentVersionTransitions (\ s a -> s{_lrNoncurrentVersionTransitions = a}) . _Default . _Coerce;
lrExpiration :: Lens' LifecycleRule (Maybe LifecycleExpiration)
lrExpiration = lens _lrExpiration (\ s a -> s{_lrExpiration = a});
lrId :: Lens' LifecycleRule (Maybe Text)
lrId = lens _lrId (\ s a -> s{_lrId = a});
lrPrefix :: Lens' LifecycleRule Text
lrPrefix = lens _lrPrefix (\ s a -> s{_lrPrefix = a});
lrStatus :: Lens' LifecycleRule ExpirationStatus
lrStatus = lens _lrStatus (\ s a -> s{_lrStatus = a});
instance FromXML LifecycleRule where
parseXML x
= LifecycleRule' <$>
(may (parseXMLList "Transition") x) <*>
(x .@? "NoncurrentVersionExpiration")
<*>
(may (parseXMLList "NoncurrentVersionTransition") x)
<*> (x .@? "Expiration")
<*> (x .@? "ID")
<*> (x .@ "Prefix")
<*> (x .@ "Status")
instance ToXML LifecycleRule where
toXML LifecycleRule'{..}
= mconcat
[toXML (toXMLList "Transition" <$> _lrTransitions),
"NoncurrentVersionExpiration" @=
_lrNoncurrentVersionExpiration,
toXML
(toXMLList "NoncurrentVersionTransition" <$>
_lrNoncurrentVersionTransitions),
"Expiration" @= _lrExpiration, "ID" @= _lrId,
"Prefix" @= _lrPrefix, "Status" @= _lrStatus]
data LoggingEnabled = LoggingEnabled'
{ _leTargetBucket :: !(Maybe Text)
, _leTargetGrants :: !(Maybe [TargetGrant])
, _leTargetPrefix :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
loggingEnabled
:: LoggingEnabled
loggingEnabled =
LoggingEnabled'
{ _leTargetBucket = Nothing
, _leTargetGrants = Nothing
, _leTargetPrefix = Nothing
}
leTargetBucket :: Lens' LoggingEnabled (Maybe Text)
leTargetBucket = lens _leTargetBucket (\ s a -> s{_leTargetBucket = a});
leTargetGrants :: Lens' LoggingEnabled [TargetGrant]
leTargetGrants = lens _leTargetGrants (\ s a -> s{_leTargetGrants = a}) . _Default . _Coerce;
leTargetPrefix :: Lens' LoggingEnabled (Maybe Text)
leTargetPrefix = lens _leTargetPrefix (\ s a -> s{_leTargetPrefix = a});
instance FromXML LoggingEnabled where
parseXML x
= LoggingEnabled' <$>
(x .@? "TargetBucket") <*>
(x .@? "TargetGrants" .!@ mempty >>=
may (parseXMLList "Grant"))
<*> (x .@? "TargetPrefix")
instance ToXML LoggingEnabled where
toXML LoggingEnabled'{..}
= mconcat
["TargetBucket" @= _leTargetBucket,
"TargetGrants" @=
toXML (toXMLList "Grant" <$> _leTargetGrants),
"TargetPrefix" @= _leTargetPrefix]
data MultipartUpload = MultipartUpload'
{ _muInitiated :: !(Maybe RFC822)
, _muInitiator :: !(Maybe Initiator)
, _muOwner :: !(Maybe Owner)
, _muKey :: !(Maybe ObjectKey)
, _muStorageClass :: !(Maybe StorageClass)
, _muUploadId :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
multipartUpload
:: MultipartUpload
multipartUpload =
MultipartUpload'
{ _muInitiated = Nothing
, _muInitiator = Nothing
, _muOwner = Nothing
, _muKey = Nothing
, _muStorageClass = Nothing
, _muUploadId = Nothing
}
muInitiated :: Lens' MultipartUpload (Maybe UTCTime)
muInitiated = lens _muInitiated (\ s a -> s{_muInitiated = a}) . mapping _Time;
muInitiator :: Lens' MultipartUpload (Maybe Initiator)
muInitiator = lens _muInitiator (\ s a -> s{_muInitiator = a});
muOwner :: Lens' MultipartUpload (Maybe Owner)
muOwner = lens _muOwner (\ s a -> s{_muOwner = a});
muKey :: Lens' MultipartUpload (Maybe ObjectKey)
muKey = lens _muKey (\ s a -> s{_muKey = a});
muStorageClass :: Lens' MultipartUpload (Maybe StorageClass)
muStorageClass = lens _muStorageClass (\ s a -> s{_muStorageClass = a});
muUploadId :: Lens' MultipartUpload (Maybe Text)
muUploadId = lens _muUploadId (\ s a -> s{_muUploadId = a});
instance FromXML MultipartUpload where
parseXML x
= MultipartUpload' <$>
(x .@? "Initiated") <*> (x .@? "Initiator") <*>
(x .@? "Owner")
<*> (x .@? "Key")
<*> (x .@? "StorageClass")
<*> (x .@? "UploadId")
newtype NoncurrentVersionExpiration = NoncurrentVersionExpiration'
{ _nveNoncurrentDays :: Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
noncurrentVersionExpiration
:: Int
-> NoncurrentVersionExpiration
noncurrentVersionExpiration pNoncurrentDays_ =
NoncurrentVersionExpiration'
{ _nveNoncurrentDays = pNoncurrentDays_
}
nveNoncurrentDays :: Lens' NoncurrentVersionExpiration Int
nveNoncurrentDays = lens _nveNoncurrentDays (\ s a -> s{_nveNoncurrentDays = a});
instance FromXML NoncurrentVersionExpiration where
parseXML x
= NoncurrentVersionExpiration' <$>
(x .@ "NoncurrentDays")
instance ToXML NoncurrentVersionExpiration where
toXML NoncurrentVersionExpiration'{..}
= mconcat ["NoncurrentDays" @= _nveNoncurrentDays]
data NoncurrentVersionTransition = NoncurrentVersionTransition'
{ _nvtNoncurrentDays :: !Int
, _nvtStorageClass :: !TransitionStorageClass
} deriving (Eq,Read,Show,Data,Typeable,Generic)
noncurrentVersionTransition
:: Int
-> TransitionStorageClass
-> NoncurrentVersionTransition
noncurrentVersionTransition pNoncurrentDays_ pStorageClass_ =
NoncurrentVersionTransition'
{ _nvtNoncurrentDays = pNoncurrentDays_
, _nvtStorageClass = pStorageClass_
}
nvtNoncurrentDays :: Lens' NoncurrentVersionTransition Int
nvtNoncurrentDays = lens _nvtNoncurrentDays (\ s a -> s{_nvtNoncurrentDays = a});
nvtStorageClass :: Lens' NoncurrentVersionTransition TransitionStorageClass
nvtStorageClass = lens _nvtStorageClass (\ s a -> s{_nvtStorageClass = a});
instance FromXML NoncurrentVersionTransition where
parseXML x
= NoncurrentVersionTransition' <$>
(x .@ "NoncurrentDays") <*> (x .@ "StorageClass")
instance ToXML NoncurrentVersionTransition where
toXML NoncurrentVersionTransition'{..}
= mconcat
["NoncurrentDays" @= _nvtNoncurrentDays,
"StorageClass" @= _nvtStorageClass]
data NotificationConfiguration = NotificationConfiguration'
{ _ncQueueConfigurations :: !(Maybe [QueueConfiguration])
, _ncTopicConfigurations :: !(Maybe [TopicConfiguration])
, _ncLambdaFunctionConfigurations :: !(Maybe [LambdaFunctionConfiguration])
} deriving (Eq,Read,Show,Data,Typeable,Generic)
notificationConfiguration
:: NotificationConfiguration
notificationConfiguration =
NotificationConfiguration'
{ _ncQueueConfigurations = Nothing
, _ncTopicConfigurations = Nothing
, _ncLambdaFunctionConfigurations = Nothing
}
ncQueueConfigurations :: Lens' NotificationConfiguration [QueueConfiguration]
ncQueueConfigurations = lens _ncQueueConfigurations (\ s a -> s{_ncQueueConfigurations = a}) . _Default . _Coerce;
ncTopicConfigurations :: Lens' NotificationConfiguration [TopicConfiguration]
ncTopicConfigurations = lens _ncTopicConfigurations (\ s a -> s{_ncTopicConfigurations = a}) . _Default . _Coerce;
ncLambdaFunctionConfigurations :: Lens' NotificationConfiguration [LambdaFunctionConfiguration]
ncLambdaFunctionConfigurations = lens _ncLambdaFunctionConfigurations (\ s a -> s{_ncLambdaFunctionConfigurations = a}) . _Default . _Coerce;
instance FromXML NotificationConfiguration where
parseXML x
= NotificationConfiguration' <$>
(may (parseXMLList "QueueConfiguration") x) <*>
(may (parseXMLList "TopicConfiguration") x)
<*>
(may (parseXMLList "CloudFunctionConfiguration") x)
instance ToXML NotificationConfiguration where
toXML NotificationConfiguration'{..}
= mconcat
[toXML
(toXMLList "QueueConfiguration" <$>
_ncQueueConfigurations),
toXML
(toXMLList "TopicConfiguration" <$>
_ncTopicConfigurations),
toXML
(toXMLList "CloudFunctionConfiguration" <$>
_ncLambdaFunctionConfigurations)]
newtype NotificationConfigurationFilter = NotificationConfigurationFilter'
{ _ncfKey :: Maybe S3KeyFilter
} deriving (Eq,Read,Show,Data,Typeable,Generic)
notificationConfigurationFilter
:: NotificationConfigurationFilter
notificationConfigurationFilter =
NotificationConfigurationFilter'
{ _ncfKey = Nothing
}
ncfKey :: Lens' NotificationConfigurationFilter (Maybe S3KeyFilter)
ncfKey = lens _ncfKey (\ s a -> s{_ncfKey = a});
instance FromXML NotificationConfigurationFilter
where
parseXML x
= NotificationConfigurationFilter' <$>
(x .@? "S3Key")
instance ToXML NotificationConfigurationFilter where
toXML NotificationConfigurationFilter'{..}
= mconcat ["S3Key" @= _ncfKey]
data Object = Object'
{ _oOwner :: !(Maybe Owner)
, _oETag :: !ETag
, _oSize :: !Int
, _oKey :: !ObjectKey
, _oStorageClass :: !ObjectStorageClass
, _oLastModified :: !RFC822
} deriving (Eq,Read,Show,Data,Typeable,Generic)
object'
:: ETag
-> Int
-> ObjectKey
-> ObjectStorageClass
-> UTCTime
-> Object
object' pETag_ pSize_ pKey_ pStorageClass_ pLastModified_ =
Object'
{ _oOwner = Nothing
, _oETag = pETag_
, _oSize = pSize_
, _oKey = pKey_
, _oStorageClass = pStorageClass_
, _oLastModified = _Time # pLastModified_
}
oOwner :: Lens' Object (Maybe Owner)
oOwner = lens _oOwner (\ s a -> s{_oOwner = a});
oETag :: Lens' Object ETag
oETag = lens _oETag (\ s a -> s{_oETag = a});
oSize :: Lens' Object Int
oSize = lens _oSize (\ s a -> s{_oSize = a});
oKey :: Lens' Object ObjectKey
oKey = lens _oKey (\ s a -> s{_oKey = a});
oStorageClass :: Lens' Object ObjectStorageClass
oStorageClass = lens _oStorageClass (\ s a -> s{_oStorageClass = a});
oLastModified :: Lens' Object UTCTime
oLastModified = lens _oLastModified (\ s a -> s{_oLastModified = a}) . _Time;
instance FromXML Object where
parseXML x
= Object' <$>
(x .@? "Owner") <*> (x .@ "ETag") <*> (x .@ "Size")
<*> (x .@ "Key")
<*> (x .@ "StorageClass")
<*> (x .@ "LastModified")
data ObjectIdentifier = ObjectIdentifier'
{ _oiVersionId :: !(Maybe ObjectVersionId)
, _oiKey :: !ObjectKey
} deriving (Eq,Read,Show,Data,Typeable,Generic)
objectIdentifier
:: ObjectKey
-> ObjectIdentifier
objectIdentifier pKey_ =
ObjectIdentifier'
{ _oiVersionId = Nothing
, _oiKey = pKey_
}
oiVersionId :: Lens' ObjectIdentifier (Maybe ObjectVersionId)
oiVersionId = lens _oiVersionId (\ s a -> s{_oiVersionId = a});
oiKey :: Lens' ObjectIdentifier ObjectKey
oiKey = lens _oiKey (\ s a -> s{_oiKey = a});
instance ToXML ObjectIdentifier where
toXML ObjectIdentifier'{..}
= mconcat
["VersionId" @= _oiVersionId, "Key" @= _oiKey]
data ObjectVersion = ObjectVersion'
{ _ovETag :: !(Maybe ETag)
, _ovVersionId :: !(Maybe ObjectVersionId)
, _ovSize :: !(Maybe Int)
, _ovIsLatest :: !(Maybe Bool)
, _ovOwner :: !(Maybe Owner)
, _ovKey :: !(Maybe ObjectKey)
, _ovStorageClass :: !(Maybe ObjectVersionStorageClass)
, _ovLastModified :: !(Maybe RFC822)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
objectVersion
:: ObjectVersion
objectVersion =
ObjectVersion'
{ _ovETag = Nothing
, _ovVersionId = Nothing
, _ovSize = Nothing
, _ovIsLatest = Nothing
, _ovOwner = Nothing
, _ovKey = Nothing
, _ovStorageClass = Nothing
, _ovLastModified = Nothing
}
ovETag :: Lens' ObjectVersion (Maybe ETag)
ovETag = lens _ovETag (\ s a -> s{_ovETag = a});
ovVersionId :: Lens' ObjectVersion (Maybe ObjectVersionId)
ovVersionId = lens _ovVersionId (\ s a -> s{_ovVersionId = a});
ovSize :: Lens' ObjectVersion (Maybe Int)
ovSize = lens _ovSize (\ s a -> s{_ovSize = a});
ovIsLatest :: Lens' ObjectVersion (Maybe Bool)
ovIsLatest = lens _ovIsLatest (\ s a -> s{_ovIsLatest = a});
ovOwner :: Lens' ObjectVersion (Maybe Owner)
ovOwner = lens _ovOwner (\ s a -> s{_ovOwner = a});
ovKey :: Lens' ObjectVersion (Maybe ObjectKey)
ovKey = lens _ovKey (\ s a -> s{_ovKey = a});
ovStorageClass :: Lens' ObjectVersion (Maybe ObjectVersionStorageClass)
ovStorageClass = lens _ovStorageClass (\ s a -> s{_ovStorageClass = a});
ovLastModified :: Lens' ObjectVersion (Maybe UTCTime)
ovLastModified = lens _ovLastModified (\ s a -> s{_ovLastModified = a}) . mapping _Time;
instance FromXML ObjectVersion where
parseXML x
= ObjectVersion' <$>
(x .@? "ETag") <*> (x .@? "VersionId") <*>
(x .@? "Size")
<*> (x .@? "IsLatest")
<*> (x .@? "Owner")
<*> (x .@? "Key")
<*> (x .@? "StorageClass")
<*> (x .@? "LastModified")
data Owner = Owner'
{ _oDisplayName :: !(Maybe Text)
, _oId :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
owner
:: Owner
owner =
Owner'
{ _oDisplayName = Nothing
, _oId = Nothing
}
oDisplayName :: Lens' Owner (Maybe Text)
oDisplayName = lens _oDisplayName (\ s a -> s{_oDisplayName = a});
oId :: Lens' Owner (Maybe Text)
oId = lens _oId (\ s a -> s{_oId = a});
instance FromXML Owner where
parseXML x
= Owner' <$> (x .@? "DisplayName") <*> (x .@? "ID")
instance ToXML Owner where
toXML Owner'{..}
= mconcat
["DisplayName" @= _oDisplayName, "ID" @= _oId]
data Part = Part'
{ _pETag :: !(Maybe ETag)
, _pSize :: !(Maybe Int)
, _pPartNumber :: !(Maybe Int)
, _pLastModified :: !(Maybe RFC822)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
part
:: Part
part =
Part'
{ _pETag = Nothing
, _pSize = Nothing
, _pPartNumber = Nothing
, _pLastModified = Nothing
}
pETag :: Lens' Part (Maybe ETag)
pETag = lens _pETag (\ s a -> s{_pETag = a});
pSize :: Lens' Part (Maybe Int)
pSize = lens _pSize (\ s a -> s{_pSize = a});
pPartNumber :: Lens' Part (Maybe Int)
pPartNumber = lens _pPartNumber (\ s a -> s{_pPartNumber = a});
pLastModified :: Lens' Part (Maybe UTCTime)
pLastModified = lens _pLastModified (\ s a -> s{_pLastModified = a}) . mapping _Time;
instance FromXML Part where
parseXML x
= Part' <$>
(x .@? "ETag") <*> (x .@? "Size") <*>
(x .@? "PartNumber")
<*> (x .@? "LastModified")
data QueueConfiguration = QueueConfiguration'
{ _qcId :: !(Maybe Text)
, _qcFilter :: !(Maybe NotificationConfigurationFilter)
, _qcQueueARN :: !Text
, _qcEvents :: ![Event]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
queueConfiguration
:: Text
-> QueueConfiguration
queueConfiguration pQueueARN_ =
QueueConfiguration'
{ _qcId = Nothing
, _qcFilter = Nothing
, _qcQueueARN = pQueueARN_
, _qcEvents = mempty
}
qcId :: Lens' QueueConfiguration (Maybe Text)
qcId = lens _qcId (\ s a -> s{_qcId = a});
qcFilter :: Lens' QueueConfiguration (Maybe NotificationConfigurationFilter)
qcFilter = lens _qcFilter (\ s a -> s{_qcFilter = a});
qcQueueARN :: Lens' QueueConfiguration Text
qcQueueARN = lens _qcQueueARN (\ s a -> s{_qcQueueARN = a});
qcEvents :: Lens' QueueConfiguration [Event]
qcEvents = lens _qcEvents (\ s a -> s{_qcEvents = a}) . _Coerce;
instance FromXML QueueConfiguration where
parseXML x
= QueueConfiguration' <$>
(x .@? "Id") <*> (x .@? "Filter") <*> (x .@ "Queue")
<*> (parseXMLList "Event" x)
instance ToXML QueueConfiguration where
toXML QueueConfiguration'{..}
= mconcat
["Id" @= _qcId, "Filter" @= _qcFilter,
"Queue" @= _qcQueueARN, toXMLList "Event" _qcEvents]
data Redirect = Redirect'
{ _rHostName :: !(Maybe Text)
, _rProtocol :: !(Maybe Protocol)
, _rHTTPRedirectCode :: !(Maybe Text)
, _rReplaceKeyWith :: !(Maybe Text)
, _rReplaceKeyPrefixWith :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
redirect
:: Redirect
redirect =
Redirect'
{ _rHostName = Nothing
, _rProtocol = Nothing
, _rHTTPRedirectCode = Nothing
, _rReplaceKeyWith = Nothing
, _rReplaceKeyPrefixWith = Nothing
}
rHostName :: Lens' Redirect (Maybe Text)
rHostName = lens _rHostName (\ s a -> s{_rHostName = a});
rProtocol :: Lens' Redirect (Maybe Protocol)
rProtocol = lens _rProtocol (\ s a -> s{_rProtocol = a});
rHTTPRedirectCode :: Lens' Redirect (Maybe Text)
rHTTPRedirectCode = lens _rHTTPRedirectCode (\ s a -> s{_rHTTPRedirectCode = a});
rReplaceKeyWith :: Lens' Redirect (Maybe Text)
rReplaceKeyWith = lens _rReplaceKeyWith (\ s a -> s{_rReplaceKeyWith = a});
rReplaceKeyPrefixWith :: Lens' Redirect (Maybe Text)
rReplaceKeyPrefixWith = lens _rReplaceKeyPrefixWith (\ s a -> s{_rReplaceKeyPrefixWith = a});
instance FromXML Redirect where
parseXML x
= Redirect' <$>
(x .@? "HostName") <*> (x .@? "Protocol") <*>
(x .@? "HttpRedirectCode")
<*> (x .@? "ReplaceKeyWith")
<*> (x .@? "ReplaceKeyPrefixWith")
instance ToXML Redirect where
toXML Redirect'{..}
= mconcat
["HostName" @= _rHostName, "Protocol" @= _rProtocol,
"HttpRedirectCode" @= _rHTTPRedirectCode,
"ReplaceKeyWith" @= _rReplaceKeyWith,
"ReplaceKeyPrefixWith" @= _rReplaceKeyPrefixWith]
data RedirectAllRequestsTo = RedirectAllRequestsTo'
{ _rartProtocol :: !(Maybe Protocol)
, _rartHostName :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
redirectAllRequestsTo
:: Text
-> RedirectAllRequestsTo
redirectAllRequestsTo pHostName_ =
RedirectAllRequestsTo'
{ _rartProtocol = Nothing
, _rartHostName = pHostName_
}
rartProtocol :: Lens' RedirectAllRequestsTo (Maybe Protocol)
rartProtocol = lens _rartProtocol (\ s a -> s{_rartProtocol = a});
rartHostName :: Lens' RedirectAllRequestsTo Text
rartHostName = lens _rartHostName (\ s a -> s{_rartHostName = a});
instance FromXML RedirectAllRequestsTo where
parseXML x
= RedirectAllRequestsTo' <$>
(x .@? "Protocol") <*> (x .@ "HostName")
instance ToXML RedirectAllRequestsTo where
toXML RedirectAllRequestsTo'{..}
= mconcat
["Protocol" @= _rartProtocol,
"HostName" @= _rartHostName]
data ReplicationConfiguration = ReplicationConfiguration'
{ _rcRole :: !Text
, _rcRules :: ![ReplicationRule]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
replicationConfiguration
:: Text
-> ReplicationConfiguration
replicationConfiguration pRole_ =
ReplicationConfiguration'
{ _rcRole = pRole_
, _rcRules = mempty
}
rcRole :: Lens' ReplicationConfiguration Text
rcRole = lens _rcRole (\ s a -> s{_rcRole = a});
rcRules :: Lens' ReplicationConfiguration [ReplicationRule]
rcRules = lens _rcRules (\ s a -> s{_rcRules = a}) . _Coerce;
instance FromXML ReplicationConfiguration where
parseXML x
= ReplicationConfiguration' <$>
(x .@ "Role") <*> (parseXMLList "Rule" x)
instance ToXML ReplicationConfiguration where
toXML ReplicationConfiguration'{..}
= mconcat
["Role" @= _rcRole, toXMLList "Rule" _rcRules]
data ReplicationRule = ReplicationRule'
{ _rrId :: !(Maybe Text)
, _rrPrefix :: !Text
, _rrStatus :: !ReplicationRuleStatus
, _rrDestination :: !Destination
} deriving (Eq,Read,Show,Data,Typeable,Generic)
replicationRule
:: Text
-> ReplicationRuleStatus
-> Destination
-> ReplicationRule
replicationRule pPrefix_ pStatus_ pDestination_ =
ReplicationRule'
{ _rrId = Nothing
, _rrPrefix = pPrefix_
, _rrStatus = pStatus_
, _rrDestination = pDestination_
}
rrId :: Lens' ReplicationRule (Maybe Text)
rrId = lens _rrId (\ s a -> s{_rrId = a});
rrPrefix :: Lens' ReplicationRule Text
rrPrefix = lens _rrPrefix (\ s a -> s{_rrPrefix = a});
rrStatus :: Lens' ReplicationRule ReplicationRuleStatus
rrStatus = lens _rrStatus (\ s a -> s{_rrStatus = a});
rrDestination :: Lens' ReplicationRule Destination
rrDestination = lens _rrDestination (\ s a -> s{_rrDestination = a});
instance FromXML ReplicationRule where
parseXML x
= ReplicationRule' <$>
(x .@? "ID") <*> (x .@ "Prefix") <*> (x .@ "Status")
<*> (x .@ "Destination")
instance ToXML ReplicationRule where
toXML ReplicationRule'{..}
= mconcat
["ID" @= _rrId, "Prefix" @= _rrPrefix,
"Status" @= _rrStatus,
"Destination" @= _rrDestination]
newtype RequestPaymentConfiguration = RequestPaymentConfiguration'
{ _rpcPayer :: Payer
} deriving (Eq,Read,Show,Data,Typeable,Generic)
requestPaymentConfiguration
:: Payer
-> RequestPaymentConfiguration
requestPaymentConfiguration pPayer_ =
RequestPaymentConfiguration'
{ _rpcPayer = pPayer_
}
rpcPayer :: Lens' RequestPaymentConfiguration Payer
rpcPayer = lens _rpcPayer (\ s a -> s{_rpcPayer = a});
instance ToXML RequestPaymentConfiguration where
toXML RequestPaymentConfiguration'{..}
= mconcat ["Payer" @= _rpcPayer]
newtype RestoreRequest = RestoreRequest'
{ _rrDays :: Int
} deriving (Eq,Read,Show,Data,Typeable,Generic)
restoreRequest
:: Int
-> RestoreRequest
restoreRequest pDays_ =
RestoreRequest'
{ _rrDays = pDays_
}
rrDays :: Lens' RestoreRequest Int
rrDays = lens _rrDays (\ s a -> s{_rrDays = a});
instance ToXML RestoreRequest where
toXML RestoreRequest'{..}
= mconcat ["Days" @= _rrDays]
data RoutingRule = RoutingRule'
{ _rrCondition :: !(Maybe Condition)
, _rrRedirect :: !Redirect
} deriving (Eq,Read,Show,Data,Typeable,Generic)
routingRule
:: Redirect
-> RoutingRule
routingRule pRedirect_ =
RoutingRule'
{ _rrCondition = Nothing
, _rrRedirect = pRedirect_
}
rrCondition :: Lens' RoutingRule (Maybe Condition)
rrCondition = lens _rrCondition (\ s a -> s{_rrCondition = a});
rrRedirect :: Lens' RoutingRule Redirect
rrRedirect = lens _rrRedirect (\ s a -> s{_rrRedirect = a});
instance FromXML RoutingRule where
parseXML x
= RoutingRule' <$>
(x .@? "Condition") <*> (x .@ "Redirect")
instance ToXML RoutingRule where
toXML RoutingRule'{..}
= mconcat
["Condition" @= _rrCondition,
"Redirect" @= _rrRedirect]
newtype S3KeyFilter = S3KeyFilter'
{ _skfFilterRules :: Maybe [FilterRule]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
s3KeyFilter
:: S3KeyFilter
s3KeyFilter =
S3KeyFilter'
{ _skfFilterRules = Nothing
}
skfFilterRules :: Lens' S3KeyFilter [FilterRule]
skfFilterRules = lens _skfFilterRules (\ s a -> s{_skfFilterRules = a}) . _Default . _Coerce;
instance FromXML S3KeyFilter where
parseXML x
= S3KeyFilter' <$>
(may (parseXMLList "FilterRule") x)
instance ToXML S3KeyFilter where
toXML S3KeyFilter'{..}
= mconcat
[toXML (toXMLList "FilterRule" <$> _skfFilterRules)]
data S3ServiceError = S3ServiceError'
{ _sseVersionId :: !(Maybe ObjectVersionId)
, _sseKey :: !(Maybe ObjectKey)
, _sseCode :: !(Maybe Text)
, _sseMessage :: !(Maybe Text)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
s3ServiceError
:: S3ServiceError
s3ServiceError =
S3ServiceError'
{ _sseVersionId = Nothing
, _sseKey = Nothing
, _sseCode = Nothing
, _sseMessage = Nothing
}
sseVersionId :: Lens' S3ServiceError (Maybe ObjectVersionId)
sseVersionId = lens _sseVersionId (\ s a -> s{_sseVersionId = a});
sseKey :: Lens' S3ServiceError (Maybe ObjectKey)
sseKey = lens _sseKey (\ s a -> s{_sseKey = a});
sseCode :: Lens' S3ServiceError (Maybe Text)
sseCode = lens _sseCode (\ s a -> s{_sseCode = a});
sseMessage :: Lens' S3ServiceError (Maybe Text)
sseMessage = lens _sseMessage (\ s a -> s{_sseMessage = a});
instance FromXML S3ServiceError where
parseXML x
= S3ServiceError' <$>
(x .@? "VersionId") <*> (x .@? "Key") <*>
(x .@? "Code")
<*> (x .@? "Message")
data Tag = Tag'
{ _tagKey :: !ObjectKey
, _tagValue :: !Text
} deriving (Eq,Read,Show,Data,Typeable,Generic)
tag
:: ObjectKey
-> Text
-> Tag
tag pKey_ pValue_ =
Tag'
{ _tagKey = pKey_
, _tagValue = pValue_
}
tagKey :: Lens' Tag ObjectKey
tagKey = lens _tagKey (\ s a -> s{_tagKey = a});
tagValue :: Lens' Tag Text
tagValue = lens _tagValue (\ s a -> s{_tagValue = a});
instance FromXML Tag where
parseXML x = Tag' <$> (x .@ "Key") <*> (x .@ "Value")
instance ToXML Tag where
toXML Tag'{..}
= mconcat ["Key" @= _tagKey, "Value" @= _tagValue]
newtype Tagging = Tagging'
{ _tTagSet :: [Tag]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
tagging
:: Tagging
tagging =
Tagging'
{ _tTagSet = mempty
}
tTagSet :: Lens' Tagging [Tag]
tTagSet = lens _tTagSet (\ s a -> s{_tTagSet = a}) . _Coerce;
instance ToXML Tagging where
toXML Tagging'{..}
= mconcat ["TagSet" @= toXMLList "Tag" _tTagSet]
data TargetGrant = TargetGrant'
{ _tgPermission :: !(Maybe BucketLogsPermission)
, _tgGrantee :: !(Maybe Grantee)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
targetGrant
:: TargetGrant
targetGrant =
TargetGrant'
{ _tgPermission = Nothing
, _tgGrantee = Nothing
}
tgPermission :: Lens' TargetGrant (Maybe BucketLogsPermission)
tgPermission = lens _tgPermission (\ s a -> s{_tgPermission = a});
tgGrantee :: Lens' TargetGrant (Maybe Grantee)
tgGrantee = lens _tgGrantee (\ s a -> s{_tgGrantee = a});
instance FromXML TargetGrant where
parseXML x
= TargetGrant' <$>
(x .@? "Permission") <*> (x .@? "Grantee")
instance ToXML TargetGrant where
toXML TargetGrant'{..}
= mconcat
["Permission" @= _tgPermission,
"Grantee" @= _tgGrantee]
data TopicConfiguration = TopicConfiguration'
{ _tcId :: !(Maybe Text)
, _tcFilter :: !(Maybe NotificationConfigurationFilter)
, _tcTopicARN :: !Text
, _tcEvents :: ![Event]
} deriving (Eq,Read,Show,Data,Typeable,Generic)
topicConfiguration
:: Text
-> TopicConfiguration
topicConfiguration pTopicARN_ =
TopicConfiguration'
{ _tcId = Nothing
, _tcFilter = Nothing
, _tcTopicARN = pTopicARN_
, _tcEvents = mempty
}
tcId :: Lens' TopicConfiguration (Maybe Text)
tcId = lens _tcId (\ s a -> s{_tcId = a});
tcFilter :: Lens' TopicConfiguration (Maybe NotificationConfigurationFilter)
tcFilter = lens _tcFilter (\ s a -> s{_tcFilter = a});
tcTopicARN :: Lens' TopicConfiguration Text
tcTopicARN = lens _tcTopicARN (\ s a -> s{_tcTopicARN = a});
tcEvents :: Lens' TopicConfiguration [Event]
tcEvents = lens _tcEvents (\ s a -> s{_tcEvents = a}) . _Coerce;
instance FromXML TopicConfiguration where
parseXML x
= TopicConfiguration' <$>
(x .@? "Id") <*> (x .@? "Filter") <*> (x .@ "Topic")
<*> (parseXMLList "Event" x)
instance ToXML TopicConfiguration where
toXML TopicConfiguration'{..}
= mconcat
["Id" @= _tcId, "Filter" @= _tcFilter,
"Topic" @= _tcTopicARN, toXMLList "Event" _tcEvents]
data Transition = Transition'
{ _tDays :: !(Maybe Int)
, _tDate :: !(Maybe RFC822)
, _tStorageClass :: !(Maybe TransitionStorageClass)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
transition
:: Transition
transition =
Transition'
{ _tDays = Nothing
, _tDate = Nothing
, _tStorageClass = Nothing
}
tDays :: Lens' Transition (Maybe Int)
tDays = lens _tDays (\ s a -> s{_tDays = a});
tDate :: Lens' Transition (Maybe UTCTime)
tDate = lens _tDate (\ s a -> s{_tDate = a}) . mapping _Time;
tStorageClass :: Lens' Transition (Maybe TransitionStorageClass)
tStorageClass = lens _tStorageClass (\ s a -> s{_tStorageClass = a});
instance FromXML Transition where
parseXML x
= Transition' <$>
(x .@? "Days") <*> (x .@? "Date") <*>
(x .@? "StorageClass")
instance ToXML Transition where
toXML Transition'{..}
= mconcat
["Days" @= _tDays, "Date" @= _tDate,
"StorageClass" @= _tStorageClass]
data VersioningConfiguration = VersioningConfiguration'
{ _vcStatus :: !(Maybe BucketVersioningStatus)
, _vcMFADelete :: !(Maybe MFADelete)
} deriving (Eq,Read,Show,Data,Typeable,Generic)
versioningConfiguration
:: VersioningConfiguration
versioningConfiguration =
VersioningConfiguration'
{ _vcStatus = Nothing
, _vcMFADelete = Nothing
}
vcStatus :: Lens' VersioningConfiguration (Maybe BucketVersioningStatus)
vcStatus = lens _vcStatus (\ s a -> s{_vcStatus = a});
vcMFADelete :: Lens' VersioningConfiguration (Maybe MFADelete)
vcMFADelete = lens _vcMFADelete (\ s a -> s{_vcMFADelete = a});
instance ToXML VersioningConfiguration where
toXML VersioningConfiguration'{..}
= mconcat
["Status" @= _vcStatus, "MfaDelete" @= _vcMFADelete]
data WebsiteConfiguration = WebsiteConfiguration'
{ _wcRedirectAllRequestsTo :: !(Maybe RedirectAllRequestsTo)
, _wcErrorDocument :: !(Maybe ErrorDocument)
, _wcIndexDocument :: !(Maybe IndexDocument)
, _wcRoutingRules :: !(Maybe [RoutingRule])
} deriving (Eq,Read,Show,Data,Typeable,Generic)
websiteConfiguration
:: WebsiteConfiguration
websiteConfiguration =
WebsiteConfiguration'
{ _wcRedirectAllRequestsTo = Nothing
, _wcErrorDocument = Nothing
, _wcIndexDocument = Nothing
, _wcRoutingRules = Nothing
}
wcRedirectAllRequestsTo :: Lens' WebsiteConfiguration (Maybe RedirectAllRequestsTo)
wcRedirectAllRequestsTo = lens _wcRedirectAllRequestsTo (\ s a -> s{_wcRedirectAllRequestsTo = a});
wcErrorDocument :: Lens' WebsiteConfiguration (Maybe ErrorDocument)
wcErrorDocument = lens _wcErrorDocument (\ s a -> s{_wcErrorDocument = a});
wcIndexDocument :: Lens' WebsiteConfiguration (Maybe IndexDocument)
wcIndexDocument = lens _wcIndexDocument (\ s a -> s{_wcIndexDocument = a});
wcRoutingRules :: Lens' WebsiteConfiguration [RoutingRule]
wcRoutingRules = lens _wcRoutingRules (\ s a -> s{_wcRoutingRules = a}) . _Default . _Coerce;
instance ToXML WebsiteConfiguration where
toXML WebsiteConfiguration'{..}
= mconcat
["RedirectAllRequestsTo" @= _wcRedirectAllRequestsTo,
"ErrorDocument" @= _wcErrorDocument,
"IndexDocument" @= _wcIndexDocument,
"RoutingRules" @=
toXML (toXMLList "RoutingRule" <$> _wcRoutingRules)]