module Network.AWS.CloudFront.CreateCloudFrontOriginAccessIdentity
(
CreateCloudFrontOriginAccessIdentity
, createCloudFrontOriginAccessIdentity
, ccfoaiCloudFrontOriginAccessIdentityConfig
, CreateCloudFrontOriginAccessIdentityResponse
, createCloudFrontOriginAccessIdentityResponse
, ccfoairCloudFrontOriginAccessIdentity
, ccfoairETag
, ccfoairLocation
) where
import Network.AWS.Prelude
import Network.AWS.Request.RestXML
import Network.AWS.CloudFront.Types
import qualified GHC.Exts
newtype CreateCloudFrontOriginAccessIdentity = CreateCloudFrontOriginAccessIdentity
{ _ccfoaiCloudFrontOriginAccessIdentityConfig :: CloudFrontOriginAccessIdentityConfig
} deriving (Eq, Read, Show)
createCloudFrontOriginAccessIdentity :: CloudFrontOriginAccessIdentityConfig
-> CreateCloudFrontOriginAccessIdentity
createCloudFrontOriginAccessIdentity p1 = CreateCloudFrontOriginAccessIdentity
{ _ccfoaiCloudFrontOriginAccessIdentityConfig = p1
}
ccfoaiCloudFrontOriginAccessIdentityConfig :: Lens' CreateCloudFrontOriginAccessIdentity CloudFrontOriginAccessIdentityConfig
ccfoaiCloudFrontOriginAccessIdentityConfig =
lens _ccfoaiCloudFrontOriginAccessIdentityConfig
(\s a -> s { _ccfoaiCloudFrontOriginAccessIdentityConfig = a })
data CreateCloudFrontOriginAccessIdentityResponse = CreateCloudFrontOriginAccessIdentityResponse
{ _ccfoairCloudFrontOriginAccessIdentity :: Maybe CloudFrontOriginAccessIdentity
, _ccfoairETag :: Maybe Text
, _ccfoairLocation :: Maybe Text
} deriving (Eq, Read, Show)
createCloudFrontOriginAccessIdentityResponse :: CreateCloudFrontOriginAccessIdentityResponse
createCloudFrontOriginAccessIdentityResponse = CreateCloudFrontOriginAccessIdentityResponse
{ _ccfoairCloudFrontOriginAccessIdentity = Nothing
, _ccfoairLocation = Nothing
, _ccfoairETag = Nothing
}
ccfoairCloudFrontOriginAccessIdentity :: Lens' CreateCloudFrontOriginAccessIdentityResponse (Maybe CloudFrontOriginAccessIdentity)
ccfoairCloudFrontOriginAccessIdentity =
lens _ccfoairCloudFrontOriginAccessIdentity
(\s a -> s { _ccfoairCloudFrontOriginAccessIdentity = a })
ccfoairETag :: Lens' CreateCloudFrontOriginAccessIdentityResponse (Maybe Text)
ccfoairETag = lens _ccfoairETag (\s a -> s { _ccfoairETag = a })
ccfoairLocation :: Lens' CreateCloudFrontOriginAccessIdentityResponse (Maybe Text)
ccfoairLocation = lens _ccfoairLocation (\s a -> s { _ccfoairLocation = a })
instance ToPath CreateCloudFrontOriginAccessIdentity where
toPath = const "/2014-11-06/origin-access-identity/cloudfront"
instance ToQuery CreateCloudFrontOriginAccessIdentity where
toQuery = const mempty
instance ToHeaders CreateCloudFrontOriginAccessIdentity
instance ToXMLRoot CreateCloudFrontOriginAccessIdentity where
toXMLRoot CreateCloudFrontOriginAccessIdentity{..} = namespaced ns "CreateCloudFrontOriginAccessIdentity"
[ "CloudFrontOriginAccessIdentityConfig" =@ _ccfoaiCloudFrontOriginAccessIdentityConfig
]
instance ToXML CreateCloudFrontOriginAccessIdentity
instance AWSRequest CreateCloudFrontOriginAccessIdentity where
type Sv CreateCloudFrontOriginAccessIdentity = CloudFront
type Rs CreateCloudFrontOriginAccessIdentity = CreateCloudFrontOriginAccessIdentityResponse
request = post
response = xmlHeaderResponse $ \h x -> CreateCloudFrontOriginAccessIdentityResponse
<$> x .@? "CloudFrontOriginAccessIdentity"
<*> h ~:? "ETag"
<*> h ~:? "Location"