{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.CloudFront.DeleteCachePolicy
(
DeleteCachePolicy (..),
newDeleteCachePolicy,
deleteCachePolicy_ifMatch,
deleteCachePolicy_id,
DeleteCachePolicyResponse (..),
newDeleteCachePolicyResponse,
)
where
import Amazonka.CloudFront.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteCachePolicy = DeleteCachePolicy'
{
DeleteCachePolicy -> Maybe Text
ifMatch :: Prelude.Maybe Prelude.Text,
DeleteCachePolicy -> Text
id :: Prelude.Text
}
deriving (DeleteCachePolicy -> DeleteCachePolicy -> Bool
(DeleteCachePolicy -> DeleteCachePolicy -> Bool)
-> (DeleteCachePolicy -> DeleteCachePolicy -> Bool)
-> Eq DeleteCachePolicy
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteCachePolicy -> DeleteCachePolicy -> Bool
$c/= :: DeleteCachePolicy -> DeleteCachePolicy -> Bool
== :: DeleteCachePolicy -> DeleteCachePolicy -> Bool
$c== :: DeleteCachePolicy -> DeleteCachePolicy -> Bool
Prelude.Eq, ReadPrec [DeleteCachePolicy]
ReadPrec DeleteCachePolicy
Int -> ReadS DeleteCachePolicy
ReadS [DeleteCachePolicy]
(Int -> ReadS DeleteCachePolicy)
-> ReadS [DeleteCachePolicy]
-> ReadPrec DeleteCachePolicy
-> ReadPrec [DeleteCachePolicy]
-> Read DeleteCachePolicy
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteCachePolicy]
$creadListPrec :: ReadPrec [DeleteCachePolicy]
readPrec :: ReadPrec DeleteCachePolicy
$creadPrec :: ReadPrec DeleteCachePolicy
readList :: ReadS [DeleteCachePolicy]
$creadList :: ReadS [DeleteCachePolicy]
readsPrec :: Int -> ReadS DeleteCachePolicy
$creadsPrec :: Int -> ReadS DeleteCachePolicy
Prelude.Read, Int -> DeleteCachePolicy -> ShowS
[DeleteCachePolicy] -> ShowS
DeleteCachePolicy -> String
(Int -> DeleteCachePolicy -> ShowS)
-> (DeleteCachePolicy -> String)
-> ([DeleteCachePolicy] -> ShowS)
-> Show DeleteCachePolicy
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteCachePolicy] -> ShowS
$cshowList :: [DeleteCachePolicy] -> ShowS
show :: DeleteCachePolicy -> String
$cshow :: DeleteCachePolicy -> String
showsPrec :: Int -> DeleteCachePolicy -> ShowS
$cshowsPrec :: Int -> DeleteCachePolicy -> ShowS
Prelude.Show, (forall x. DeleteCachePolicy -> Rep DeleteCachePolicy x)
-> (forall x. Rep DeleteCachePolicy x -> DeleteCachePolicy)
-> Generic DeleteCachePolicy
forall x. Rep DeleteCachePolicy x -> DeleteCachePolicy
forall x. DeleteCachePolicy -> Rep DeleteCachePolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteCachePolicy x -> DeleteCachePolicy
$cfrom :: forall x. DeleteCachePolicy -> Rep DeleteCachePolicy x
Prelude.Generic)
newDeleteCachePolicy ::
Prelude.Text ->
DeleteCachePolicy
newDeleteCachePolicy :: Text -> DeleteCachePolicy
newDeleteCachePolicy Text
pId_ =
DeleteCachePolicy' :: Maybe Text -> Text -> DeleteCachePolicy
DeleteCachePolicy'
{ $sel:ifMatch:DeleteCachePolicy' :: Maybe Text
ifMatch = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:DeleteCachePolicy' :: Text
id = Text
pId_
}
deleteCachePolicy_ifMatch :: Lens.Lens' DeleteCachePolicy (Prelude.Maybe Prelude.Text)
deleteCachePolicy_ifMatch :: (Maybe Text -> f (Maybe Text))
-> DeleteCachePolicy -> f DeleteCachePolicy
deleteCachePolicy_ifMatch = (DeleteCachePolicy -> Maybe Text)
-> (DeleteCachePolicy -> Maybe Text -> DeleteCachePolicy)
-> Lens
DeleteCachePolicy DeleteCachePolicy (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCachePolicy' {Maybe Text
ifMatch :: Maybe Text
$sel:ifMatch:DeleteCachePolicy' :: DeleteCachePolicy -> Maybe Text
ifMatch} -> Maybe Text
ifMatch) (\s :: DeleteCachePolicy
s@DeleteCachePolicy' {} Maybe Text
a -> DeleteCachePolicy
s {$sel:ifMatch:DeleteCachePolicy' :: Maybe Text
ifMatch = Maybe Text
a} :: DeleteCachePolicy)
deleteCachePolicy_id :: Lens.Lens' DeleteCachePolicy Prelude.Text
deleteCachePolicy_id :: (Text -> f Text) -> DeleteCachePolicy -> f DeleteCachePolicy
deleteCachePolicy_id = (DeleteCachePolicy -> Text)
-> (DeleteCachePolicy -> Text -> DeleteCachePolicy)
-> Lens DeleteCachePolicy DeleteCachePolicy Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCachePolicy' {Text
id :: Text
$sel:id:DeleteCachePolicy' :: DeleteCachePolicy -> Text
id} -> Text
id) (\s :: DeleteCachePolicy
s@DeleteCachePolicy' {} Text
a -> DeleteCachePolicy
s {$sel:id:DeleteCachePolicy' :: Text
id = Text
a} :: DeleteCachePolicy)
instance Core.AWSRequest DeleteCachePolicy where
type
AWSResponse DeleteCachePolicy =
DeleteCachePolicyResponse
request :: DeleteCachePolicy -> Request DeleteCachePolicy
request = Service -> DeleteCachePolicy -> Request DeleteCachePolicy
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteCachePolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteCachePolicy)))
response =
AWSResponse DeleteCachePolicy
-> Logger
-> Service
-> Proxy DeleteCachePolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteCachePolicy)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteCachePolicy
DeleteCachePolicyResponse
DeleteCachePolicyResponse'
instance Prelude.Hashable DeleteCachePolicy
instance Prelude.NFData DeleteCachePolicy
instance Core.ToHeaders DeleteCachePolicy where
toHeaders :: DeleteCachePolicy -> [Header]
toHeaders DeleteCachePolicy' {Maybe Text
Text
id :: Text
ifMatch :: Maybe Text
$sel:id:DeleteCachePolicy' :: DeleteCachePolicy -> Text
$sel:ifMatch:DeleteCachePolicy' :: DeleteCachePolicy -> Maybe Text
..} =
[[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat [HeaderName
"If-Match" HeaderName -> Maybe Text -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# Maybe Text
ifMatch]
instance Core.ToPath DeleteCachePolicy where
toPath :: DeleteCachePolicy -> ByteString
toPath DeleteCachePolicy' {Maybe Text
Text
id :: Text
ifMatch :: Maybe Text
$sel:id:DeleteCachePolicy' :: DeleteCachePolicy -> Text
$sel:ifMatch:DeleteCachePolicy' :: DeleteCachePolicy -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/2020-05-31/cache-policy/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
id]
instance Core.ToQuery DeleteCachePolicy where
toQuery :: DeleteCachePolicy -> QueryString
toQuery = QueryString -> DeleteCachePolicy -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteCachePolicyResponse = DeleteCachePolicyResponse'
{
}
deriving (DeleteCachePolicyResponse -> DeleteCachePolicyResponse -> Bool
(DeleteCachePolicyResponse -> DeleteCachePolicyResponse -> Bool)
-> (DeleteCachePolicyResponse -> DeleteCachePolicyResponse -> Bool)
-> Eq DeleteCachePolicyResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteCachePolicyResponse -> DeleteCachePolicyResponse -> Bool
$c/= :: DeleteCachePolicyResponse -> DeleteCachePolicyResponse -> Bool
== :: DeleteCachePolicyResponse -> DeleteCachePolicyResponse -> Bool
$c== :: DeleteCachePolicyResponse -> DeleteCachePolicyResponse -> Bool
Prelude.Eq, ReadPrec [DeleteCachePolicyResponse]
ReadPrec DeleteCachePolicyResponse
Int -> ReadS DeleteCachePolicyResponse
ReadS [DeleteCachePolicyResponse]
(Int -> ReadS DeleteCachePolicyResponse)
-> ReadS [DeleteCachePolicyResponse]
-> ReadPrec DeleteCachePolicyResponse
-> ReadPrec [DeleteCachePolicyResponse]
-> Read DeleteCachePolicyResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteCachePolicyResponse]
$creadListPrec :: ReadPrec [DeleteCachePolicyResponse]
readPrec :: ReadPrec DeleteCachePolicyResponse
$creadPrec :: ReadPrec DeleteCachePolicyResponse
readList :: ReadS [DeleteCachePolicyResponse]
$creadList :: ReadS [DeleteCachePolicyResponse]
readsPrec :: Int -> ReadS DeleteCachePolicyResponse
$creadsPrec :: Int -> ReadS DeleteCachePolicyResponse
Prelude.Read, Int -> DeleteCachePolicyResponse -> ShowS
[DeleteCachePolicyResponse] -> ShowS
DeleteCachePolicyResponse -> String
(Int -> DeleteCachePolicyResponse -> ShowS)
-> (DeleteCachePolicyResponse -> String)
-> ([DeleteCachePolicyResponse] -> ShowS)
-> Show DeleteCachePolicyResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteCachePolicyResponse] -> ShowS
$cshowList :: [DeleteCachePolicyResponse] -> ShowS
show :: DeleteCachePolicyResponse -> String
$cshow :: DeleteCachePolicyResponse -> String
showsPrec :: Int -> DeleteCachePolicyResponse -> ShowS
$cshowsPrec :: Int -> DeleteCachePolicyResponse -> ShowS
Prelude.Show, (forall x.
DeleteCachePolicyResponse -> Rep DeleteCachePolicyResponse x)
-> (forall x.
Rep DeleteCachePolicyResponse x -> DeleteCachePolicyResponse)
-> Generic DeleteCachePolicyResponse
forall x.
Rep DeleteCachePolicyResponse x -> DeleteCachePolicyResponse
forall x.
DeleteCachePolicyResponse -> Rep DeleteCachePolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteCachePolicyResponse x -> DeleteCachePolicyResponse
$cfrom :: forall x.
DeleteCachePolicyResponse -> Rep DeleteCachePolicyResponse x
Prelude.Generic)
newDeleteCachePolicyResponse ::
DeleteCachePolicyResponse
newDeleteCachePolicyResponse :: DeleteCachePolicyResponse
newDeleteCachePolicyResponse =
DeleteCachePolicyResponse
DeleteCachePolicyResponse'
instance Prelude.NFData DeleteCachePolicyResponse