{-# 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.DeleteDistribution
(
DeleteDistribution (..),
newDeleteDistribution,
deleteDistribution_ifMatch,
deleteDistribution_id,
DeleteDistributionResponse (..),
newDeleteDistributionResponse,
)
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 DeleteDistribution = DeleteDistribution'
{
DeleteDistribution -> Maybe Text
ifMatch :: Prelude.Maybe Prelude.Text,
DeleteDistribution -> Text
id :: Prelude.Text
}
deriving (DeleteDistribution -> DeleteDistribution -> Bool
(DeleteDistribution -> DeleteDistribution -> Bool)
-> (DeleteDistribution -> DeleteDistribution -> Bool)
-> Eq DeleteDistribution
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDistribution -> DeleteDistribution -> Bool
$c/= :: DeleteDistribution -> DeleteDistribution -> Bool
== :: DeleteDistribution -> DeleteDistribution -> Bool
$c== :: DeleteDistribution -> DeleteDistribution -> Bool
Prelude.Eq, ReadPrec [DeleteDistribution]
ReadPrec DeleteDistribution
Int -> ReadS DeleteDistribution
ReadS [DeleteDistribution]
(Int -> ReadS DeleteDistribution)
-> ReadS [DeleteDistribution]
-> ReadPrec DeleteDistribution
-> ReadPrec [DeleteDistribution]
-> Read DeleteDistribution
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDistribution]
$creadListPrec :: ReadPrec [DeleteDistribution]
readPrec :: ReadPrec DeleteDistribution
$creadPrec :: ReadPrec DeleteDistribution
readList :: ReadS [DeleteDistribution]
$creadList :: ReadS [DeleteDistribution]
readsPrec :: Int -> ReadS DeleteDistribution
$creadsPrec :: Int -> ReadS DeleteDistribution
Prelude.Read, Int -> DeleteDistribution -> ShowS
[DeleteDistribution] -> ShowS
DeleteDistribution -> String
(Int -> DeleteDistribution -> ShowS)
-> (DeleteDistribution -> String)
-> ([DeleteDistribution] -> ShowS)
-> Show DeleteDistribution
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDistribution] -> ShowS
$cshowList :: [DeleteDistribution] -> ShowS
show :: DeleteDistribution -> String
$cshow :: DeleteDistribution -> String
showsPrec :: Int -> DeleteDistribution -> ShowS
$cshowsPrec :: Int -> DeleteDistribution -> ShowS
Prelude.Show, (forall x. DeleteDistribution -> Rep DeleteDistribution x)
-> (forall x. Rep DeleteDistribution x -> DeleteDistribution)
-> Generic DeleteDistribution
forall x. Rep DeleteDistribution x -> DeleteDistribution
forall x. DeleteDistribution -> Rep DeleteDistribution x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteDistribution x -> DeleteDistribution
$cfrom :: forall x. DeleteDistribution -> Rep DeleteDistribution x
Prelude.Generic)
newDeleteDistribution ::
Prelude.Text ->
DeleteDistribution
newDeleteDistribution :: Text -> DeleteDistribution
newDeleteDistribution Text
pId_ =
DeleteDistribution' :: Maybe Text -> Text -> DeleteDistribution
DeleteDistribution'
{ $sel:ifMatch:DeleteDistribution' :: Maybe Text
ifMatch = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:id:DeleteDistribution' :: Text
id = Text
pId_
}
deleteDistribution_ifMatch :: Lens.Lens' DeleteDistribution (Prelude.Maybe Prelude.Text)
deleteDistribution_ifMatch :: (Maybe Text -> f (Maybe Text))
-> DeleteDistribution -> f DeleteDistribution
deleteDistribution_ifMatch = (DeleteDistribution -> Maybe Text)
-> (DeleteDistribution -> Maybe Text -> DeleteDistribution)
-> Lens
DeleteDistribution DeleteDistribution (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDistribution' {Maybe Text
ifMatch :: Maybe Text
$sel:ifMatch:DeleteDistribution' :: DeleteDistribution -> Maybe Text
ifMatch} -> Maybe Text
ifMatch) (\s :: DeleteDistribution
s@DeleteDistribution' {} Maybe Text
a -> DeleteDistribution
s {$sel:ifMatch:DeleteDistribution' :: Maybe Text
ifMatch = Maybe Text
a} :: DeleteDistribution)
deleteDistribution_id :: Lens.Lens' DeleteDistribution Prelude.Text
deleteDistribution_id :: (Text -> f Text) -> DeleteDistribution -> f DeleteDistribution
deleteDistribution_id = (DeleteDistribution -> Text)
-> (DeleteDistribution -> Text -> DeleteDistribution)
-> Lens DeleteDistribution DeleteDistribution Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteDistribution' {Text
id :: Text
$sel:id:DeleteDistribution' :: DeleteDistribution -> Text
id} -> Text
id) (\s :: DeleteDistribution
s@DeleteDistribution' {} Text
a -> DeleteDistribution
s {$sel:id:DeleteDistribution' :: Text
id = Text
a} :: DeleteDistribution)
instance Core.AWSRequest DeleteDistribution where
type
AWSResponse DeleteDistribution =
DeleteDistributionResponse
request :: DeleteDistribution -> Request DeleteDistribution
request = Service -> DeleteDistribution -> Request DeleteDistribution
forall a. ToRequest a => Service -> a -> Request a
Request.delete Service
defaultService
response :: Logger
-> Service
-> Proxy DeleteDistribution
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteDistribution)))
response =
AWSResponse DeleteDistribution
-> Logger
-> Service
-> Proxy DeleteDistribution
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteDistribution)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull AWSResponse DeleteDistribution
DeleteDistributionResponse
DeleteDistributionResponse'
instance Prelude.Hashable DeleteDistribution
instance Prelude.NFData DeleteDistribution
instance Core.ToHeaders DeleteDistribution where
toHeaders :: DeleteDistribution -> [Header]
toHeaders DeleteDistribution' {Maybe Text
Text
id :: Text
ifMatch :: Maybe Text
$sel:id:DeleteDistribution' :: DeleteDistribution -> Text
$sel:ifMatch:DeleteDistribution' :: DeleteDistribution -> 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 DeleteDistribution where
toPath :: DeleteDistribution -> ByteString
toPath DeleteDistribution' {Maybe Text
Text
id :: Text
ifMatch :: Maybe Text
$sel:id:DeleteDistribution' :: DeleteDistribution -> Text
$sel:ifMatch:DeleteDistribution' :: DeleteDistribution -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/2020-05-31/distribution/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
id]
instance Core.ToQuery DeleteDistribution where
toQuery :: DeleteDistribution -> QueryString
toQuery = QueryString -> DeleteDistribution -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data DeleteDistributionResponse = DeleteDistributionResponse'
{
}
deriving (DeleteDistributionResponse -> DeleteDistributionResponse -> Bool
(DeleteDistributionResponse -> DeleteDistributionResponse -> Bool)
-> (DeleteDistributionResponse
-> DeleteDistributionResponse -> Bool)
-> Eq DeleteDistributionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteDistributionResponse -> DeleteDistributionResponse -> Bool
$c/= :: DeleteDistributionResponse -> DeleteDistributionResponse -> Bool
== :: DeleteDistributionResponse -> DeleteDistributionResponse -> Bool
$c== :: DeleteDistributionResponse -> DeleteDistributionResponse -> Bool
Prelude.Eq, ReadPrec [DeleteDistributionResponse]
ReadPrec DeleteDistributionResponse
Int -> ReadS DeleteDistributionResponse
ReadS [DeleteDistributionResponse]
(Int -> ReadS DeleteDistributionResponse)
-> ReadS [DeleteDistributionResponse]
-> ReadPrec DeleteDistributionResponse
-> ReadPrec [DeleteDistributionResponse]
-> Read DeleteDistributionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteDistributionResponse]
$creadListPrec :: ReadPrec [DeleteDistributionResponse]
readPrec :: ReadPrec DeleteDistributionResponse
$creadPrec :: ReadPrec DeleteDistributionResponse
readList :: ReadS [DeleteDistributionResponse]
$creadList :: ReadS [DeleteDistributionResponse]
readsPrec :: Int -> ReadS DeleteDistributionResponse
$creadsPrec :: Int -> ReadS DeleteDistributionResponse
Prelude.Read, Int -> DeleteDistributionResponse -> ShowS
[DeleteDistributionResponse] -> ShowS
DeleteDistributionResponse -> String
(Int -> DeleteDistributionResponse -> ShowS)
-> (DeleteDistributionResponse -> String)
-> ([DeleteDistributionResponse] -> ShowS)
-> Show DeleteDistributionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteDistributionResponse] -> ShowS
$cshowList :: [DeleteDistributionResponse] -> ShowS
show :: DeleteDistributionResponse -> String
$cshow :: DeleteDistributionResponse -> String
showsPrec :: Int -> DeleteDistributionResponse -> ShowS
$cshowsPrec :: Int -> DeleteDistributionResponse -> ShowS
Prelude.Show, (forall x.
DeleteDistributionResponse -> Rep DeleteDistributionResponse x)
-> (forall x.
Rep DeleteDistributionResponse x -> DeleteDistributionResponse)
-> Generic DeleteDistributionResponse
forall x.
Rep DeleteDistributionResponse x -> DeleteDistributionResponse
forall x.
DeleteDistributionResponse -> Rep DeleteDistributionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteDistributionResponse x -> DeleteDistributionResponse
$cfrom :: forall x.
DeleteDistributionResponse -> Rep DeleteDistributionResponse x
Prelude.Generic)
newDeleteDistributionResponse ::
DeleteDistributionResponse
newDeleteDistributionResponse :: DeleteDistributionResponse
newDeleteDistributionResponse =
DeleteDistributionResponse
DeleteDistributionResponse'
instance Prelude.NFData DeleteDistributionResponse