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