module Network.AWS.CloudFront.Types
(
CloudFront
, RESTError
, ns
, CloudFrontOriginAccessIdentityList
, cloudFrontOriginAccessIdentityList
, cfoailIsTruncated
, cfoailItems
, cfoailMarker
, cfoailMaxItems
, cfoailNextMarker
, cfoailQuantity
, Invalidation
, invalidation
, iCreateTime
, iId
, iInvalidationBatch
, iStatus
, SSLSupportMethod (..)
, AllowedMethods
, allowedMethods
, amItems
, amQuantity
, CloudFrontOriginAccessIdentityConfig
, cloudFrontOriginAccessIdentityConfig
, cfoaicCallerReference
, cfoaicComment
, Origin
, origin
, oCustomOriginConfig
, oDomainName
, oId
, oS3OriginConfig
, ViewerProtocolPolicy (..)
, StreamingDistributionList
, streamingDistributionList
, sdlIsTruncated
, sdlItems
, sdlMarker
, sdlMaxItems
, sdlNextMarker
, sdlQuantity
, StreamingDistributionConfig
, streamingDistributionConfig
, sdcAliases
, sdcCallerReference
, sdcComment
, sdcEnabled
, sdcLogging
, sdcPriceClass
, sdcS3Origin
, sdcTrustedSigners
, Signer
, signer
, sAwsAccountNumber
, sKeyPairIds
, CookiePreference
, cookiePreference
, cpForward
, cpWhitelistedNames
, OriginProtocolPolicy (..)
, Distribution
, distribution
, dActiveTrustedSigners
, dDistributionConfig
, dDomainName
, dId
, dInProgressInvalidationBatches
, dLastModifiedTime
, dStatus
, CloudFrontOriginAccessIdentitySummary
, cloudFrontOriginAccessIdentitySummary
, cfoaisComment
, cfoaisId
, cfoaisS3CanonicalUserId
, StreamingDistributionSummary
, streamingDistributionSummary
, sdsAliases
, sdsComment
, sdsDomainName
, sdsEnabled
, sdsId
, sdsLastModifiedTime
, sdsPriceClass
, sdsS3Origin
, sdsStatus
, sdsTrustedSigners
, CustomOriginConfig
, customOriginConfig
, cocHTTPPort
, cocHTTPSPort
, cocOriginProtocolPolicy
, Aliases
, aliases
, aItems
, aQuantity
, InvalidationBatch
, invalidationBatch
, ibCallerReference
, ibPaths
, InvalidationSummary
, invalidationSummary
, isCreateTime
, isId
, isStatus
, DistributionConfig
, distributionConfig
, dcAliases
, dcCacheBehaviors
, dcCallerReference
, dcComment
, dcCustomErrorResponses
, dcDefaultCacheBehavior
, dcDefaultRootObject
, dcEnabled
, dcLogging
, dcOrigins
, dcPriceClass
, dcRestrictions
, dcViewerCertificate
, CacheBehavior
, cacheBehavior
, cbAllowedMethods
, cbForwardedValues
, cbMinTTL
, cbPathPattern
, cbSmoothStreaming
, cbTargetOriginId
, cbTrustedSigners
, cbViewerProtocolPolicy
, DistributionList
, distributionList
, dlIsTruncated
, dlItems
, dlMarker
, dlMaxItems
, dlNextMarker
, dlQuantity
, KeyPairIds
, keyPairIds
, kpiItems
, kpiQuantity
, PriceClass (..)
, CustomErrorResponses
, customErrorResponses
, cerItems
, cerQuantity
, S3OriginConfig
, s3OriginConfig
, socOriginAccessIdentity
, GeoRestriction
, geoRestriction
, grItems
, grQuantity
, grRestrictionType
, S3Origin
, s3Origin
, soDomainName
, soOriginAccessIdentity
, Headers
, headers
, hItems
, hQuantity
, ViewerCertificate
, viewerCertificate
, vcCloudFrontDefaultCertificate
, vcIAMCertificateId
, vcSSLSupportMethod
, Restrictions
, restrictions
, rGeoRestriction
, Origins
, origins
, oItems
, oQuantity
, Method (..)
, ForwardedValues
, forwardedValues
, fvCookies
, fvHeaders
, fvQueryString
, TrustedSigners
, trustedSigners
, tsEnabled
, tsItems
, tsQuantity
, ItemSelection (..)
, StreamingLoggingConfig
, streamingLoggingConfig
, slcBucket
, slcEnabled
, slcPrefix
, CookieNames
, cookieNames
, cnItems
, cnQuantity
, CustomErrorResponse
, customErrorResponse
, cerErrorCachingMinTTL
, cerErrorCode
, cerResponseCode
, cerResponsePagePath
, CacheBehaviors
, cacheBehaviors
, cbItems
, cbQuantity
, DefaultCacheBehavior
, defaultCacheBehavior
, dcbAllowedMethods
, dcbForwardedValues
, dcbMinTTL
, dcbSmoothStreaming
, dcbTargetOriginId
, dcbTrustedSigners
, dcbViewerProtocolPolicy
, InvalidationList
, invalidationList
, ilIsTruncated
, ilItems
, ilMarker
, ilMaxItems
, ilNextMarker
, ilQuantity
, StreamingDistribution
, streamingDistribution
, sdActiveTrustedSigners
, sdDomainName
, sdId
, sdLastModifiedTime
, sdStatus
, sdStreamingDistributionConfig
, Paths
, paths
, pItems
, pQuantity
, CloudFrontOriginAccessIdentity
, cloudFrontOriginAccessIdentity
, cfoaiCloudFrontOriginAccessIdentityConfig
, cfoaiId
, cfoaiS3CanonicalUserId
, ActiveTrustedSigners
, activeTrustedSigners
, atsEnabled
, atsItems
, atsQuantity
, DistributionSummary
, distributionSummary
, dsAliases
, dsCacheBehaviors
, dsComment
, dsCustomErrorResponses
, dsDefaultCacheBehavior
, dsDomainName
, dsEnabled
, dsId
, dsLastModifiedTime
, dsOrigins
, dsPriceClass
, dsRestrictions
, dsStatus
, dsViewerCertificate
, GeoRestrictionType (..)
, LoggingConfig
, loggingConfig
, lcBucket
, lcEnabled
, lcIncludeCookies
, lcPrefix
) where
import Network.AWS.Error
import Network.AWS.Prelude
import Network.AWS.Signing
import qualified GHC.Exts
data CloudFront
instance AWSService CloudFront where
type Sg CloudFront = V4
type Er CloudFront = RESTError
service = Service
{ _svcAbbrev = "CloudFront"
, _svcPrefix = "cloudfront"
, _svcVersion = "2014-05-31"
, _svcTargetPrefix = Nothing
, _svcJSONVersion = Nothing
}
handle = restError statusSuccess
ns :: Text
ns = "http://cloudfront.amazonaws.com/doc/2014-05-31/"
data CloudFrontOriginAccessIdentityList = CloudFrontOriginAccessIdentityList
{ _cfoailIsTruncated :: Bool
, _cfoailItems :: List "CloudFrontOriginAccessIdentitySummary" CloudFrontOriginAccessIdentitySummary
, _cfoailMarker :: Text
, _cfoailMaxItems :: Int
, _cfoailNextMarker :: Maybe Text
, _cfoailQuantity :: Int
} deriving (Eq, Show)
cloudFrontOriginAccessIdentityList :: Text
-> Int
-> Bool
-> Int
-> CloudFrontOriginAccessIdentityList
cloudFrontOriginAccessIdentityList p1 p2 p3 p4 = CloudFrontOriginAccessIdentityList
{ _cfoailMarker = p1
, _cfoailMaxItems = p2
, _cfoailIsTruncated = p3
, _cfoailQuantity = p4
, _cfoailNextMarker = Nothing
, _cfoailItems = mempty
}
cfoailIsTruncated :: Lens' CloudFrontOriginAccessIdentityList Bool
cfoailIsTruncated =
lens _cfoailIsTruncated (\s a -> s { _cfoailIsTruncated = a })
cfoailItems :: Lens' CloudFrontOriginAccessIdentityList [CloudFrontOriginAccessIdentitySummary]
cfoailItems = lens _cfoailItems (\s a -> s { _cfoailItems = a }) . _List
cfoailMarker :: Lens' CloudFrontOriginAccessIdentityList Text
cfoailMarker = lens _cfoailMarker (\s a -> s { _cfoailMarker = a })
cfoailMaxItems :: Lens' CloudFrontOriginAccessIdentityList Int
cfoailMaxItems = lens _cfoailMaxItems (\s a -> s { _cfoailMaxItems = a })
cfoailNextMarker :: Lens' CloudFrontOriginAccessIdentityList (Maybe Text)
cfoailNextMarker = lens _cfoailNextMarker (\s a -> s { _cfoailNextMarker = a })
cfoailQuantity :: Lens' CloudFrontOriginAccessIdentityList Int
cfoailQuantity = lens _cfoailQuantity (\s a -> s { _cfoailQuantity = a })
instance FromXML CloudFrontOriginAccessIdentityList where
parseXML x = CloudFrontOriginAccessIdentityList
<$> x .@ "IsTruncated"
<*> x .@ "Items"
<*> x .@ "Marker"
<*> x .@ "MaxItems"
<*> x .@? "NextMarker"
<*> x .@ "Quantity"
instance ToXML CloudFrontOriginAccessIdentityList where
toXML CloudFrontOriginAccessIdentityList{..} = nodes "CloudFrontOriginAccessIdentityList"
[ "Marker" =@ _cfoailMarker
, "NextMarker" =@ _cfoailNextMarker
, "MaxItems" =@ _cfoailMaxItems
, "IsTruncated" =@ _cfoailIsTruncated
, "Quantity" =@ _cfoailQuantity
, "Items" =@ _cfoailItems
]
data Invalidation = Invalidation
{ _iCreateTime :: ISO8601
, _iId :: Text
, _iInvalidationBatch :: InvalidationBatch
, _iStatus :: Text
} deriving (Eq, Show)
invalidation :: Text
-> Text
-> UTCTime
-> InvalidationBatch
-> Invalidation
invalidation p1 p2 p3 p4 = Invalidation
{ _iId = p1
, _iStatus = p2
, _iCreateTime = withIso _Time (const id) p3
, _iInvalidationBatch = p4
}
iCreateTime :: Lens' Invalidation UTCTime
iCreateTime = lens _iCreateTime (\s a -> s { _iCreateTime = a }) . _Time
iId :: Lens' Invalidation Text
iId = lens _iId (\s a -> s { _iId = a })
iInvalidationBatch :: Lens' Invalidation InvalidationBatch
iInvalidationBatch =
lens _iInvalidationBatch (\s a -> s { _iInvalidationBatch = a })
iStatus :: Lens' Invalidation Text
iStatus = lens _iStatus (\s a -> s { _iStatus = a })
instance FromXML Invalidation where
parseXML x = Invalidation
<$> x .@ "CreateTime"
<*> x .@ "Id"
<*> x .@ "InvalidationBatch"
<*> x .@ "Status"
instance ToXMLRoot Invalidation where
toXMLRoot Invalidation{..} = namespaced ns "Invalidation"
[ "Id" =@ _iId
, "Status" =@ _iStatus
, "CreateTime" =@ _iCreateTime
, "InvalidationBatch" =@ _iInvalidationBatch
]
instance ToXML Invalidation
data SSLSupportMethod
= SniOnly
| Vip
deriving (Eq, Ord, Show, Generic, Enum)
instance Hashable SSLSupportMethod
instance FromText SSLSupportMethod where
parser = takeText >>= \case
"sni-only" -> pure SniOnly
"vip" -> pure Vip
e -> fail $
"Failure parsing SSLSupportMethod from " ++ show e
instance ToText SSLSupportMethod where
toText = \case
SniOnly -> "sni-only"
Vip -> "vip"
instance ToByteString SSLSupportMethod
instance ToHeader SSLSupportMethod
instance ToQuery SSLSupportMethod
instance FromXML SSLSupportMethod where
parseXML = parseXMLText "SSLSupportMethod"
instance ToXML SSLSupportMethod where
toXML = toXMLText
data AllowedMethods = AllowedMethods
{ _amItems :: List "Method" Method
, _amQuantity :: Int
} deriving (Eq, Show)
allowedMethods :: Int
-> AllowedMethods
allowedMethods p1 = AllowedMethods
{ _amQuantity = p1
, _amItems = mempty
}
amItems :: Lens' AllowedMethods [Method]
amItems = lens _amItems (\s a -> s { _amItems = a }) . _List
amQuantity :: Lens' AllowedMethods Int
amQuantity = lens _amQuantity (\s a -> s { _amQuantity = a })
instance FromXML AllowedMethods where
parseXML x = AllowedMethods
<$> x .@ "Items"
<*> x .@ "Quantity"
instance ToXML AllowedMethods where
toXML AllowedMethods{..} = nodes "AllowedMethods"
[ "Quantity" =@ _amQuantity
, "Items" =@ _amItems
]
data CloudFrontOriginAccessIdentityConfig = CloudFrontOriginAccessIdentityConfig
{ _cfoaicCallerReference :: Text
, _cfoaicComment :: Text
} deriving (Eq, Ord, Show)
cloudFrontOriginAccessIdentityConfig :: Text
-> Text
-> CloudFrontOriginAccessIdentityConfig
cloudFrontOriginAccessIdentityConfig p1 p2 = CloudFrontOriginAccessIdentityConfig
{ _cfoaicCallerReference = p1
, _cfoaicComment = p2
}
cfoaicCallerReference :: Lens' CloudFrontOriginAccessIdentityConfig Text
cfoaicCallerReference =
lens _cfoaicCallerReference (\s a -> s { _cfoaicCallerReference = a })
cfoaicComment :: Lens' CloudFrontOriginAccessIdentityConfig Text
cfoaicComment = lens _cfoaicComment (\s a -> s { _cfoaicComment = a })
instance FromXML CloudFrontOriginAccessIdentityConfig where
parseXML x = CloudFrontOriginAccessIdentityConfig
<$> x .@ "CallerReference"
<*> x .@ "Comment"
instance ToXMLRoot CloudFrontOriginAccessIdentityConfig where
toXMLRoot CloudFrontOriginAccessIdentityConfig{..} = namespaced ns "CloudFrontOriginAccessIdentityConfig"
[ "CallerReference" =@ _cfoaicCallerReference
, "Comment" =@ _cfoaicComment
]
instance ToXML CloudFrontOriginAccessIdentityConfig
data Origin = Origin
{ _oCustomOriginConfig :: Maybe CustomOriginConfig
, _oDomainName :: Text
, _oId :: Text
, _oS3OriginConfig :: Maybe S3OriginConfig
} deriving (Eq, Show)
origin :: Text
-> Text
-> Origin
origin p1 p2 = Origin
{ _oId = p1
, _oDomainName = p2
, _oS3OriginConfig = Nothing
, _oCustomOriginConfig = Nothing
}
oCustomOriginConfig :: Lens' Origin (Maybe CustomOriginConfig)
oCustomOriginConfig =
lens _oCustomOriginConfig (\s a -> s { _oCustomOriginConfig = a })
oDomainName :: Lens' Origin Text
oDomainName = lens _oDomainName (\s a -> s { _oDomainName = a })
oId :: Lens' Origin Text
oId = lens _oId (\s a -> s { _oId = a })
oS3OriginConfig :: Lens' Origin (Maybe S3OriginConfig)
oS3OriginConfig = lens _oS3OriginConfig (\s a -> s { _oS3OriginConfig = a })
instance FromXML Origin where
parseXML x = Origin
<$> x .@? "CustomOriginConfig"
<*> x .@ "DomainName"
<*> x .@ "Id"
<*> x .@? "S3OriginConfig"
instance ToXML Origin where
toXML Origin{..} = nodes "Origin"
[ "Id" =@ _oId
, "DomainName" =@ _oDomainName
, "S3OriginConfig" =@ _oS3OriginConfig
, "CustomOriginConfig" =@ _oCustomOriginConfig
]
data ViewerProtocolPolicy
= AllowAll
| HttpsOnly
| RedirectToHttps
deriving (Eq, Ord, Show, Generic, Enum)
instance Hashable ViewerProtocolPolicy
instance FromText ViewerProtocolPolicy where
parser = takeText >>= \case
"allow-all" -> pure AllowAll
"https-only" -> pure HttpsOnly
"redirect-to-https" -> pure RedirectToHttps
e -> fail $
"Failure parsing ViewerProtocolPolicy from " ++ show e
instance ToText ViewerProtocolPolicy where
toText = \case
AllowAll -> "allow-all"
HttpsOnly -> "https-only"
RedirectToHttps -> "redirect-to-https"
instance ToByteString ViewerProtocolPolicy
instance ToHeader ViewerProtocolPolicy
instance ToQuery ViewerProtocolPolicy
instance FromXML ViewerProtocolPolicy where
parseXML = parseXMLText "ViewerProtocolPolicy"
instance ToXML ViewerProtocolPolicy where
toXML = toXMLText
data StreamingDistributionList = StreamingDistributionList
{ _sdlIsTruncated :: Bool
, _sdlItems :: List "StreamingDistributionSummary" StreamingDistributionSummary
, _sdlMarker :: Text
, _sdlMaxItems :: Int
, _sdlNextMarker :: Maybe Text
, _sdlQuantity :: Int
} deriving (Eq, Show)
streamingDistributionList :: Text
-> Int
-> Bool
-> Int
-> StreamingDistributionList
streamingDistributionList p1 p2 p3 p4 = StreamingDistributionList
{ _sdlMarker = p1
, _sdlMaxItems = p2
, _sdlIsTruncated = p3
, _sdlQuantity = p4
, _sdlNextMarker = Nothing
, _sdlItems = mempty
}
sdlIsTruncated :: Lens' StreamingDistributionList Bool
sdlIsTruncated = lens _sdlIsTruncated (\s a -> s { _sdlIsTruncated = a })
sdlItems :: Lens' StreamingDistributionList [StreamingDistributionSummary]
sdlItems = lens _sdlItems (\s a -> s { _sdlItems = a }) . _List
sdlMarker :: Lens' StreamingDistributionList Text
sdlMarker = lens _sdlMarker (\s a -> s { _sdlMarker = a })
sdlMaxItems :: Lens' StreamingDistributionList Int
sdlMaxItems = lens _sdlMaxItems (\s a -> s { _sdlMaxItems = a })
sdlNextMarker :: Lens' StreamingDistributionList (Maybe Text)
sdlNextMarker = lens _sdlNextMarker (\s a -> s { _sdlNextMarker = a })
sdlQuantity :: Lens' StreamingDistributionList Int
sdlQuantity = lens _sdlQuantity (\s a -> s { _sdlQuantity = a })
instance FromXML StreamingDistributionList where
parseXML x = StreamingDistributionList
<$> x .@ "IsTruncated"
<*> x .@ "Items"
<*> x .@ "Marker"
<*> x .@ "MaxItems"
<*> x .@? "NextMarker"
<*> x .@ "Quantity"
instance ToXML StreamingDistributionList where
toXML StreamingDistributionList{..} = nodes "StreamingDistributionList"
[ "Marker" =@ _sdlMarker
, "NextMarker" =@ _sdlNextMarker
, "MaxItems" =@ _sdlMaxItems
, "IsTruncated" =@ _sdlIsTruncated
, "Quantity" =@ _sdlQuantity
, "Items" =@ _sdlItems
]
data StreamingDistributionConfig = StreamingDistributionConfig
{ _sdcAliases :: Aliases
, _sdcCallerReference :: Text
, _sdcComment :: Text
, _sdcEnabled :: Bool
, _sdcLogging :: StreamingLoggingConfig
, _sdcPriceClass :: PriceClass
, _sdcS3Origin :: S3Origin
, _sdcTrustedSigners :: TrustedSigners
} deriving (Eq, Show)
streamingDistributionConfig :: Text
-> S3Origin
-> Aliases
-> Text
-> StreamingLoggingConfig
-> TrustedSigners
-> PriceClass
-> Bool
-> StreamingDistributionConfig
streamingDistributionConfig p1 p2 p3 p4 p5 p6 p7 p8 = StreamingDistributionConfig
{ _sdcCallerReference = p1
, _sdcS3Origin = p2
, _sdcAliases = p3
, _sdcComment = p4
, _sdcLogging = p5
, _sdcTrustedSigners = p6
, _sdcPriceClass = p7
, _sdcEnabled = p8
}
sdcAliases :: Lens' StreamingDistributionConfig Aliases
sdcAliases = lens _sdcAliases (\s a -> s { _sdcAliases = a })
sdcCallerReference :: Lens' StreamingDistributionConfig Text
sdcCallerReference =
lens _sdcCallerReference (\s a -> s { _sdcCallerReference = a })
sdcComment :: Lens' StreamingDistributionConfig Text
sdcComment = lens _sdcComment (\s a -> s { _sdcComment = a })
sdcEnabled :: Lens' StreamingDistributionConfig Bool
sdcEnabled = lens _sdcEnabled (\s a -> s { _sdcEnabled = a })
sdcLogging :: Lens' StreamingDistributionConfig StreamingLoggingConfig
sdcLogging = lens _sdcLogging (\s a -> s { _sdcLogging = a })
sdcPriceClass :: Lens' StreamingDistributionConfig PriceClass
sdcPriceClass = lens _sdcPriceClass (\s a -> s { _sdcPriceClass = a })
sdcS3Origin :: Lens' StreamingDistributionConfig S3Origin
sdcS3Origin = lens _sdcS3Origin (\s a -> s { _sdcS3Origin = a })
sdcTrustedSigners :: Lens' StreamingDistributionConfig TrustedSigners
sdcTrustedSigners =
lens _sdcTrustedSigners (\s a -> s { _sdcTrustedSigners = a })
instance FromXML StreamingDistributionConfig where
parseXML x = StreamingDistributionConfig
<$> x .@ "Aliases"
<*> x .@ "CallerReference"
<*> x .@ "Comment"
<*> x .@ "Enabled"
<*> x .@ "Logging"
<*> x .@ "PriceClass"
<*> x .@ "S3Origin"
<*> x .@ "TrustedSigners"
instance ToXMLRoot StreamingDistributionConfig where
toXMLRoot StreamingDistributionConfig{..} = namespaced ns "StreamingDistributionConfig"
[ "CallerReference" =@ _sdcCallerReference
, "S3Origin" =@ _sdcS3Origin
, "Aliases" =@ _sdcAliases
, "Comment" =@ _sdcComment
, "Logging" =@ _sdcLogging
, "TrustedSigners" =@ _sdcTrustedSigners
, "PriceClass" =@ _sdcPriceClass
, "Enabled" =@ _sdcEnabled
]
instance ToXML StreamingDistributionConfig
data Signer = Signer
{ _sAwsAccountNumber :: Maybe Text
, _sKeyPairIds :: Maybe KeyPairIds
} deriving (Eq, Show)
signer :: Signer
signer = Signer
{ _sAwsAccountNumber = Nothing
, _sKeyPairIds = Nothing
}
sAwsAccountNumber :: Lens' Signer (Maybe Text)
sAwsAccountNumber =
lens _sAwsAccountNumber (\s a -> s { _sAwsAccountNumber = a })
sKeyPairIds :: Lens' Signer (Maybe KeyPairIds)
sKeyPairIds = lens _sKeyPairIds (\s a -> s { _sKeyPairIds = a })
instance FromXML Signer where
parseXML x = Signer
<$> x .@? "AwsAccountNumber"
<*> x .@? "KeyPairIds"
instance ToXML Signer where
toXML Signer{..} = nodes "Signer"
[ "AwsAccountNumber" =@ _sAwsAccountNumber
, "KeyPairIds" =@ _sKeyPairIds
]
data CookiePreference = CookiePreference
{ _cpForward :: ItemSelection
, _cpWhitelistedNames :: Maybe CookieNames
} deriving (Eq, Show)
cookiePreference :: ItemSelection
-> CookiePreference
cookiePreference p1 = CookiePreference
{ _cpForward = p1
, _cpWhitelistedNames = Nothing
}
cpForward :: Lens' CookiePreference ItemSelection
cpForward = lens _cpForward (\s a -> s { _cpForward = a })
cpWhitelistedNames :: Lens' CookiePreference (Maybe CookieNames)
cpWhitelistedNames =
lens _cpWhitelistedNames (\s a -> s { _cpWhitelistedNames = a })
instance FromXML CookiePreference where
parseXML x = CookiePreference
<$> x .@ "Forward"
<*> x .@? "WhitelistedNames"
instance ToXML CookiePreference where
toXML CookiePreference{..} = nodes "CookiePreference"
[ "Forward" =@ _cpForward
, "WhitelistedNames" =@ _cpWhitelistedNames
]
data OriginProtocolPolicy
= HttpOnly
| MatchViewer
deriving (Eq, Ord, Show, Generic, Enum)
instance Hashable OriginProtocolPolicy
instance FromText OriginProtocolPolicy where
parser = takeText >>= \case
"http-only" -> pure HttpOnly
"match-viewer" -> pure MatchViewer
e -> fail $
"Failure parsing OriginProtocolPolicy from " ++ show e
instance ToText OriginProtocolPolicy where
toText = \case
HttpOnly -> "http-only"
MatchViewer -> "match-viewer"
instance ToByteString OriginProtocolPolicy
instance ToHeader OriginProtocolPolicy
instance ToQuery OriginProtocolPolicy
instance FromXML OriginProtocolPolicy where
parseXML = parseXMLText "OriginProtocolPolicy"
instance ToXML OriginProtocolPolicy where
toXML = toXMLText
data Distribution = Distribution
{ _dActiveTrustedSigners :: ActiveTrustedSigners
, _dDistributionConfig :: DistributionConfig
, _dDomainName :: Text
, _dId :: Text
, _dInProgressInvalidationBatches :: Int
, _dLastModifiedTime :: ISO8601
, _dStatus :: Text
} deriving (Eq, Show)
distribution :: Text
-> Text
-> UTCTime
-> Int
-> Text
-> ActiveTrustedSigners
-> DistributionConfig
-> Distribution
distribution p1 p2 p3 p4 p5 p6 p7 = Distribution
{ _dId = p1
, _dStatus = p2
, _dLastModifiedTime = withIso _Time (const id) p3
, _dInProgressInvalidationBatches = p4
, _dDomainName = p5
, _dActiveTrustedSigners = p6
, _dDistributionConfig = p7
}
dActiveTrustedSigners :: Lens' Distribution ActiveTrustedSigners
dActiveTrustedSigners =
lens _dActiveTrustedSigners (\s a -> s { _dActiveTrustedSigners = a })
dDistributionConfig :: Lens' Distribution DistributionConfig
dDistributionConfig =
lens _dDistributionConfig (\s a -> s { _dDistributionConfig = a })
dDomainName :: Lens' Distribution Text
dDomainName = lens _dDomainName (\s a -> s { _dDomainName = a })
dId :: Lens' Distribution Text
dId = lens _dId (\s a -> s { _dId = a })
dInProgressInvalidationBatches :: Lens' Distribution Int
dInProgressInvalidationBatches =
lens _dInProgressInvalidationBatches
(\s a -> s { _dInProgressInvalidationBatches = a })
dLastModifiedTime :: Lens' Distribution UTCTime
dLastModifiedTime =
lens _dLastModifiedTime (\s a -> s { _dLastModifiedTime = a })
. _Time
dStatus :: Lens' Distribution Text
dStatus = lens _dStatus (\s a -> s { _dStatus = a })
instance FromXML Distribution where
parseXML x = Distribution
<$> x .@ "ActiveTrustedSigners"
<*> x .@ "DistributionConfig"
<*> x .@ "DomainName"
<*> x .@ "Id"
<*> x .@ "InProgressInvalidationBatches"
<*> x .@ "LastModifiedTime"
<*> x .@ "Status"
instance ToXMLRoot Distribution where
toXMLRoot Distribution{..} = namespaced ns "Distribution"
[ "Id" =@ _dId
, "Status" =@ _dStatus
, "LastModifiedTime" =@ _dLastModifiedTime
, "InProgressInvalidationBatches" =@ _dInProgressInvalidationBatches
, "DomainName" =@ _dDomainName
, "ActiveTrustedSigners" =@ _dActiveTrustedSigners
, "DistributionConfig" =@ _dDistributionConfig
]
instance ToXML Distribution
data CloudFrontOriginAccessIdentitySummary = CloudFrontOriginAccessIdentitySummary
{ _cfoaisComment :: Text
, _cfoaisId :: Text
, _cfoaisS3CanonicalUserId :: Text
} deriving (Eq, Ord, Show)
cloudFrontOriginAccessIdentitySummary :: Text
-> Text
-> Text
-> CloudFrontOriginAccessIdentitySummary
cloudFrontOriginAccessIdentitySummary p1 p2 p3 = CloudFrontOriginAccessIdentitySummary
{ _cfoaisId = p1
, _cfoaisS3CanonicalUserId = p2
, _cfoaisComment = p3
}
cfoaisComment :: Lens' CloudFrontOriginAccessIdentitySummary Text
cfoaisComment = lens _cfoaisComment (\s a -> s { _cfoaisComment = a })
cfoaisId :: Lens' CloudFrontOriginAccessIdentitySummary Text
cfoaisId = lens _cfoaisId (\s a -> s { _cfoaisId = a })
cfoaisS3CanonicalUserId :: Lens' CloudFrontOriginAccessIdentitySummary Text
cfoaisS3CanonicalUserId =
lens _cfoaisS3CanonicalUserId (\s a -> s { _cfoaisS3CanonicalUserId = a })
instance FromXML CloudFrontOriginAccessIdentitySummary where
parseXML x = CloudFrontOriginAccessIdentitySummary
<$> x .@ "Comment"
<*> x .@ "Id"
<*> x .@ "S3CanonicalUserId"
instance ToXML CloudFrontOriginAccessIdentitySummary where
toXML CloudFrontOriginAccessIdentitySummary{..} = nodes "CloudFrontOriginAccessIdentitySummary"
[ "Id" =@ _cfoaisId
, "S3CanonicalUserId" =@ _cfoaisS3CanonicalUserId
, "Comment" =@ _cfoaisComment
]
data StreamingDistributionSummary = StreamingDistributionSummary
{ _sdsAliases :: Aliases
, _sdsComment :: Text
, _sdsDomainName :: Text
, _sdsEnabled :: Bool
, _sdsId :: Text
, _sdsLastModifiedTime :: ISO8601
, _sdsPriceClass :: PriceClass
, _sdsS3Origin :: S3Origin
, _sdsStatus :: Text
, _sdsTrustedSigners :: TrustedSigners
} deriving (Eq, Show)
streamingDistributionSummary :: Text
-> Text
-> UTCTime
-> Text
-> S3Origin
-> Aliases
-> TrustedSigners
-> Text
-> PriceClass
-> Bool
-> StreamingDistributionSummary
streamingDistributionSummary p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 = StreamingDistributionSummary
{ _sdsId = p1
, _sdsStatus = p2
, _sdsLastModifiedTime = withIso _Time (const id) p3
, _sdsDomainName = p4
, _sdsS3Origin = p5
, _sdsAliases = p6
, _sdsTrustedSigners = p7
, _sdsComment = p8
, _sdsPriceClass = p9
, _sdsEnabled = p10
}
sdsAliases :: Lens' StreamingDistributionSummary Aliases
sdsAliases = lens _sdsAliases (\s a -> s { _sdsAliases = a })
sdsComment :: Lens' StreamingDistributionSummary Text
sdsComment = lens _sdsComment (\s a -> s { _sdsComment = a })
sdsDomainName :: Lens' StreamingDistributionSummary Text
sdsDomainName = lens _sdsDomainName (\s a -> s { _sdsDomainName = a })
sdsEnabled :: Lens' StreamingDistributionSummary Bool
sdsEnabled = lens _sdsEnabled (\s a -> s { _sdsEnabled = a })
sdsId :: Lens' StreamingDistributionSummary Text
sdsId = lens _sdsId (\s a -> s { _sdsId = a })
sdsLastModifiedTime :: Lens' StreamingDistributionSummary UTCTime
sdsLastModifiedTime =
lens _sdsLastModifiedTime (\s a -> s { _sdsLastModifiedTime = a })
. _Time
sdsPriceClass :: Lens' StreamingDistributionSummary PriceClass
sdsPriceClass = lens _sdsPriceClass (\s a -> s { _sdsPriceClass = a })
sdsS3Origin :: Lens' StreamingDistributionSummary S3Origin
sdsS3Origin = lens _sdsS3Origin (\s a -> s { _sdsS3Origin = a })
sdsStatus :: Lens' StreamingDistributionSummary Text
sdsStatus = lens _sdsStatus (\s a -> s { _sdsStatus = a })
sdsTrustedSigners :: Lens' StreamingDistributionSummary TrustedSigners
sdsTrustedSigners =
lens _sdsTrustedSigners (\s a -> s { _sdsTrustedSigners = a })
instance FromXML StreamingDistributionSummary where
parseXML x = StreamingDistributionSummary
<$> x .@ "Aliases"
<*> x .@ "Comment"
<*> x .@ "DomainName"
<*> x .@ "Enabled"
<*> x .@ "Id"
<*> x .@ "LastModifiedTime"
<*> x .@ "PriceClass"
<*> x .@ "S3Origin"
<*> x .@ "Status"
<*> x .@ "TrustedSigners"
instance ToXML StreamingDistributionSummary where
toXML StreamingDistributionSummary{..} = nodes "StreamingDistributionSummary"
[ "Id" =@ _sdsId
, "Status" =@ _sdsStatus
, "LastModifiedTime" =@ _sdsLastModifiedTime
, "DomainName" =@ _sdsDomainName
, "S3Origin" =@ _sdsS3Origin
, "Aliases" =@ _sdsAliases
, "TrustedSigners" =@ _sdsTrustedSigners
, "Comment" =@ _sdsComment
, "PriceClass" =@ _sdsPriceClass
, "Enabled" =@ _sdsEnabled
]
data CustomOriginConfig = CustomOriginConfig
{ _cocHTTPPort :: Int
, _cocHTTPSPort :: Int
, _cocOriginProtocolPolicy :: OriginProtocolPolicy
} deriving (Eq, Show)
customOriginConfig :: Int
-> Int
-> OriginProtocolPolicy
-> CustomOriginConfig
customOriginConfig p1 p2 p3 = CustomOriginConfig
{ _cocHTTPPort = p1
, _cocHTTPSPort = p2
, _cocOriginProtocolPolicy = p3
}
cocHTTPPort :: Lens' CustomOriginConfig Int
cocHTTPPort = lens _cocHTTPPort (\s a -> s { _cocHTTPPort = a })
cocHTTPSPort :: Lens' CustomOriginConfig Int
cocHTTPSPort = lens _cocHTTPSPort (\s a -> s { _cocHTTPSPort = a })
cocOriginProtocolPolicy :: Lens' CustomOriginConfig OriginProtocolPolicy
cocOriginProtocolPolicy =
lens _cocOriginProtocolPolicy (\s a -> s { _cocOriginProtocolPolicy = a })
instance FromXML CustomOriginConfig where
parseXML x = CustomOriginConfig
<$> x .@ "HTTPPort"
<*> x .@ "HTTPSPort"
<*> x .@ "OriginProtocolPolicy"
instance ToXML CustomOriginConfig where
toXML CustomOriginConfig{..} = nodes "CustomOriginConfig"
[ "HTTPPort" =@ _cocHTTPPort
, "HTTPSPort" =@ _cocHTTPSPort
, "OriginProtocolPolicy" =@ _cocOriginProtocolPolicy
]
data Aliases = Aliases
{ _aItems :: List "CNAME" Text
, _aQuantity :: Int
} deriving (Eq, Ord, Show)
aliases :: Int
-> Aliases
aliases p1 = Aliases
{ _aQuantity = p1
, _aItems = mempty
}
aItems :: Lens' Aliases [Text]
aItems = lens _aItems (\s a -> s { _aItems = a }) . _List
aQuantity :: Lens' Aliases Int
aQuantity = lens _aQuantity (\s a -> s { _aQuantity = a })
instance FromXML Aliases where
parseXML x = Aliases
<$> x .@ "Items"
<*> x .@ "Quantity"
instance ToXML Aliases where
toXML Aliases{..} = nodes "Aliases"
[ "Quantity" =@ _aQuantity
, "Items" =@ _aItems
]
data InvalidationBatch = InvalidationBatch
{ _ibCallerReference :: Text
, _ibPaths :: Paths
} deriving (Eq, Show)
invalidationBatch :: Paths
-> Text
-> InvalidationBatch
invalidationBatch p1 p2 = InvalidationBatch
{ _ibPaths = p1
, _ibCallerReference = p2
}
ibCallerReference :: Lens' InvalidationBatch Text
ibCallerReference =
lens _ibCallerReference (\s a -> s { _ibCallerReference = a })
ibPaths :: Lens' InvalidationBatch Paths
ibPaths = lens _ibPaths (\s a -> s { _ibPaths = a })
instance FromXML InvalidationBatch where
parseXML x = InvalidationBatch
<$> x .@ "CallerReference"
<*> x .@ "Paths"
instance ToXML InvalidationBatch where
toXML InvalidationBatch{..} = nodes "InvalidationBatch"
[ "Paths" =@ _ibPaths
, "CallerReference" =@ _ibCallerReference
]
data InvalidationSummary = InvalidationSummary
{ _isCreateTime :: ISO8601
, _isId :: Text
, _isStatus :: Text
} deriving (Eq, Ord, Show)
invalidationSummary :: Text
-> UTCTime
-> Text
-> InvalidationSummary
invalidationSummary p1 p2 p3 = InvalidationSummary
{ _isId = p1
, _isCreateTime = withIso _Time (const id) p2
, _isStatus = p3
}
isCreateTime :: Lens' InvalidationSummary UTCTime
isCreateTime = lens _isCreateTime (\s a -> s { _isCreateTime = a }) . _Time
isId :: Lens' InvalidationSummary Text
isId = lens _isId (\s a -> s { _isId = a })
isStatus :: Lens' InvalidationSummary Text
isStatus = lens _isStatus (\s a -> s { _isStatus = a })
instance FromXML InvalidationSummary where
parseXML x = InvalidationSummary
<$> x .@ "CreateTime"
<*> x .@ "Id"
<*> x .@ "Status"
instance ToXML InvalidationSummary where
toXML InvalidationSummary{..} = nodes "InvalidationSummary"
[ "Id" =@ _isId
, "CreateTime" =@ _isCreateTime
, "Status" =@ _isStatus
]
data DistributionConfig = DistributionConfig
{ _dcAliases :: Aliases
, _dcCacheBehaviors :: CacheBehaviors
, _dcCallerReference :: Text
, _dcComment :: Text
, _dcCustomErrorResponses :: Maybe CustomErrorResponses
, _dcDefaultCacheBehavior :: DefaultCacheBehavior
, _dcDefaultRootObject :: Text
, _dcEnabled :: Bool
, _dcLogging :: LoggingConfig
, _dcOrigins :: Origins
, _dcPriceClass :: PriceClass
, _dcRestrictions :: Maybe Restrictions
, _dcViewerCertificate :: Maybe ViewerCertificate
} deriving (Eq, Show)
distributionConfig :: Text
-> Aliases
-> Text
-> Origins
-> DefaultCacheBehavior
-> CacheBehaviors
-> Text
-> LoggingConfig
-> PriceClass
-> Bool
-> DistributionConfig
distributionConfig p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 = DistributionConfig
{ _dcCallerReference = p1
, _dcAliases = p2
, _dcDefaultRootObject = p3
, _dcOrigins = p4
, _dcDefaultCacheBehavior = p5
, _dcCacheBehaviors = p6
, _dcComment = p7
, _dcLogging = p8
, _dcPriceClass = p9
, _dcEnabled = p10
, _dcCustomErrorResponses = Nothing
, _dcViewerCertificate = Nothing
, _dcRestrictions = Nothing
}
dcAliases :: Lens' DistributionConfig Aliases
dcAliases = lens _dcAliases (\s a -> s { _dcAliases = a })
dcCacheBehaviors :: Lens' DistributionConfig CacheBehaviors
dcCacheBehaviors = lens _dcCacheBehaviors (\s a -> s { _dcCacheBehaviors = a })
dcCallerReference :: Lens' DistributionConfig Text
dcCallerReference =
lens _dcCallerReference (\s a -> s { _dcCallerReference = a })
dcComment :: Lens' DistributionConfig Text
dcComment = lens _dcComment (\s a -> s { _dcComment = a })
dcCustomErrorResponses :: Lens' DistributionConfig (Maybe CustomErrorResponses)
dcCustomErrorResponses =
lens _dcCustomErrorResponses (\s a -> s { _dcCustomErrorResponses = a })
dcDefaultCacheBehavior :: Lens' DistributionConfig DefaultCacheBehavior
dcDefaultCacheBehavior =
lens _dcDefaultCacheBehavior (\s a -> s { _dcDefaultCacheBehavior = a })
dcDefaultRootObject :: Lens' DistributionConfig Text
dcDefaultRootObject =
lens _dcDefaultRootObject (\s a -> s { _dcDefaultRootObject = a })
dcEnabled :: Lens' DistributionConfig Bool
dcEnabled = lens _dcEnabled (\s a -> s { _dcEnabled = a })
dcLogging :: Lens' DistributionConfig LoggingConfig
dcLogging = lens _dcLogging (\s a -> s { _dcLogging = a })
dcOrigins :: Lens' DistributionConfig Origins
dcOrigins = lens _dcOrigins (\s a -> s { _dcOrigins = a })
dcPriceClass :: Lens' DistributionConfig PriceClass
dcPriceClass = lens _dcPriceClass (\s a -> s { _dcPriceClass = a })
dcRestrictions :: Lens' DistributionConfig (Maybe Restrictions)
dcRestrictions = lens _dcRestrictions (\s a -> s { _dcRestrictions = a })
dcViewerCertificate :: Lens' DistributionConfig (Maybe ViewerCertificate)
dcViewerCertificate =
lens _dcViewerCertificate (\s a -> s { _dcViewerCertificate = a })
instance FromXML DistributionConfig where
parseXML x = DistributionConfig
<$> x .@ "Aliases"
<*> x .@ "CacheBehaviors"
<*> x .@ "CallerReference"
<*> x .@ "Comment"
<*> x .@? "CustomErrorResponses"
<*> x .@ "DefaultCacheBehavior"
<*> x .@ "DefaultRootObject"
<*> x .@ "Enabled"
<*> x .@ "Logging"
<*> x .@ "Origins"
<*> x .@ "PriceClass"
<*> x .@? "Restrictions"
<*> x .@? "ViewerCertificate"
instance ToXMLRoot DistributionConfig where
toXMLRoot DistributionConfig{..} = namespaced ns "DistributionConfig"
[ "CallerReference" =@ _dcCallerReference
, "Aliases" =@ _dcAliases
, "DefaultRootObject" =@ _dcDefaultRootObject
, "Origins" =@ _dcOrigins
, "DefaultCacheBehavior" =@ _dcDefaultCacheBehavior
, "CacheBehaviors" =@ _dcCacheBehaviors
, "CustomErrorResponses" =@ _dcCustomErrorResponses
, "Comment" =@ _dcComment
, "Logging" =@ _dcLogging
, "PriceClass" =@ _dcPriceClass
, "Enabled" =@ _dcEnabled
, "ViewerCertificate" =@ _dcViewerCertificate
, "Restrictions" =@ _dcRestrictions
]
instance ToXML DistributionConfig
data CacheBehavior = CacheBehavior
{ _cbAllowedMethods :: Maybe AllowedMethods
, _cbForwardedValues :: ForwardedValues
, _cbMinTTL :: Integer
, _cbPathPattern :: Text
, _cbSmoothStreaming :: Maybe Bool
, _cbTargetOriginId :: Text
, _cbTrustedSigners :: TrustedSigners
, _cbViewerProtocolPolicy :: ViewerProtocolPolicy
} deriving (Eq, Show)
cacheBehavior :: Text
-> Text
-> ForwardedValues
-> TrustedSigners
-> ViewerProtocolPolicy
-> Integer
-> CacheBehavior
cacheBehavior p1 p2 p3 p4 p5 p6 = CacheBehavior
{ _cbPathPattern = p1
, _cbTargetOriginId = p2
, _cbForwardedValues = p3
, _cbTrustedSigners = p4
, _cbViewerProtocolPolicy = p5
, _cbMinTTL = p6
, _cbAllowedMethods = Nothing
, _cbSmoothStreaming = Nothing
}
cbAllowedMethods :: Lens' CacheBehavior (Maybe AllowedMethods)
cbAllowedMethods = lens _cbAllowedMethods (\s a -> s { _cbAllowedMethods = a })
cbForwardedValues :: Lens' CacheBehavior ForwardedValues
cbForwardedValues =
lens _cbForwardedValues (\s a -> s { _cbForwardedValues = a })
cbMinTTL :: Lens' CacheBehavior Integer
cbMinTTL = lens _cbMinTTL (\s a -> s { _cbMinTTL = a })
cbPathPattern :: Lens' CacheBehavior Text
cbPathPattern = lens _cbPathPattern (\s a -> s { _cbPathPattern = a })
cbSmoothStreaming :: Lens' CacheBehavior (Maybe Bool)
cbSmoothStreaming =
lens _cbSmoothStreaming (\s a -> s { _cbSmoothStreaming = a })
cbTargetOriginId :: Lens' CacheBehavior Text
cbTargetOriginId = lens _cbTargetOriginId (\s a -> s { _cbTargetOriginId = a })
cbTrustedSigners :: Lens' CacheBehavior TrustedSigners
cbTrustedSigners = lens _cbTrustedSigners (\s a -> s { _cbTrustedSigners = a })
cbViewerProtocolPolicy :: Lens' CacheBehavior ViewerProtocolPolicy
cbViewerProtocolPolicy =
lens _cbViewerProtocolPolicy (\s a -> s { _cbViewerProtocolPolicy = a })
instance FromXML CacheBehavior where
parseXML x = CacheBehavior
<$> x .@? "AllowedMethods"
<*> x .@ "ForwardedValues"
<*> x .@ "MinTTL"
<*> x .@ "PathPattern"
<*> x .@? "SmoothStreaming"
<*> x .@ "TargetOriginId"
<*> x .@ "TrustedSigners"
<*> x .@ "ViewerProtocolPolicy"
instance ToXML CacheBehavior where
toXML CacheBehavior{..} = nodes "CacheBehavior"
[ "PathPattern" =@ _cbPathPattern
, "TargetOriginId" =@ _cbTargetOriginId
, "ForwardedValues" =@ _cbForwardedValues
, "TrustedSigners" =@ _cbTrustedSigners
, "ViewerProtocolPolicy" =@ _cbViewerProtocolPolicy
, "MinTTL" =@ _cbMinTTL
, "AllowedMethods" =@ _cbAllowedMethods
, "SmoothStreaming" =@ _cbSmoothStreaming
]
data DistributionList = DistributionList
{ _dlIsTruncated :: Bool
, _dlItems :: List "DistributionSummary" DistributionSummary
, _dlMarker :: Text
, _dlMaxItems :: Int
, _dlNextMarker :: Maybe Text
, _dlQuantity :: Int
} deriving (Eq, Show)
distributionList :: Text
-> Int
-> Bool
-> Int
-> DistributionList
distributionList p1 p2 p3 p4 = DistributionList
{ _dlMarker = p1
, _dlMaxItems = p2
, _dlIsTruncated = p3
, _dlQuantity = p4
, _dlNextMarker = Nothing
, _dlItems = mempty
}
dlIsTruncated :: Lens' DistributionList Bool
dlIsTruncated = lens _dlIsTruncated (\s a -> s { _dlIsTruncated = a })
dlItems :: Lens' DistributionList [DistributionSummary]
dlItems = lens _dlItems (\s a -> s { _dlItems = a }) . _List
dlMarker :: Lens' DistributionList Text
dlMarker = lens _dlMarker (\s a -> s { _dlMarker = a })
dlMaxItems :: Lens' DistributionList Int
dlMaxItems = lens _dlMaxItems (\s a -> s { _dlMaxItems = a })
dlNextMarker :: Lens' DistributionList (Maybe Text)
dlNextMarker = lens _dlNextMarker (\s a -> s { _dlNextMarker = a })
dlQuantity :: Lens' DistributionList Int
dlQuantity = lens _dlQuantity (\s a -> s { _dlQuantity = a })
instance FromXML DistributionList where
parseXML x = DistributionList
<$> x .@ "IsTruncated"
<*> x .@ "Items"
<*> x .@ "Marker"
<*> x .@ "MaxItems"
<*> x .@? "NextMarker"
<*> x .@ "Quantity"
instance ToXML DistributionList where
toXML DistributionList{..} = nodes "DistributionList"
[ "Marker" =@ _dlMarker
, "NextMarker" =@ _dlNextMarker
, "MaxItems" =@ _dlMaxItems
, "IsTruncated" =@ _dlIsTruncated
, "Quantity" =@ _dlQuantity
, "Items" =@ _dlItems
]
data KeyPairIds = KeyPairIds
{ _kpiItems :: List "KeyPairId" Text
, _kpiQuantity :: Int
} deriving (Eq, Ord, Show)
keyPairIds :: Int
-> KeyPairIds
keyPairIds p1 = KeyPairIds
{ _kpiQuantity = p1
, _kpiItems = mempty
}
kpiItems :: Lens' KeyPairIds [Text]
kpiItems = lens _kpiItems (\s a -> s { _kpiItems = a }) . _List
kpiQuantity :: Lens' KeyPairIds Int
kpiQuantity = lens _kpiQuantity (\s a -> s { _kpiQuantity = a })
instance FromXML KeyPairIds where
parseXML x = KeyPairIds
<$> x .@ "Items"
<*> x .@ "Quantity"
instance ToXML KeyPairIds where
toXML KeyPairIds{..} = nodes "KeyPairIds"
[ "Quantity" =@ _kpiQuantity
, "Items" =@ _kpiItems
]
data PriceClass
= PriceClass100
| PriceClass200
| PriceClassAll
deriving (Eq, Ord, Show, Generic, Enum)
instance Hashable PriceClass
instance FromText PriceClass where
parser = takeText >>= \case
"PriceClass_100" -> pure PriceClass100
"PriceClass_200" -> pure PriceClass200
"PriceClass_All" -> pure PriceClassAll
e -> fail $
"Failure parsing PriceClass from " ++ show e
instance ToText PriceClass where
toText = \case
PriceClass100 -> "PriceClass_100"
PriceClass200 -> "PriceClass_200"
PriceClassAll -> "PriceClass_All"
instance ToByteString PriceClass
instance ToHeader PriceClass
instance ToQuery PriceClass
instance FromXML PriceClass where
parseXML = parseXMLText "PriceClass"
instance ToXML PriceClass where
toXML = toXMLText
data CustomErrorResponses = CustomErrorResponses
{ _cerItems :: List "CustomErrorResponse" CustomErrorResponse
, _cerQuantity :: Int
} deriving (Eq, Show)
customErrorResponses :: Int
-> CustomErrorResponses
customErrorResponses p1 = CustomErrorResponses
{ _cerQuantity = p1
, _cerItems = mempty
}
cerItems :: Lens' CustomErrorResponses [CustomErrorResponse]
cerItems = lens _cerItems (\s a -> s { _cerItems = a }) . _List
cerQuantity :: Lens' CustomErrorResponses Int
cerQuantity = lens _cerQuantity (\s a -> s { _cerQuantity = a })
instance FromXML CustomErrorResponses where
parseXML x = CustomErrorResponses
<$> x .@ "Items"
<*> x .@ "Quantity"
instance ToXML CustomErrorResponses where
toXML CustomErrorResponses{..} = nodes "CustomErrorResponses"
[ "Quantity" =@ _cerQuantity
, "Items" =@ _cerItems
]
newtype S3OriginConfig = S3OriginConfig
{ _socOriginAccessIdentity :: Text
} deriving (Eq, Ord, Show, Monoid, IsString)
s3OriginConfig :: Text
-> S3OriginConfig
s3OriginConfig p1 = S3OriginConfig
{ _socOriginAccessIdentity = p1
}
socOriginAccessIdentity :: Lens' S3OriginConfig Text
socOriginAccessIdentity =
lens _socOriginAccessIdentity (\s a -> s { _socOriginAccessIdentity = a })
instance FromXML S3OriginConfig where
parseXML x = S3OriginConfig
<$> x .@ "OriginAccessIdentity"
instance ToXML S3OriginConfig where
toXML S3OriginConfig{..} = nodes "S3OriginConfig"
[ "OriginAccessIdentity" =@ _socOriginAccessIdentity
]
data GeoRestriction = GeoRestriction
{ _grItems :: List "Location" Text
, _grQuantity :: Int
, _grRestrictionType :: GeoRestrictionType
} deriving (Eq, Show)
geoRestriction :: GeoRestrictionType
-> Int
-> GeoRestriction
geoRestriction p1 p2 = GeoRestriction
{ _grRestrictionType = p1
, _grQuantity = p2
, _grItems = mempty
}
grItems :: Lens' GeoRestriction [Text]
grItems = lens _grItems (\s a -> s { _grItems = a }) . _List
grQuantity :: Lens' GeoRestriction Int
grQuantity = lens _grQuantity (\s a -> s { _grQuantity = a })
grRestrictionType :: Lens' GeoRestriction GeoRestrictionType
grRestrictionType =
lens _grRestrictionType (\s a -> s { _grRestrictionType = a })
instance FromXML GeoRestriction where
parseXML x = GeoRestriction
<$> x .@ "Items"
<*> x .@ "Quantity"
<*> x .@ "RestrictionType"
instance ToXML GeoRestriction where
toXML GeoRestriction{..} = nodes "GeoRestriction"
[ "RestrictionType" =@ _grRestrictionType
, "Quantity" =@ _grQuantity
, "Items" =@ _grItems
]
data S3Origin = S3Origin
{ _soDomainName :: Text
, _soOriginAccessIdentity :: Text
} deriving (Eq, Ord, Show)
s3Origin :: Text
-> Text
-> S3Origin
s3Origin p1 p2 = S3Origin
{ _soDomainName = p1
, _soOriginAccessIdentity = p2
}
soDomainName :: Lens' S3Origin Text
soDomainName = lens _soDomainName (\s a -> s { _soDomainName = a })
soOriginAccessIdentity :: Lens' S3Origin Text
soOriginAccessIdentity =
lens _soOriginAccessIdentity (\s a -> s { _soOriginAccessIdentity = a })
instance FromXML S3Origin where
parseXML x = S3Origin
<$> x .@ "DomainName"
<*> x .@ "OriginAccessIdentity"
instance ToXML S3Origin where
toXML S3Origin{..} = nodes "S3Origin"
[ "DomainName" =@ _soDomainName
, "OriginAccessIdentity" =@ _soOriginAccessIdentity
]
data Headers = Headers
{ _hItems :: List "Name" Text
, _hQuantity :: Int
} deriving (Eq, Ord, Show)
headers :: Int
-> Headers
headers p1 = Headers
{ _hQuantity = p1
, _hItems = mempty
}
hItems :: Lens' Headers [Text]
hItems = lens _hItems (\s a -> s { _hItems = a }) . _List
hQuantity :: Lens' Headers Int
hQuantity = lens _hQuantity (\s a -> s { _hQuantity = a })
instance FromXML Headers where
parseXML x = Headers
<$> x .@ "Items"
<*> x .@ "Quantity"
instance ToXML Headers where
toXML Headers{..} = nodes "Headers"
[ "Quantity" =@ _hQuantity
, "Items" =@ _hItems
]
data ViewerCertificate = ViewerCertificate
{ _vcCloudFrontDefaultCertificate :: Maybe Bool
, _vcIAMCertificateId :: Maybe Text
, _vcSSLSupportMethod :: Maybe SSLSupportMethod
} deriving (Eq, Show)
viewerCertificate :: ViewerCertificate
viewerCertificate = ViewerCertificate
{ _vcIAMCertificateId = Nothing
, _vcCloudFrontDefaultCertificate = Nothing
, _vcSSLSupportMethod = Nothing
}
vcCloudFrontDefaultCertificate :: Lens' ViewerCertificate (Maybe Bool)
vcCloudFrontDefaultCertificate =
lens _vcCloudFrontDefaultCertificate
(\s a -> s { _vcCloudFrontDefaultCertificate = a })
vcIAMCertificateId :: Lens' ViewerCertificate (Maybe Text)
vcIAMCertificateId =
lens _vcIAMCertificateId (\s a -> s { _vcIAMCertificateId = a })
vcSSLSupportMethod :: Lens' ViewerCertificate (Maybe SSLSupportMethod)
vcSSLSupportMethod =
lens _vcSSLSupportMethod (\s a -> s { _vcSSLSupportMethod = a })
instance FromXML ViewerCertificate where
parseXML x = ViewerCertificate
<$> x .@? "CloudFrontDefaultCertificate"
<*> x .@? "IAMCertificateId"
<*> x .@? "SSLSupportMethod"
instance ToXML ViewerCertificate where
toXML ViewerCertificate{..} = nodes "ViewerCertificate"
[ "IAMCertificateId" =@ _vcIAMCertificateId
, "CloudFrontDefaultCertificate" =@ _vcCloudFrontDefaultCertificate
, "SSLSupportMethod" =@ _vcSSLSupportMethod
]
newtype Restrictions = Restrictions
{ _rGeoRestriction :: GeoRestriction
} deriving (Eq, Show)
restrictions :: GeoRestriction
-> Restrictions
restrictions p1 = Restrictions
{ _rGeoRestriction = p1
}
rGeoRestriction :: Lens' Restrictions GeoRestriction
rGeoRestriction = lens _rGeoRestriction (\s a -> s { _rGeoRestriction = a })
instance FromXML Restrictions where
parseXML x = Restrictions
<$> x .@ "GeoRestriction"
instance ToXML Restrictions where
toXML Restrictions{..} = nodes "Restrictions"
[ "GeoRestriction" =@ _rGeoRestriction
]
data Origins = Origins
{ _oItems :: List1 "Origin" Origin
, _oQuantity :: Int
} deriving (Eq, Show)
origins :: Int
-> NonEmpty Origin
-> Origins
origins p1 p2 = Origins
{ _oQuantity = p1
, _oItems = withIso _List1 (const id) p2
}
oItems :: Lens' Origins (NonEmpty Origin)
oItems = lens _oItems (\s a -> s { _oItems = a }) . _List1
oQuantity :: Lens' Origins Int
oQuantity = lens _oQuantity (\s a -> s { _oQuantity = a })
instance FromXML Origins where
parseXML x = Origins
<$> x .@ "Items"
<*> x .@ "Quantity"
instance ToXML Origins where
toXML Origins{..} = nodes "Origins"
[ "Quantity" =@ _oQuantity
, "Items" =@ _oItems
]
data Method
= Delete'
| Get
| Head'
| Options
| Patch
| Post
| Put
deriving (Eq, Ord, Show, Generic, Enum)
instance Hashable Method
instance FromText Method where
parser = takeText >>= \case
"DELETE" -> pure Delete'
"GET" -> pure Get
"HEAD" -> pure Head'
"OPTIONS" -> pure Options
"PATCH" -> pure Patch
"POST" -> pure Post
"PUT" -> pure Put
e -> fail $
"Failure parsing Method from " ++ show e
instance ToText Method where
toText = \case
Delete' -> "DELETE"
Get -> "GET"
Head' -> "HEAD"
Options -> "OPTIONS"
Patch -> "PATCH"
Post -> "POST"
Put -> "PUT"
instance ToByteString Method
instance ToHeader Method
instance ToQuery Method
instance FromXML Method where
parseXML = parseXMLText "Method"
instance ToXML Method where
toXML = toXMLText
data ForwardedValues = ForwardedValues
{ _fvCookies :: CookiePreference
, _fvHeaders :: Maybe Headers
, _fvQueryString :: Bool
} deriving (Eq, Show)
forwardedValues :: Bool
-> CookiePreference
-> ForwardedValues
forwardedValues p1 p2 = ForwardedValues
{ _fvQueryString = p1
, _fvCookies = p2
, _fvHeaders = Nothing
}
fvCookies :: Lens' ForwardedValues CookiePreference
fvCookies = lens _fvCookies (\s a -> s { _fvCookies = a })
fvHeaders :: Lens' ForwardedValues (Maybe Headers)
fvHeaders = lens _fvHeaders (\s a -> s { _fvHeaders = a })
fvQueryString :: Lens' ForwardedValues Bool
fvQueryString = lens _fvQueryString (\s a -> s { _fvQueryString = a })
instance FromXML ForwardedValues where
parseXML x = ForwardedValues
<$> x .@ "Cookies"
<*> x .@? "Headers"
<*> x .@ "QueryString"
instance ToXML ForwardedValues where
toXML ForwardedValues{..} = nodes "ForwardedValues"
[ "QueryString" =@ _fvQueryString
, "Cookies" =@ _fvCookies
, "Headers" =@ _fvHeaders
]
data TrustedSigners = TrustedSigners
{ _tsEnabled :: Bool
, _tsItems :: List "AwsAccountNumber" Text
, _tsQuantity :: Int
} deriving (Eq, Ord, Show)
trustedSigners :: Bool
-> Int
-> TrustedSigners
trustedSigners p1 p2 = TrustedSigners
{ _tsEnabled = p1
, _tsQuantity = p2
, _tsItems = mempty
}
tsEnabled :: Lens' TrustedSigners Bool
tsEnabled = lens _tsEnabled (\s a -> s { _tsEnabled = a })
tsItems :: Lens' TrustedSigners [Text]
tsItems = lens _tsItems (\s a -> s { _tsItems = a }) . _List
tsQuantity :: Lens' TrustedSigners Int
tsQuantity = lens _tsQuantity (\s a -> s { _tsQuantity = a })
instance FromXML TrustedSigners where
parseXML x = TrustedSigners
<$> x .@ "Enabled"
<*> x .@ "Items"
<*> x .@ "Quantity"
instance ToXML TrustedSigners where
toXML TrustedSigners{..} = nodes "TrustedSigners"
[ "Enabled" =@ _tsEnabled
, "Quantity" =@ _tsQuantity
, "Items" =@ _tsItems
]
data ItemSelection
= All
| None
| Whitelist
deriving (Eq, Ord, Show, Generic, Enum)
instance Hashable ItemSelection
instance FromText ItemSelection where
parser = takeText >>= \case
"all" -> pure All
"none" -> pure None
"whitelist" -> pure Whitelist
e -> fail $
"Failure parsing ItemSelection from " ++ show e
instance ToText ItemSelection where
toText = \case
All -> "all"
None -> "none"
Whitelist -> "whitelist"
instance ToByteString ItemSelection
instance ToHeader ItemSelection
instance ToQuery ItemSelection
instance FromXML ItemSelection where
parseXML = parseXMLText "ItemSelection"
instance ToXML ItemSelection where
toXML = toXMLText
data StreamingLoggingConfig = StreamingLoggingConfig
{ _slcBucket :: Text
, _slcEnabled :: Bool
, _slcPrefix :: Text
} deriving (Eq, Ord, Show)
streamingLoggingConfig :: Bool
-> Text
-> Text
-> StreamingLoggingConfig
streamingLoggingConfig p1 p2 p3 = StreamingLoggingConfig
{ _slcEnabled = p1
, _slcBucket = p2
, _slcPrefix = p3
}
slcBucket :: Lens' StreamingLoggingConfig Text
slcBucket = lens _slcBucket (\s a -> s { _slcBucket = a })
slcEnabled :: Lens' StreamingLoggingConfig Bool
slcEnabled = lens _slcEnabled (\s a -> s { _slcEnabled = a })
slcPrefix :: Lens' StreamingLoggingConfig Text
slcPrefix = lens _slcPrefix (\s a -> s { _slcPrefix = a })
instance FromXML StreamingLoggingConfig where
parseXML x = StreamingLoggingConfig
<$> x .@ "Bucket"
<*> x .@ "Enabled"
<*> x .@ "Prefix"
instance ToXML StreamingLoggingConfig where
toXML StreamingLoggingConfig{..} = nodes "StreamingLoggingConfig"
[ "Enabled" =@ _slcEnabled
, "Bucket" =@ _slcBucket
, "Prefix" =@ _slcPrefix
]
data CookieNames = CookieNames
{ _cnItems :: List "Name" Text
, _cnQuantity :: Int
} deriving (Eq, Ord, Show)
cookieNames :: Int
-> CookieNames
cookieNames p1 = CookieNames
{ _cnQuantity = p1
, _cnItems = mempty
}
cnItems :: Lens' CookieNames [Text]
cnItems = lens _cnItems (\s a -> s { _cnItems = a }) . _List
cnQuantity :: Lens' CookieNames Int
cnQuantity = lens _cnQuantity (\s a -> s { _cnQuantity = a })
instance FromXML CookieNames where
parseXML x = CookieNames
<$> x .@ "Items"
<*> x .@ "Quantity"
instance ToXML CookieNames where
toXML CookieNames{..} = nodes "CookieNames"
[ "Quantity" =@ _cnQuantity
, "Items" =@ _cnItems
]
data CustomErrorResponse = CustomErrorResponse
{ _cerErrorCachingMinTTL :: Maybe Integer
, _cerErrorCode :: Int
, _cerResponseCode :: Maybe Text
, _cerResponsePagePath :: Maybe Text
} deriving (Eq, Ord, Show)
customErrorResponse :: Int
-> CustomErrorResponse
customErrorResponse p1 = CustomErrorResponse
{ _cerErrorCode = p1
, _cerResponsePagePath = Nothing
, _cerResponseCode = Nothing
, _cerErrorCachingMinTTL = Nothing
}
cerErrorCachingMinTTL :: Lens' CustomErrorResponse (Maybe Integer)
cerErrorCachingMinTTL =
lens _cerErrorCachingMinTTL (\s a -> s { _cerErrorCachingMinTTL = a })
cerErrorCode :: Lens' CustomErrorResponse Int
cerErrorCode = lens _cerErrorCode (\s a -> s { _cerErrorCode = a })
cerResponseCode :: Lens' CustomErrorResponse (Maybe Text)
cerResponseCode = lens _cerResponseCode (\s a -> s { _cerResponseCode = a })
cerResponsePagePath :: Lens' CustomErrorResponse (Maybe Text)
cerResponsePagePath =
lens _cerResponsePagePath (\s a -> s { _cerResponsePagePath = a })
instance FromXML CustomErrorResponse where
parseXML x = CustomErrorResponse
<$> x .@? "ErrorCachingMinTTL"
<*> x .@ "ErrorCode"
<*> x .@? "ResponseCode"
<*> x .@? "ResponsePagePath"
instance ToXML CustomErrorResponse where
toXML CustomErrorResponse{..} = nodes "CustomErrorResponse"
[ "ErrorCode" =@ _cerErrorCode
, "ResponsePagePath" =@ _cerResponsePagePath
, "ResponseCode" =@ _cerResponseCode
, "ErrorCachingMinTTL" =@ _cerErrorCachingMinTTL
]
data CacheBehaviors = CacheBehaviors
{ _cbItems :: List "CacheBehavior" CacheBehavior
, _cbQuantity :: Int
} deriving (Eq, Show)
cacheBehaviors :: Int
-> CacheBehaviors
cacheBehaviors p1 = CacheBehaviors
{ _cbQuantity = p1
, _cbItems = mempty
}
cbItems :: Lens' CacheBehaviors [CacheBehavior]
cbItems = lens _cbItems (\s a -> s { _cbItems = a }) . _List
cbQuantity :: Lens' CacheBehaviors Int
cbQuantity = lens _cbQuantity (\s a -> s { _cbQuantity = a })
instance FromXML CacheBehaviors where
parseXML x = CacheBehaviors
<$> x .@ "Items"
<*> x .@ "Quantity"
instance ToXML CacheBehaviors where
toXML CacheBehaviors{..} = nodes "CacheBehaviors"
[ "Quantity" =@ _cbQuantity
, "Items" =@ _cbItems
]
data DefaultCacheBehavior = DefaultCacheBehavior
{ _dcbAllowedMethods :: Maybe AllowedMethods
, _dcbForwardedValues :: ForwardedValues
, _dcbMinTTL :: Integer
, _dcbSmoothStreaming :: Maybe Bool
, _dcbTargetOriginId :: Text
, _dcbTrustedSigners :: TrustedSigners
, _dcbViewerProtocolPolicy :: ViewerProtocolPolicy
} deriving (Eq, Show)
defaultCacheBehavior :: Text
-> ForwardedValues
-> TrustedSigners
-> ViewerProtocolPolicy
-> Integer
-> DefaultCacheBehavior
defaultCacheBehavior p1 p2 p3 p4 p5 = DefaultCacheBehavior
{ _dcbTargetOriginId = p1
, _dcbForwardedValues = p2
, _dcbTrustedSigners = p3
, _dcbViewerProtocolPolicy = p4
, _dcbMinTTL = p5
, _dcbAllowedMethods = Nothing
, _dcbSmoothStreaming = Nothing
}
dcbAllowedMethods :: Lens' DefaultCacheBehavior (Maybe AllowedMethods)
dcbAllowedMethods =
lens _dcbAllowedMethods (\s a -> s { _dcbAllowedMethods = a })
dcbForwardedValues :: Lens' DefaultCacheBehavior ForwardedValues
dcbForwardedValues =
lens _dcbForwardedValues (\s a -> s { _dcbForwardedValues = a })
dcbMinTTL :: Lens' DefaultCacheBehavior Integer
dcbMinTTL = lens _dcbMinTTL (\s a -> s { _dcbMinTTL = a })
dcbSmoothStreaming :: Lens' DefaultCacheBehavior (Maybe Bool)
dcbSmoothStreaming =
lens _dcbSmoothStreaming (\s a -> s { _dcbSmoothStreaming = a })
dcbTargetOriginId :: Lens' DefaultCacheBehavior Text
dcbTargetOriginId =
lens _dcbTargetOriginId (\s a -> s { _dcbTargetOriginId = a })
dcbTrustedSigners :: Lens' DefaultCacheBehavior TrustedSigners
dcbTrustedSigners =
lens _dcbTrustedSigners (\s a -> s { _dcbTrustedSigners = a })
dcbViewerProtocolPolicy :: Lens' DefaultCacheBehavior ViewerProtocolPolicy
dcbViewerProtocolPolicy =
lens _dcbViewerProtocolPolicy (\s a -> s { _dcbViewerProtocolPolicy = a })
instance FromXML DefaultCacheBehavior where
parseXML x = DefaultCacheBehavior
<$> x .@? "AllowedMethods"
<*> x .@ "ForwardedValues"
<*> x .@ "MinTTL"
<*> x .@? "SmoothStreaming"
<*> x .@ "TargetOriginId"
<*> x .@ "TrustedSigners"
<*> x .@ "ViewerProtocolPolicy"
instance ToXML DefaultCacheBehavior where
toXML DefaultCacheBehavior{..} = nodes "DefaultCacheBehavior"
[ "TargetOriginId" =@ _dcbTargetOriginId
, "ForwardedValues" =@ _dcbForwardedValues
, "TrustedSigners" =@ _dcbTrustedSigners
, "ViewerProtocolPolicy" =@ _dcbViewerProtocolPolicy
, "MinTTL" =@ _dcbMinTTL
, "AllowedMethods" =@ _dcbAllowedMethods
, "SmoothStreaming" =@ _dcbSmoothStreaming
]
data InvalidationList = InvalidationList
{ _ilIsTruncated :: Bool
, _ilItems :: List "InvalidationSummary" InvalidationSummary
, _ilMarker :: Text
, _ilMaxItems :: Int
, _ilNextMarker :: Maybe Text
, _ilQuantity :: Int
} deriving (Eq, Show)
invalidationList :: Text
-> Int
-> Bool
-> Int
-> InvalidationList
invalidationList p1 p2 p3 p4 = InvalidationList
{ _ilMarker = p1
, _ilMaxItems = p2
, _ilIsTruncated = p3
, _ilQuantity = p4
, _ilNextMarker = Nothing
, _ilItems = mempty
}
ilIsTruncated :: Lens' InvalidationList Bool
ilIsTruncated = lens _ilIsTruncated (\s a -> s { _ilIsTruncated = a })
ilItems :: Lens' InvalidationList [InvalidationSummary]
ilItems = lens _ilItems (\s a -> s { _ilItems = a }) . _List
ilMarker :: Lens' InvalidationList Text
ilMarker = lens _ilMarker (\s a -> s { _ilMarker = a })
ilMaxItems :: Lens' InvalidationList Int
ilMaxItems = lens _ilMaxItems (\s a -> s { _ilMaxItems = a })
ilNextMarker :: Lens' InvalidationList (Maybe Text)
ilNextMarker = lens _ilNextMarker (\s a -> s { _ilNextMarker = a })
ilQuantity :: Lens' InvalidationList Int
ilQuantity = lens _ilQuantity (\s a -> s { _ilQuantity = a })
instance FromXML InvalidationList where
parseXML x = InvalidationList
<$> x .@ "IsTruncated"
<*> x .@ "Items"
<*> x .@ "Marker"
<*> x .@ "MaxItems"
<*> x .@? "NextMarker"
<*> x .@ "Quantity"
instance ToXML InvalidationList where
toXML InvalidationList{..} = nodes "InvalidationList"
[ "Marker" =@ _ilMarker
, "NextMarker" =@ _ilNextMarker
, "MaxItems" =@ _ilMaxItems
, "IsTruncated" =@ _ilIsTruncated
, "Quantity" =@ _ilQuantity
, "Items" =@ _ilItems
]
data StreamingDistribution = StreamingDistribution
{ _sdActiveTrustedSigners :: ActiveTrustedSigners
, _sdDomainName :: Text
, _sdId :: Text
, _sdLastModifiedTime :: Maybe ISO8601
, _sdStatus :: Text
, _sdStreamingDistributionConfig :: StreamingDistributionConfig
} deriving (Eq, Show)
streamingDistribution :: Text
-> Text
-> Text
-> ActiveTrustedSigners
-> StreamingDistributionConfig
-> StreamingDistribution
streamingDistribution p1 p2 p3 p4 p5 = StreamingDistribution
{ _sdId = p1
, _sdStatus = p2
, _sdDomainName = p3
, _sdActiveTrustedSigners = p4
, _sdStreamingDistributionConfig = p5
, _sdLastModifiedTime = Nothing
}
sdActiveTrustedSigners :: Lens' StreamingDistribution ActiveTrustedSigners
sdActiveTrustedSigners =
lens _sdActiveTrustedSigners (\s a -> s { _sdActiveTrustedSigners = a })
sdDomainName :: Lens' StreamingDistribution Text
sdDomainName = lens _sdDomainName (\s a -> s { _sdDomainName = a })
sdId :: Lens' StreamingDistribution Text
sdId = lens _sdId (\s a -> s { _sdId = a })
sdLastModifiedTime :: Lens' StreamingDistribution (Maybe UTCTime)
sdLastModifiedTime =
lens _sdLastModifiedTime (\s a -> s { _sdLastModifiedTime = a })
. mapping _Time
sdStatus :: Lens' StreamingDistribution Text
sdStatus = lens _sdStatus (\s a -> s { _sdStatus = a })
sdStreamingDistributionConfig :: Lens' StreamingDistribution StreamingDistributionConfig
sdStreamingDistributionConfig =
lens _sdStreamingDistributionConfig
(\s a -> s { _sdStreamingDistributionConfig = a })
instance FromXML StreamingDistribution where
parseXML x = StreamingDistribution
<$> x .@ "ActiveTrustedSigners"
<*> x .@ "DomainName"
<*> x .@ "Id"
<*> x .@? "LastModifiedTime"
<*> x .@ "Status"
<*> x .@ "StreamingDistributionConfig"
instance ToXMLRoot StreamingDistribution where
toXMLRoot StreamingDistribution{..} = namespaced ns "StreamingDistribution"
[ "Id" =@ _sdId
, "Status" =@ _sdStatus
, "LastModifiedTime" =@ _sdLastModifiedTime
, "DomainName" =@ _sdDomainName
, "ActiveTrustedSigners" =@ _sdActiveTrustedSigners
, "StreamingDistributionConfig" =@ _sdStreamingDistributionConfig
]
instance ToXML StreamingDistribution
data Paths = Paths
{ _pItems :: List "Path" Text
, _pQuantity :: Int
} deriving (Eq, Ord, Show)
paths :: Int
-> Paths
paths p1 = Paths
{ _pQuantity = p1
, _pItems = mempty
}
pItems :: Lens' Paths [Text]
pItems = lens _pItems (\s a -> s { _pItems = a }) . _List
pQuantity :: Lens' Paths Int
pQuantity = lens _pQuantity (\s a -> s { _pQuantity = a })
instance FromXML Paths where
parseXML x = Paths
<$> x .@ "Items"
<*> x .@ "Quantity"
instance ToXML Paths where
toXML Paths{..} = nodes "Paths"
[ "Quantity" =@ _pQuantity
, "Items" =@ _pItems
]
data CloudFrontOriginAccessIdentity = CloudFrontOriginAccessIdentity
{ _cfoaiCloudFrontOriginAccessIdentityConfig :: Maybe CloudFrontOriginAccessIdentityConfig
, _cfoaiId :: Text
, _cfoaiS3CanonicalUserId :: Text
} deriving (Eq, Show)
cloudFrontOriginAccessIdentity :: Text
-> Text
-> CloudFrontOriginAccessIdentity
cloudFrontOriginAccessIdentity p1 p2 = CloudFrontOriginAccessIdentity
{ _cfoaiId = p1
, _cfoaiS3CanonicalUserId = p2
, _cfoaiCloudFrontOriginAccessIdentityConfig = Nothing
}
cfoaiCloudFrontOriginAccessIdentityConfig :: Lens' CloudFrontOriginAccessIdentity (Maybe CloudFrontOriginAccessIdentityConfig)
cfoaiCloudFrontOriginAccessIdentityConfig =
lens _cfoaiCloudFrontOriginAccessIdentityConfig
(\s a -> s { _cfoaiCloudFrontOriginAccessIdentityConfig = a })
cfoaiId :: Lens' CloudFrontOriginAccessIdentity Text
cfoaiId = lens _cfoaiId (\s a -> s { _cfoaiId = a })
cfoaiS3CanonicalUserId :: Lens' CloudFrontOriginAccessIdentity Text
cfoaiS3CanonicalUserId =
lens _cfoaiS3CanonicalUserId (\s a -> s { _cfoaiS3CanonicalUserId = a })
instance FromXML CloudFrontOriginAccessIdentity where
parseXML x = CloudFrontOriginAccessIdentity
<$> x .@? "CloudFrontOriginAccessIdentityConfig"
<*> x .@ "Id"
<*> x .@ "S3CanonicalUserId"
instance ToXMLRoot CloudFrontOriginAccessIdentity where
toXMLRoot CloudFrontOriginAccessIdentity{..} = namespaced ns "CloudFrontOriginAccessIdentity"
[ "Id" =@ _cfoaiId
, "S3CanonicalUserId" =@ _cfoaiS3CanonicalUserId
, "CloudFrontOriginAccessIdentityConfig" =@ _cfoaiCloudFrontOriginAccessIdentityConfig
]
instance ToXML CloudFrontOriginAccessIdentity
data ActiveTrustedSigners = ActiveTrustedSigners
{ _atsEnabled :: Bool
, _atsItems :: List "Signer" Signer
, _atsQuantity :: Int
} deriving (Eq, Show)
activeTrustedSigners :: Bool
-> Int
-> ActiveTrustedSigners
activeTrustedSigners p1 p2 = ActiveTrustedSigners
{ _atsEnabled = p1
, _atsQuantity = p2
, _atsItems = mempty
}
atsEnabled :: Lens' ActiveTrustedSigners Bool
atsEnabled = lens _atsEnabled (\s a -> s { _atsEnabled = a })
atsItems :: Lens' ActiveTrustedSigners [Signer]
atsItems = lens _atsItems (\s a -> s { _atsItems = a }) . _List
atsQuantity :: Lens' ActiveTrustedSigners Int
atsQuantity = lens _atsQuantity (\s a -> s { _atsQuantity = a })
instance FromXML ActiveTrustedSigners where
parseXML x = ActiveTrustedSigners
<$> x .@ "Enabled"
<*> x .@ "Items"
<*> x .@ "Quantity"
instance ToXML ActiveTrustedSigners where
toXML ActiveTrustedSigners{..} = nodes "ActiveTrustedSigners"
[ "Enabled" =@ _atsEnabled
, "Quantity" =@ _atsQuantity
, "Items" =@ _atsItems
]
data DistributionSummary = DistributionSummary
{ _dsAliases :: Aliases
, _dsCacheBehaviors :: CacheBehaviors
, _dsComment :: Text
, _dsCustomErrorResponses :: CustomErrorResponses
, _dsDefaultCacheBehavior :: DefaultCacheBehavior
, _dsDomainName :: Text
, _dsEnabled :: Bool
, _dsId :: Text
, _dsLastModifiedTime :: ISO8601
, _dsOrigins :: Origins
, _dsPriceClass :: PriceClass
, _dsRestrictions :: Restrictions
, _dsStatus :: Text
, _dsViewerCertificate :: ViewerCertificate
} deriving (Eq, Show)
distributionSummary :: Text
-> Text
-> UTCTime
-> Text
-> Aliases
-> Origins
-> DefaultCacheBehavior
-> CacheBehaviors
-> CustomErrorResponses
-> Text
-> PriceClass
-> Bool
-> ViewerCertificate
-> Restrictions
-> DistributionSummary
distributionSummary p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 = DistributionSummary
{ _dsId = p1
, _dsStatus = p2
, _dsLastModifiedTime = withIso _Time (const id) p3
, _dsDomainName = p4
, _dsAliases = p5
, _dsOrigins = p6
, _dsDefaultCacheBehavior = p7
, _dsCacheBehaviors = p8
, _dsCustomErrorResponses = p9
, _dsComment = p10
, _dsPriceClass = p11
, _dsEnabled = p12
, _dsViewerCertificate = p13
, _dsRestrictions = p14
}
dsAliases :: Lens' DistributionSummary Aliases
dsAliases = lens _dsAliases (\s a -> s { _dsAliases = a })
dsCacheBehaviors :: Lens' DistributionSummary CacheBehaviors
dsCacheBehaviors = lens _dsCacheBehaviors (\s a -> s { _dsCacheBehaviors = a })
dsComment :: Lens' DistributionSummary Text
dsComment = lens _dsComment (\s a -> s { _dsComment = a })
dsCustomErrorResponses :: Lens' DistributionSummary CustomErrorResponses
dsCustomErrorResponses =
lens _dsCustomErrorResponses (\s a -> s { _dsCustomErrorResponses = a })
dsDefaultCacheBehavior :: Lens' DistributionSummary DefaultCacheBehavior
dsDefaultCacheBehavior =
lens _dsDefaultCacheBehavior (\s a -> s { _dsDefaultCacheBehavior = a })
dsDomainName :: Lens' DistributionSummary Text
dsDomainName = lens _dsDomainName (\s a -> s { _dsDomainName = a })
dsEnabled :: Lens' DistributionSummary Bool
dsEnabled = lens _dsEnabled (\s a -> s { _dsEnabled = a })
dsId :: Lens' DistributionSummary Text
dsId = lens _dsId (\s a -> s { _dsId = a })
dsLastModifiedTime :: Lens' DistributionSummary UTCTime
dsLastModifiedTime =
lens _dsLastModifiedTime (\s a -> s { _dsLastModifiedTime = a })
. _Time
dsOrigins :: Lens' DistributionSummary Origins
dsOrigins = lens _dsOrigins (\s a -> s { _dsOrigins = a })
dsPriceClass :: Lens' DistributionSummary PriceClass
dsPriceClass = lens _dsPriceClass (\s a -> s { _dsPriceClass = a })
dsRestrictions :: Lens' DistributionSummary Restrictions
dsRestrictions = lens _dsRestrictions (\s a -> s { _dsRestrictions = a })
dsStatus :: Lens' DistributionSummary Text
dsStatus = lens _dsStatus (\s a -> s { _dsStatus = a })
dsViewerCertificate :: Lens' DistributionSummary ViewerCertificate
dsViewerCertificate =
lens _dsViewerCertificate (\s a -> s { _dsViewerCertificate = a })
instance FromXML DistributionSummary where
parseXML x = DistributionSummary
<$> x .@ "Aliases"
<*> x .@ "CacheBehaviors"
<*> x .@ "Comment"
<*> x .@ "CustomErrorResponses"
<*> x .@ "DefaultCacheBehavior"
<*> x .@ "DomainName"
<*> x .@ "Enabled"
<*> x .@ "Id"
<*> x .@ "LastModifiedTime"
<*> x .@ "Origins"
<*> x .@ "PriceClass"
<*> x .@ "Restrictions"
<*> x .@ "Status"
<*> x .@ "ViewerCertificate"
instance ToXML DistributionSummary where
toXML DistributionSummary{..} = nodes "DistributionSummary"
[ "Id" =@ _dsId
, "Status" =@ _dsStatus
, "LastModifiedTime" =@ _dsLastModifiedTime
, "DomainName" =@ _dsDomainName
, "Aliases" =@ _dsAliases
, "Origins" =@ _dsOrigins
, "DefaultCacheBehavior" =@ _dsDefaultCacheBehavior
, "CacheBehaviors" =@ _dsCacheBehaviors
, "CustomErrorResponses" =@ _dsCustomErrorResponses
, "Comment" =@ _dsComment
, "PriceClass" =@ _dsPriceClass
, "Enabled" =@ _dsEnabled
, "ViewerCertificate" =@ _dsViewerCertificate
, "Restrictions" =@ _dsRestrictions
]
data GeoRestrictionType
= GRTBlacklist
| GRTNone
| GRTWhitelist
deriving (Eq, Ord, Show, Generic, Enum)
instance Hashable GeoRestrictionType
instance FromText GeoRestrictionType where
parser = takeText >>= \case
"blacklist" -> pure GRTBlacklist
"none" -> pure GRTNone
"whitelist" -> pure GRTWhitelist
e -> fail $
"Failure parsing GeoRestrictionType from " ++ show e
instance ToText GeoRestrictionType where
toText = \case
GRTBlacklist -> "blacklist"
GRTNone -> "none"
GRTWhitelist -> "whitelist"
instance ToByteString GeoRestrictionType
instance ToHeader GeoRestrictionType
instance ToQuery GeoRestrictionType
instance FromXML GeoRestrictionType where
parseXML = parseXMLText "GeoRestrictionType"
instance ToXML GeoRestrictionType where
toXML = toXMLText
data LoggingConfig = LoggingConfig
{ _lcBucket :: Text
, _lcEnabled :: Bool
, _lcIncludeCookies :: Bool
, _lcPrefix :: Text
} deriving (Eq, Ord, Show)
loggingConfig :: Bool
-> Bool
-> Text
-> Text
-> LoggingConfig
loggingConfig p1 p2 p3 p4 = LoggingConfig
{ _lcEnabled = p1
, _lcIncludeCookies = p2
, _lcBucket = p3
, _lcPrefix = p4
}
lcBucket :: Lens' LoggingConfig Text
lcBucket = lens _lcBucket (\s a -> s { _lcBucket = a })
lcEnabled :: Lens' LoggingConfig Bool
lcEnabled = lens _lcEnabled (\s a -> s { _lcEnabled = a })
lcIncludeCookies :: Lens' LoggingConfig Bool
lcIncludeCookies = lens _lcIncludeCookies (\s a -> s { _lcIncludeCookies = a })
lcPrefix :: Lens' LoggingConfig Text
lcPrefix = lens _lcPrefix (\s a -> s { _lcPrefix = a })
instance FromXML LoggingConfig where
parseXML x = LoggingConfig
<$> x .@ "Bucket"
<*> x .@ "Enabled"
<*> x .@ "IncludeCookies"
<*> x .@ "Prefix"
instance ToXML LoggingConfig where
toXML LoggingConfig{..} = nodes "LoggingConfig"
[ "Enabled" =@ _lcEnabled
, "IncludeCookies" =@ _lcIncludeCookies
, "Bucket" =@ _lcBucket
, "Prefix" =@ _lcPrefix
]