module Network.AWS.CloudFront.GetInvalidation
(
GetInvalidation
, getInvalidation
, giDistributionId
, giId
, GetInvalidationResponse
, getInvalidationResponse
, girInvalidation
) where
import Network.AWS.Prelude
import Network.AWS.Request.RestXML
import Network.AWS.CloudFront.Types
import qualified GHC.Exts
data GetInvalidation = GetInvalidation
{ _giDistributionId :: Text
, _giId :: Text
} deriving (Eq, Ord, Show)
getInvalidation :: Text
-> Text
-> GetInvalidation
getInvalidation p1 p2 = GetInvalidation
{ _giDistributionId = p1
, _giId = p2
}
giDistributionId :: Lens' GetInvalidation Text
giDistributionId = lens _giDistributionId (\s a -> s { _giDistributionId = a })
giId :: Lens' GetInvalidation Text
giId = lens _giId (\s a -> s { _giId = a })
newtype GetInvalidationResponse = GetInvalidationResponse
{ _girInvalidation :: Maybe Invalidation
} deriving (Eq, Show)
getInvalidationResponse :: GetInvalidationResponse
getInvalidationResponse = GetInvalidationResponse
{ _girInvalidation = Nothing
}
girInvalidation :: Lens' GetInvalidationResponse (Maybe Invalidation)
girInvalidation = lens _girInvalidation (\s a -> s { _girInvalidation = a })
instance ToPath GetInvalidation where
toPath GetInvalidation{..} = mconcat
[ "/2014-10-21/distribution/"
, toText _giDistributionId
, "/invalidation/"
, toText _giId
]
instance ToQuery GetInvalidation where
toQuery = const mempty
instance ToHeaders GetInvalidation
instance ToXMLRoot GetInvalidation where
toXMLRoot = const (namespaced ns "GetInvalidation" [])
instance ToXML GetInvalidation
instance AWSRequest GetInvalidation where
type Sv GetInvalidation = CloudFront
type Rs GetInvalidation = GetInvalidationResponse
request = get
response = xmlResponse
instance FromXML GetInvalidationResponse where
parseXML x = GetInvalidationResponse
<$> x .@? "Invalidation"