{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $sel:ifMatch:DeleteCachePolicy' :: Maybe Text
ifMatch = forall a. Maybe a
Prelude.Nothing,
$sel:id:DeleteCachePolicy' :: Text
id = Text
pId_
}
deleteCachePolicy_ifMatch :: Lens.Lens' DeleteCachePolicy (Prelude.Maybe Prelude.Text)
deleteCachePolicy_ifMatch :: Lens' DeleteCachePolicy (Maybe Text)
deleteCachePolicy_ifMatch = 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 :: Lens' DeleteCachePolicy Text
deleteCachePolicy_id = 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 :: (Service -> Service)
-> DeleteCachePolicy -> Request DeleteCachePolicy
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteCachePolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteCachePolicy)))
response =
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull DeleteCachePolicyResponse
DeleteCachePolicyResponse'
instance Prelude.Hashable DeleteCachePolicy where
hashWithSalt :: Int -> DeleteCachePolicy -> Int
hashWithSalt Int
_salt DeleteCachePolicy' {Maybe Text
Text
id :: Text
ifMatch :: Maybe Text
$sel:id:DeleteCachePolicy' :: DeleteCachePolicy -> Text
$sel:ifMatch:DeleteCachePolicy' :: DeleteCachePolicy -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ifMatch
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
instance Prelude.NFData DeleteCachePolicy where
rnf :: DeleteCachePolicy -> ()
rnf DeleteCachePolicy' {Maybe Text
Text
id :: Text
ifMatch :: Maybe Text
$sel:id:DeleteCachePolicy' :: DeleteCachePolicy -> Text
$sel:ifMatch:DeleteCachePolicy' :: DeleteCachePolicy -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ifMatch seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
id
instance Data.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
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat [HeaderName
"If-Match" forall a. ToHeader a => HeaderName -> a -> [Header]
Data.=# Maybe Text
ifMatch]
instance Data.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
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/2020-05-31/cache-policy/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
id]
instance Data.ToQuery DeleteCachePolicy where
toQuery :: DeleteCachePolicy -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DeleteCachePolicyResponse = DeleteCachePolicyResponse'
{
}
deriving (DeleteCachePolicyResponse -> DeleteCachePolicyResponse -> Bool
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]
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
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.
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 where
rnf :: DeleteCachePolicyResponse -> ()
rnf DeleteCachePolicyResponse
_ = ()