{-# 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.GetResponseHeadersPolicy
(
GetResponseHeadersPolicy (..),
newGetResponseHeadersPolicy,
getResponseHeadersPolicy_id,
GetResponseHeadersPolicyResponse (..),
newGetResponseHeadersPolicyResponse,
getResponseHeadersPolicyResponse_eTag,
getResponseHeadersPolicyResponse_responseHeadersPolicy,
getResponseHeadersPolicyResponse_httpStatus,
)
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 =
{
:: Prelude.Text
}
deriving (GetResponseHeadersPolicy -> GetResponseHeadersPolicy -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetResponseHeadersPolicy -> GetResponseHeadersPolicy -> Bool
$c/= :: GetResponseHeadersPolicy -> GetResponseHeadersPolicy -> Bool
== :: GetResponseHeadersPolicy -> GetResponseHeadersPolicy -> Bool
$c== :: GetResponseHeadersPolicy -> GetResponseHeadersPolicy -> Bool
Prelude.Eq, ReadPrec [GetResponseHeadersPolicy]
ReadPrec GetResponseHeadersPolicy
Int -> ReadS GetResponseHeadersPolicy
ReadS [GetResponseHeadersPolicy]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetResponseHeadersPolicy]
$creadListPrec :: ReadPrec [GetResponseHeadersPolicy]
readPrec :: ReadPrec GetResponseHeadersPolicy
$creadPrec :: ReadPrec GetResponseHeadersPolicy
readList :: ReadS [GetResponseHeadersPolicy]
$creadList :: ReadS [GetResponseHeadersPolicy]
readsPrec :: Int -> ReadS GetResponseHeadersPolicy
$creadsPrec :: Int -> ReadS GetResponseHeadersPolicy
Prelude.Read, Int -> GetResponseHeadersPolicy -> ShowS
[GetResponseHeadersPolicy] -> ShowS
GetResponseHeadersPolicy -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetResponseHeadersPolicy] -> ShowS
$cshowList :: [GetResponseHeadersPolicy] -> ShowS
show :: GetResponseHeadersPolicy -> String
$cshow :: GetResponseHeadersPolicy -> String
showsPrec :: Int -> GetResponseHeadersPolicy -> ShowS
$cshowsPrec :: Int -> GetResponseHeadersPolicy -> ShowS
Prelude.Show, forall x.
Rep GetResponseHeadersPolicy x -> GetResponseHeadersPolicy
forall x.
GetResponseHeadersPolicy -> Rep GetResponseHeadersPolicy x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetResponseHeadersPolicy x -> GetResponseHeadersPolicy
$cfrom :: forall x.
GetResponseHeadersPolicy -> Rep GetResponseHeadersPolicy x
Prelude.Generic)
newGetResponseHeadersPolicy ::
Prelude.Text ->
GetResponseHeadersPolicy
Text
pId_ =
GetResponseHeadersPolicy' {$sel:id:GetResponseHeadersPolicy' :: Text
id = Text
pId_}
getResponseHeadersPolicy_id :: Lens.Lens' GetResponseHeadersPolicy Prelude.Text
= forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResponseHeadersPolicy' {Text
id :: Text
$sel:id:GetResponseHeadersPolicy' :: GetResponseHeadersPolicy -> Text
id} -> Text
id) (\s :: GetResponseHeadersPolicy
s@GetResponseHeadersPolicy' {} Text
a -> GetResponseHeadersPolicy
s {$sel:id:GetResponseHeadersPolicy' :: Text
id = Text
a} :: GetResponseHeadersPolicy)
instance Core.AWSRequest GetResponseHeadersPolicy where
type
AWSResponse GetResponseHeadersPolicy =
GetResponseHeadersPolicyResponse
request :: (Service -> Service)
-> GetResponseHeadersPolicy -> Request GetResponseHeadersPolicy
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetResponseHeadersPolicy
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetResponseHeadersPolicy)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXML
( \Int
s ResponseHeaders
h [Node]
x ->
Maybe Text
-> Maybe ResponseHeadersPolicy
-> Int
-> GetResponseHeadersPolicyResponse
GetResponseHeadersPolicyResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (ResponseHeaders
h forall a.
FromText a =>
ResponseHeaders -> HeaderName -> Either String (Maybe a)
Data..#? HeaderName
"ETag")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall a. FromXML a => [Node] -> Either String a
Data.parseXML [Node]
x)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable GetResponseHeadersPolicy where
hashWithSalt :: Int -> GetResponseHeadersPolicy -> Int
hashWithSalt Int
_salt GetResponseHeadersPolicy' {Text
id :: Text
$sel:id:GetResponseHeadersPolicy' :: GetResponseHeadersPolicy -> Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
instance Prelude.NFData GetResponseHeadersPolicy where
rnf :: GetResponseHeadersPolicy -> ()
rnf GetResponseHeadersPolicy' {Text
id :: Text
$sel:id:GetResponseHeadersPolicy' :: GetResponseHeadersPolicy -> Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Text
id
instance Data.ToHeaders GetResponseHeadersPolicy where
toHeaders :: GetResponseHeadersPolicy -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.ToPath GetResponseHeadersPolicy where
toPath :: GetResponseHeadersPolicy -> ByteString
toPath GetResponseHeadersPolicy' {Text
id :: Text
$sel:id:GetResponseHeadersPolicy' :: GetResponseHeadersPolicy -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/2020-05-31/response-headers-policy/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
id
]
instance Data.ToQuery GetResponseHeadersPolicy where
toQuery :: GetResponseHeadersPolicy -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data =
{
:: Prelude.Maybe Prelude.Text,
:: Prelude.Maybe ResponseHeadersPolicy,
:: Prelude.Int
}
deriving (GetResponseHeadersPolicyResponse
-> GetResponseHeadersPolicyResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetResponseHeadersPolicyResponse
-> GetResponseHeadersPolicyResponse -> Bool
$c/= :: GetResponseHeadersPolicyResponse
-> GetResponseHeadersPolicyResponse -> Bool
== :: GetResponseHeadersPolicyResponse
-> GetResponseHeadersPolicyResponse -> Bool
$c== :: GetResponseHeadersPolicyResponse
-> GetResponseHeadersPolicyResponse -> Bool
Prelude.Eq, ReadPrec [GetResponseHeadersPolicyResponse]
ReadPrec GetResponseHeadersPolicyResponse
Int -> ReadS GetResponseHeadersPolicyResponse
ReadS [GetResponseHeadersPolicyResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetResponseHeadersPolicyResponse]
$creadListPrec :: ReadPrec [GetResponseHeadersPolicyResponse]
readPrec :: ReadPrec GetResponseHeadersPolicyResponse
$creadPrec :: ReadPrec GetResponseHeadersPolicyResponse
readList :: ReadS [GetResponseHeadersPolicyResponse]
$creadList :: ReadS [GetResponseHeadersPolicyResponse]
readsPrec :: Int -> ReadS GetResponseHeadersPolicyResponse
$creadsPrec :: Int -> ReadS GetResponseHeadersPolicyResponse
Prelude.Read, Int -> GetResponseHeadersPolicyResponse -> ShowS
[GetResponseHeadersPolicyResponse] -> ShowS
GetResponseHeadersPolicyResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetResponseHeadersPolicyResponse] -> ShowS
$cshowList :: [GetResponseHeadersPolicyResponse] -> ShowS
show :: GetResponseHeadersPolicyResponse -> String
$cshow :: GetResponseHeadersPolicyResponse -> String
showsPrec :: Int -> GetResponseHeadersPolicyResponse -> ShowS
$cshowsPrec :: Int -> GetResponseHeadersPolicyResponse -> ShowS
Prelude.Show, forall x.
Rep GetResponseHeadersPolicyResponse x
-> GetResponseHeadersPolicyResponse
forall x.
GetResponseHeadersPolicyResponse
-> Rep GetResponseHeadersPolicyResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetResponseHeadersPolicyResponse x
-> GetResponseHeadersPolicyResponse
$cfrom :: forall x.
GetResponseHeadersPolicyResponse
-> Rep GetResponseHeadersPolicyResponse x
Prelude.Generic)
newGetResponseHeadersPolicyResponse ::
Prelude.Int ->
GetResponseHeadersPolicyResponse
Int
pHttpStatus_ =
GetResponseHeadersPolicyResponse'
{ $sel:eTag:GetResponseHeadersPolicyResponse' :: Maybe Text
eTag =
forall a. Maybe a
Prelude.Nothing,
$sel:responseHeadersPolicy:GetResponseHeadersPolicyResponse' :: Maybe ResponseHeadersPolicy
responseHeadersPolicy = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetResponseHeadersPolicyResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getResponseHeadersPolicyResponse_eTag :: Lens.Lens' GetResponseHeadersPolicyResponse (Prelude.Maybe Prelude.Text)
= forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResponseHeadersPolicyResponse' {Maybe Text
eTag :: Maybe Text
$sel:eTag:GetResponseHeadersPolicyResponse' :: GetResponseHeadersPolicyResponse -> Maybe Text
eTag} -> Maybe Text
eTag) (\s :: GetResponseHeadersPolicyResponse
s@GetResponseHeadersPolicyResponse' {} Maybe Text
a -> GetResponseHeadersPolicyResponse
s {$sel:eTag:GetResponseHeadersPolicyResponse' :: Maybe Text
eTag = Maybe Text
a} :: GetResponseHeadersPolicyResponse)
getResponseHeadersPolicyResponse_responseHeadersPolicy :: Lens.Lens' GetResponseHeadersPolicyResponse (Prelude.Maybe ResponseHeadersPolicy)
= forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResponseHeadersPolicyResponse' {Maybe ResponseHeadersPolicy
responseHeadersPolicy :: Maybe ResponseHeadersPolicy
$sel:responseHeadersPolicy:GetResponseHeadersPolicyResponse' :: GetResponseHeadersPolicyResponse -> Maybe ResponseHeadersPolicy
responseHeadersPolicy} -> Maybe ResponseHeadersPolicy
responseHeadersPolicy) (\s :: GetResponseHeadersPolicyResponse
s@GetResponseHeadersPolicyResponse' {} Maybe ResponseHeadersPolicy
a -> GetResponseHeadersPolicyResponse
s {$sel:responseHeadersPolicy:GetResponseHeadersPolicyResponse' :: Maybe ResponseHeadersPolicy
responseHeadersPolicy = Maybe ResponseHeadersPolicy
a} :: GetResponseHeadersPolicyResponse)
getResponseHeadersPolicyResponse_httpStatus :: Lens.Lens' GetResponseHeadersPolicyResponse Prelude.Int
= forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetResponseHeadersPolicyResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetResponseHeadersPolicyResponse' :: GetResponseHeadersPolicyResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetResponseHeadersPolicyResponse
s@GetResponseHeadersPolicyResponse' {} Int
a -> GetResponseHeadersPolicyResponse
s {$sel:httpStatus:GetResponseHeadersPolicyResponse' :: Int
httpStatus = Int
a} :: GetResponseHeadersPolicyResponse)
instance
Prelude.NFData
GetResponseHeadersPolicyResponse
where
rnf :: GetResponseHeadersPolicyResponse -> ()
rnf GetResponseHeadersPolicyResponse' {Int
Maybe Text
Maybe ResponseHeadersPolicy
httpStatus :: Int
responseHeadersPolicy :: Maybe ResponseHeadersPolicy
eTag :: Maybe Text
$sel:httpStatus:GetResponseHeadersPolicyResponse' :: GetResponseHeadersPolicyResponse -> Int
$sel:responseHeadersPolicy:GetResponseHeadersPolicyResponse' :: GetResponseHeadersPolicyResponse -> Maybe ResponseHeadersPolicy
$sel:eTag:GetResponseHeadersPolicyResponse' :: GetResponseHeadersPolicyResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
eTag
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ResponseHeadersPolicy
responseHeadersPolicy
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus