{-# 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.GetOriginRequestPolicyConfig
(
GetOriginRequestPolicyConfig (..),
newGetOriginRequestPolicyConfig,
getOriginRequestPolicyConfig_id,
GetOriginRequestPolicyConfigResponse (..),
newGetOriginRequestPolicyConfigResponse,
getOriginRequestPolicyConfigResponse_eTag,
getOriginRequestPolicyConfigResponse_originRequestPolicyConfig,
getOriginRequestPolicyConfigResponse_httpStatus,
)
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 GetOriginRequestPolicyConfig = GetOriginRequestPolicyConfig'
{
GetOriginRequestPolicyConfig -> Text
id :: Prelude.Text
}
deriving (GetOriginRequestPolicyConfig
-> GetOriginRequestPolicyConfig -> Bool
(GetOriginRequestPolicyConfig
-> GetOriginRequestPolicyConfig -> Bool)
-> (GetOriginRequestPolicyConfig
-> GetOriginRequestPolicyConfig -> Bool)
-> Eq GetOriginRequestPolicyConfig
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetOriginRequestPolicyConfig
-> GetOriginRequestPolicyConfig -> Bool
$c/= :: GetOriginRequestPolicyConfig
-> GetOriginRequestPolicyConfig -> Bool
== :: GetOriginRequestPolicyConfig
-> GetOriginRequestPolicyConfig -> Bool
$c== :: GetOriginRequestPolicyConfig
-> GetOriginRequestPolicyConfig -> Bool
Prelude.Eq, ReadPrec [GetOriginRequestPolicyConfig]
ReadPrec GetOriginRequestPolicyConfig
Int -> ReadS GetOriginRequestPolicyConfig
ReadS [GetOriginRequestPolicyConfig]
(Int -> ReadS GetOriginRequestPolicyConfig)
-> ReadS [GetOriginRequestPolicyConfig]
-> ReadPrec GetOriginRequestPolicyConfig
-> ReadPrec [GetOriginRequestPolicyConfig]
-> Read GetOriginRequestPolicyConfig
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetOriginRequestPolicyConfig]
$creadListPrec :: ReadPrec [GetOriginRequestPolicyConfig]
readPrec :: ReadPrec GetOriginRequestPolicyConfig
$creadPrec :: ReadPrec GetOriginRequestPolicyConfig
readList :: ReadS [GetOriginRequestPolicyConfig]
$creadList :: ReadS [GetOriginRequestPolicyConfig]
readsPrec :: Int -> ReadS GetOriginRequestPolicyConfig
$creadsPrec :: Int -> ReadS GetOriginRequestPolicyConfig
Prelude.Read, Int -> GetOriginRequestPolicyConfig -> ShowS
[GetOriginRequestPolicyConfig] -> ShowS
GetOriginRequestPolicyConfig -> String
(Int -> GetOriginRequestPolicyConfig -> ShowS)
-> (GetOriginRequestPolicyConfig -> String)
-> ([GetOriginRequestPolicyConfig] -> ShowS)
-> Show GetOriginRequestPolicyConfig
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetOriginRequestPolicyConfig] -> ShowS
$cshowList :: [GetOriginRequestPolicyConfig] -> ShowS
show :: GetOriginRequestPolicyConfig -> String
$cshow :: GetOriginRequestPolicyConfig -> String
showsPrec :: Int -> GetOriginRequestPolicyConfig -> ShowS
$cshowsPrec :: Int -> GetOriginRequestPolicyConfig -> ShowS
Prelude.Show, (forall x.
GetOriginRequestPolicyConfig -> Rep GetOriginRequestPolicyConfig x)
-> (forall x.
Rep GetOriginRequestPolicyConfig x -> GetOriginRequestPolicyConfig)
-> Generic GetOriginRequestPolicyConfig
forall x.
Rep GetOriginRequestPolicyConfig x -> GetOriginRequestPolicyConfig
forall x.
GetOriginRequestPolicyConfig -> Rep GetOriginRequestPolicyConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetOriginRequestPolicyConfig x -> GetOriginRequestPolicyConfig
$cfrom :: forall x.
GetOriginRequestPolicyConfig -> Rep GetOriginRequestPolicyConfig x
Prelude.Generic)
newGetOriginRequestPolicyConfig ::
Prelude.Text ->
GetOriginRequestPolicyConfig
newGetOriginRequestPolicyConfig :: Text -> GetOriginRequestPolicyConfig
newGetOriginRequestPolicyConfig Text
pId_ =
GetOriginRequestPolicyConfig' :: Text -> GetOriginRequestPolicyConfig
GetOriginRequestPolicyConfig' {$sel:id:GetOriginRequestPolicyConfig' :: Text
id = Text
pId_}
getOriginRequestPolicyConfig_id :: Lens.Lens' GetOriginRequestPolicyConfig Prelude.Text
getOriginRequestPolicyConfig_id :: (Text -> f Text)
-> GetOriginRequestPolicyConfig -> f GetOriginRequestPolicyConfig
getOriginRequestPolicyConfig_id = (GetOriginRequestPolicyConfig -> Text)
-> (GetOriginRequestPolicyConfig
-> Text -> GetOriginRequestPolicyConfig)
-> Lens
GetOriginRequestPolicyConfig GetOriginRequestPolicyConfig Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetOriginRequestPolicyConfig' {Text
id :: Text
$sel:id:GetOriginRequestPolicyConfig' :: GetOriginRequestPolicyConfig -> Text
id} -> Text
id) (\s :: GetOriginRequestPolicyConfig
s@GetOriginRequestPolicyConfig' {} Text
a -> GetOriginRequestPolicyConfig
s {$sel:id:GetOriginRequestPolicyConfig' :: Text
id = Text
a} :: GetOriginRequestPolicyConfig)
instance Core.AWSRequest GetOriginRequestPolicyConfig where
type
AWSResponse GetOriginRequestPolicyConfig =
GetOriginRequestPolicyConfigResponse
request :: GetOriginRequestPolicyConfig
-> Request GetOriginRequestPolicyConfig
request = Service
-> GetOriginRequestPolicyConfig
-> Request GetOriginRequestPolicyConfig
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy GetOriginRequestPolicyConfig
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetOriginRequestPolicyConfig)))
response =
(Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse GetOriginRequestPolicyConfig))
-> Logger
-> Service
-> Proxy GetOriginRequestPolicyConfig
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetOriginRequestPolicyConfig)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Text
-> Maybe OriginRequestPolicyConfig
-> Int
-> GetOriginRequestPolicyConfigResponse
GetOriginRequestPolicyConfigResponse'
(Maybe Text
-> Maybe OriginRequestPolicyConfig
-> Int
-> GetOriginRequestPolicyConfigResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe OriginRequestPolicyConfig
-> Int -> GetOriginRequestPolicyConfigResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (ResponseHeaders
h ResponseHeaders -> HeaderName -> Either String (Maybe Text)
forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Core..#? HeaderName
"ETag")
Either
String
(Maybe OriginRequestPolicyConfig
-> Int -> GetOriginRequestPolicyConfigResponse)
-> Either String (Maybe OriginRequestPolicyConfig)
-> Either String (Int -> GetOriginRequestPolicyConfigResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node] -> Either String (Maybe OriginRequestPolicyConfig)
forall a. FromXML a => [Node] -> Either String a
Core.parseXML [Node]
x)
Either String (Int -> GetOriginRequestPolicyConfigResponse)
-> Either String Int
-> Either String GetOriginRequestPolicyConfigResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance
Prelude.Hashable
GetOriginRequestPolicyConfig
instance Prelude.NFData GetOriginRequestPolicyConfig
instance Core.ToHeaders GetOriginRequestPolicyConfig where
toHeaders :: GetOriginRequestPolicyConfig -> ResponseHeaders
toHeaders = ResponseHeaders -> GetOriginRequestPolicyConfig -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath GetOriginRequestPolicyConfig where
toPath :: GetOriginRequestPolicyConfig -> ByteString
toPath GetOriginRequestPolicyConfig' {Text
id :: Text
$sel:id:GetOriginRequestPolicyConfig' :: GetOriginRequestPolicyConfig -> 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,
ByteString
"/config"
]
instance Core.ToQuery GetOriginRequestPolicyConfig where
toQuery :: GetOriginRequestPolicyConfig -> QueryString
toQuery = QueryString -> GetOriginRequestPolicyConfig -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data GetOriginRequestPolicyConfigResponse = GetOriginRequestPolicyConfigResponse'
{
GetOriginRequestPolicyConfigResponse -> Maybe Text
eTag :: Prelude.Maybe Prelude.Text,
GetOriginRequestPolicyConfigResponse
-> Maybe OriginRequestPolicyConfig
originRequestPolicyConfig :: Prelude.Maybe OriginRequestPolicyConfig,
GetOriginRequestPolicyConfigResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetOriginRequestPolicyConfigResponse
-> GetOriginRequestPolicyConfigResponse -> Bool
(GetOriginRequestPolicyConfigResponse
-> GetOriginRequestPolicyConfigResponse -> Bool)
-> (GetOriginRequestPolicyConfigResponse
-> GetOriginRequestPolicyConfigResponse -> Bool)
-> Eq GetOriginRequestPolicyConfigResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetOriginRequestPolicyConfigResponse
-> GetOriginRequestPolicyConfigResponse -> Bool
$c/= :: GetOriginRequestPolicyConfigResponse
-> GetOriginRequestPolicyConfigResponse -> Bool
== :: GetOriginRequestPolicyConfigResponse
-> GetOriginRequestPolicyConfigResponse -> Bool
$c== :: GetOriginRequestPolicyConfigResponse
-> GetOriginRequestPolicyConfigResponse -> Bool
Prelude.Eq, ReadPrec [GetOriginRequestPolicyConfigResponse]
ReadPrec GetOriginRequestPolicyConfigResponse
Int -> ReadS GetOriginRequestPolicyConfigResponse
ReadS [GetOriginRequestPolicyConfigResponse]
(Int -> ReadS GetOriginRequestPolicyConfigResponse)
-> ReadS [GetOriginRequestPolicyConfigResponse]
-> ReadPrec GetOriginRequestPolicyConfigResponse
-> ReadPrec [GetOriginRequestPolicyConfigResponse]
-> Read GetOriginRequestPolicyConfigResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetOriginRequestPolicyConfigResponse]
$creadListPrec :: ReadPrec [GetOriginRequestPolicyConfigResponse]
readPrec :: ReadPrec GetOriginRequestPolicyConfigResponse
$creadPrec :: ReadPrec GetOriginRequestPolicyConfigResponse
readList :: ReadS [GetOriginRequestPolicyConfigResponse]
$creadList :: ReadS [GetOriginRequestPolicyConfigResponse]
readsPrec :: Int -> ReadS GetOriginRequestPolicyConfigResponse
$creadsPrec :: Int -> ReadS GetOriginRequestPolicyConfigResponse
Prelude.Read, Int -> GetOriginRequestPolicyConfigResponse -> ShowS
[GetOriginRequestPolicyConfigResponse] -> ShowS
GetOriginRequestPolicyConfigResponse -> String
(Int -> GetOriginRequestPolicyConfigResponse -> ShowS)
-> (GetOriginRequestPolicyConfigResponse -> String)
-> ([GetOriginRequestPolicyConfigResponse] -> ShowS)
-> Show GetOriginRequestPolicyConfigResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetOriginRequestPolicyConfigResponse] -> ShowS
$cshowList :: [GetOriginRequestPolicyConfigResponse] -> ShowS
show :: GetOriginRequestPolicyConfigResponse -> String
$cshow :: GetOriginRequestPolicyConfigResponse -> String
showsPrec :: Int -> GetOriginRequestPolicyConfigResponse -> ShowS
$cshowsPrec :: Int -> GetOriginRequestPolicyConfigResponse -> ShowS
Prelude.Show, (forall x.
GetOriginRequestPolicyConfigResponse
-> Rep GetOriginRequestPolicyConfigResponse x)
-> (forall x.
Rep GetOriginRequestPolicyConfigResponse x
-> GetOriginRequestPolicyConfigResponse)
-> Generic GetOriginRequestPolicyConfigResponse
forall x.
Rep GetOriginRequestPolicyConfigResponse x
-> GetOriginRequestPolicyConfigResponse
forall x.
GetOriginRequestPolicyConfigResponse
-> Rep GetOriginRequestPolicyConfigResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetOriginRequestPolicyConfigResponse x
-> GetOriginRequestPolicyConfigResponse
$cfrom :: forall x.
GetOriginRequestPolicyConfigResponse
-> Rep GetOriginRequestPolicyConfigResponse x
Prelude.Generic)
newGetOriginRequestPolicyConfigResponse ::
Prelude.Int ->
GetOriginRequestPolicyConfigResponse
newGetOriginRequestPolicyConfigResponse :: Int -> GetOriginRequestPolicyConfigResponse
newGetOriginRequestPolicyConfigResponse Int
pHttpStatus_ =
GetOriginRequestPolicyConfigResponse' :: Maybe Text
-> Maybe OriginRequestPolicyConfig
-> Int
-> GetOriginRequestPolicyConfigResponse
GetOriginRequestPolicyConfigResponse'
{ $sel:eTag:GetOriginRequestPolicyConfigResponse' :: Maybe Text
eTag =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:originRequestPolicyConfig:GetOriginRequestPolicyConfigResponse' :: Maybe OriginRequestPolicyConfig
originRequestPolicyConfig =
Maybe OriginRequestPolicyConfig
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetOriginRequestPolicyConfigResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getOriginRequestPolicyConfigResponse_eTag :: Lens.Lens' GetOriginRequestPolicyConfigResponse (Prelude.Maybe Prelude.Text)
getOriginRequestPolicyConfigResponse_eTag :: (Maybe Text -> f (Maybe Text))
-> GetOriginRequestPolicyConfigResponse
-> f GetOriginRequestPolicyConfigResponse
getOriginRequestPolicyConfigResponse_eTag = (GetOriginRequestPolicyConfigResponse -> Maybe Text)
-> (GetOriginRequestPolicyConfigResponse
-> Maybe Text -> GetOriginRequestPolicyConfigResponse)
-> Lens
GetOriginRequestPolicyConfigResponse
GetOriginRequestPolicyConfigResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetOriginRequestPolicyConfigResponse' {Maybe Text
eTag :: Maybe Text
$sel:eTag:GetOriginRequestPolicyConfigResponse' :: GetOriginRequestPolicyConfigResponse -> Maybe Text
eTag} -> Maybe Text
eTag) (\s :: GetOriginRequestPolicyConfigResponse
s@GetOriginRequestPolicyConfigResponse' {} Maybe Text
a -> GetOriginRequestPolicyConfigResponse
s {$sel:eTag:GetOriginRequestPolicyConfigResponse' :: Maybe Text
eTag = Maybe Text
a} :: GetOriginRequestPolicyConfigResponse)
getOriginRequestPolicyConfigResponse_originRequestPolicyConfig :: Lens.Lens' GetOriginRequestPolicyConfigResponse (Prelude.Maybe OriginRequestPolicyConfig)
getOriginRequestPolicyConfigResponse_originRequestPolicyConfig :: (Maybe OriginRequestPolicyConfig
-> f (Maybe OriginRequestPolicyConfig))
-> GetOriginRequestPolicyConfigResponse
-> f GetOriginRequestPolicyConfigResponse
getOriginRequestPolicyConfigResponse_originRequestPolicyConfig = (GetOriginRequestPolicyConfigResponse
-> Maybe OriginRequestPolicyConfig)
-> (GetOriginRequestPolicyConfigResponse
-> Maybe OriginRequestPolicyConfig
-> GetOriginRequestPolicyConfigResponse)
-> Lens
GetOriginRequestPolicyConfigResponse
GetOriginRequestPolicyConfigResponse
(Maybe OriginRequestPolicyConfig)
(Maybe OriginRequestPolicyConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetOriginRequestPolicyConfigResponse' {Maybe OriginRequestPolicyConfig
originRequestPolicyConfig :: Maybe OriginRequestPolicyConfig
$sel:originRequestPolicyConfig:GetOriginRequestPolicyConfigResponse' :: GetOriginRequestPolicyConfigResponse
-> Maybe OriginRequestPolicyConfig
originRequestPolicyConfig} -> Maybe OriginRequestPolicyConfig
originRequestPolicyConfig) (\s :: GetOriginRequestPolicyConfigResponse
s@GetOriginRequestPolicyConfigResponse' {} Maybe OriginRequestPolicyConfig
a -> GetOriginRequestPolicyConfigResponse
s {$sel:originRequestPolicyConfig:GetOriginRequestPolicyConfigResponse' :: Maybe OriginRequestPolicyConfig
originRequestPolicyConfig = Maybe OriginRequestPolicyConfig
a} :: GetOriginRequestPolicyConfigResponse)
getOriginRequestPolicyConfigResponse_httpStatus :: Lens.Lens' GetOriginRequestPolicyConfigResponse Prelude.Int
getOriginRequestPolicyConfigResponse_httpStatus :: (Int -> f Int)
-> GetOriginRequestPolicyConfigResponse
-> f GetOriginRequestPolicyConfigResponse
getOriginRequestPolicyConfigResponse_httpStatus = (GetOriginRequestPolicyConfigResponse -> Int)
-> (GetOriginRequestPolicyConfigResponse
-> Int -> GetOriginRequestPolicyConfigResponse)
-> Lens
GetOriginRequestPolicyConfigResponse
GetOriginRequestPolicyConfigResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetOriginRequestPolicyConfigResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetOriginRequestPolicyConfigResponse' :: GetOriginRequestPolicyConfigResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetOriginRequestPolicyConfigResponse
s@GetOriginRequestPolicyConfigResponse' {} Int
a -> GetOriginRequestPolicyConfigResponse
s {$sel:httpStatus:GetOriginRequestPolicyConfigResponse' :: Int
httpStatus = Int
a} :: GetOriginRequestPolicyConfigResponse)
instance
Prelude.NFData
GetOriginRequestPolicyConfigResponse