module Network.AWS.CloudFront.GetCloudFrontOriginAccessIdentity
(
GetCloudFrontOriginAccessIdentity
, getCloudFrontOriginAccessIdentity
, gcfoaiId
, GetCloudFrontOriginAccessIdentityResponse
, getCloudFrontOriginAccessIdentityResponse
, gcfoairCloudFrontOriginAccessIdentity
, gcfoairETag
) where
import Network.AWS.Prelude
import Network.AWS.Request.RestXML
import Network.AWS.CloudFront.Types
import qualified GHC.Exts
newtype GetCloudFrontOriginAccessIdentity = GetCloudFrontOriginAccessIdentity
{ _gcfoaiId :: Text
} deriving (Eq, Ord, Show, Monoid, IsString)
getCloudFrontOriginAccessIdentity :: Text
-> GetCloudFrontOriginAccessIdentity
getCloudFrontOriginAccessIdentity p1 = GetCloudFrontOriginAccessIdentity
{ _gcfoaiId = p1
}
gcfoaiId :: Lens' GetCloudFrontOriginAccessIdentity Text
gcfoaiId = lens _gcfoaiId (\s a -> s { _gcfoaiId = a })
data GetCloudFrontOriginAccessIdentityResponse = GetCloudFrontOriginAccessIdentityResponse
{ _gcfoairCloudFrontOriginAccessIdentity :: Maybe CloudFrontOriginAccessIdentity
, _gcfoairETag :: Maybe Text
} deriving (Eq, Show)
getCloudFrontOriginAccessIdentityResponse :: GetCloudFrontOriginAccessIdentityResponse
getCloudFrontOriginAccessIdentityResponse = GetCloudFrontOriginAccessIdentityResponse
{ _gcfoairCloudFrontOriginAccessIdentity = Nothing
, _gcfoairETag = Nothing
}
gcfoairCloudFrontOriginAccessIdentity :: Lens' GetCloudFrontOriginAccessIdentityResponse (Maybe CloudFrontOriginAccessIdentity)
gcfoairCloudFrontOriginAccessIdentity =
lens _gcfoairCloudFrontOriginAccessIdentity
(\s a -> s { _gcfoairCloudFrontOriginAccessIdentity = a })
gcfoairETag :: Lens' GetCloudFrontOriginAccessIdentityResponse (Maybe Text)
gcfoairETag = lens _gcfoairETag (\s a -> s { _gcfoairETag = a })
instance ToPath GetCloudFrontOriginAccessIdentity where
toPath GetCloudFrontOriginAccessIdentity{..} = mconcat
[ "/2014-05-31/origin-access-identity/cloudfront/"
, toText _gcfoaiId
]
instance ToQuery GetCloudFrontOriginAccessIdentity where
toQuery = const mempty
instance ToHeaders GetCloudFrontOriginAccessIdentity
instance ToXMLRoot GetCloudFrontOriginAccessIdentity where
toXMLRoot = const (namespaced ns "GetCloudFrontOriginAccessIdentity" [])
instance ToXML GetCloudFrontOriginAccessIdentity
instance AWSRequest GetCloudFrontOriginAccessIdentity where
type Sv GetCloudFrontOriginAccessIdentity = CloudFront
type Rs GetCloudFrontOriginAccessIdentity = GetCloudFrontOriginAccessIdentityResponse
request = get
response = xmlHeaderResponse $ \h x -> GetCloudFrontOriginAccessIdentityResponse
<$> x .@? "CloudFrontOriginAccessIdentity"
<*> h ~:? "ETag"