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