{-# 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.ListOriginRequestPolicies
(
ListOriginRequestPolicies (..),
newListOriginRequestPolicies,
listOriginRequestPolicies_marker,
listOriginRequestPolicies_maxItems,
listOriginRequestPolicies_type,
ListOriginRequestPoliciesResponse (..),
newListOriginRequestPoliciesResponse,
listOriginRequestPoliciesResponse_originRequestPolicyList,
listOriginRequestPoliciesResponse_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 ListOriginRequestPolicies = ListOriginRequestPolicies'
{
ListOriginRequestPolicies -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
ListOriginRequestPolicies -> Maybe Text
maxItems :: Prelude.Maybe Prelude.Text,
ListOriginRequestPolicies -> Maybe OriginRequestPolicyType
type' :: Prelude.Maybe OriginRequestPolicyType
}
deriving (ListOriginRequestPolicies -> ListOriginRequestPolicies -> Bool
(ListOriginRequestPolicies -> ListOriginRequestPolicies -> Bool)
-> (ListOriginRequestPolicies -> ListOriginRequestPolicies -> Bool)
-> Eq ListOriginRequestPolicies
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListOriginRequestPolicies -> ListOriginRequestPolicies -> Bool
$c/= :: ListOriginRequestPolicies -> ListOriginRequestPolicies -> Bool
== :: ListOriginRequestPolicies -> ListOriginRequestPolicies -> Bool
$c== :: ListOriginRequestPolicies -> ListOriginRequestPolicies -> Bool
Prelude.Eq, ReadPrec [ListOriginRequestPolicies]
ReadPrec ListOriginRequestPolicies
Int -> ReadS ListOriginRequestPolicies
ReadS [ListOriginRequestPolicies]
(Int -> ReadS ListOriginRequestPolicies)
-> ReadS [ListOriginRequestPolicies]
-> ReadPrec ListOriginRequestPolicies
-> ReadPrec [ListOriginRequestPolicies]
-> Read ListOriginRequestPolicies
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListOriginRequestPolicies]
$creadListPrec :: ReadPrec [ListOriginRequestPolicies]
readPrec :: ReadPrec ListOriginRequestPolicies
$creadPrec :: ReadPrec ListOriginRequestPolicies
readList :: ReadS [ListOriginRequestPolicies]
$creadList :: ReadS [ListOriginRequestPolicies]
readsPrec :: Int -> ReadS ListOriginRequestPolicies
$creadsPrec :: Int -> ReadS ListOriginRequestPolicies
Prelude.Read, Int -> ListOriginRequestPolicies -> ShowS
[ListOriginRequestPolicies] -> ShowS
ListOriginRequestPolicies -> String
(Int -> ListOriginRequestPolicies -> ShowS)
-> (ListOriginRequestPolicies -> String)
-> ([ListOriginRequestPolicies] -> ShowS)
-> Show ListOriginRequestPolicies
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListOriginRequestPolicies] -> ShowS
$cshowList :: [ListOriginRequestPolicies] -> ShowS
show :: ListOriginRequestPolicies -> String
$cshow :: ListOriginRequestPolicies -> String
showsPrec :: Int -> ListOriginRequestPolicies -> ShowS
$cshowsPrec :: Int -> ListOriginRequestPolicies -> ShowS
Prelude.Show, (forall x.
ListOriginRequestPolicies -> Rep ListOriginRequestPolicies x)
-> (forall x.
Rep ListOriginRequestPolicies x -> ListOriginRequestPolicies)
-> Generic ListOriginRequestPolicies
forall x.
Rep ListOriginRequestPolicies x -> ListOriginRequestPolicies
forall x.
ListOriginRequestPolicies -> Rep ListOriginRequestPolicies x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListOriginRequestPolicies x -> ListOriginRequestPolicies
$cfrom :: forall x.
ListOriginRequestPolicies -> Rep ListOriginRequestPolicies x
Prelude.Generic)
newListOriginRequestPolicies ::
ListOriginRequestPolicies
newListOriginRequestPolicies :: ListOriginRequestPolicies
newListOriginRequestPolicies =
ListOriginRequestPolicies' :: Maybe Text
-> Maybe Text
-> Maybe OriginRequestPolicyType
-> ListOriginRequestPolicies
ListOriginRequestPolicies'
{ $sel:marker:ListOriginRequestPolicies' :: Maybe Text
marker =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxItems:ListOriginRequestPolicies' :: Maybe Text
maxItems = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:type':ListOriginRequestPolicies' :: Maybe OriginRequestPolicyType
type' = Maybe OriginRequestPolicyType
forall a. Maybe a
Prelude.Nothing
}
listOriginRequestPolicies_marker :: Lens.Lens' ListOriginRequestPolicies (Prelude.Maybe Prelude.Text)
listOriginRequestPolicies_marker :: (Maybe Text -> f (Maybe Text))
-> ListOriginRequestPolicies -> f ListOriginRequestPolicies
listOriginRequestPolicies_marker = (ListOriginRequestPolicies -> Maybe Text)
-> (ListOriginRequestPolicies
-> Maybe Text -> ListOriginRequestPolicies)
-> Lens
ListOriginRequestPolicies
ListOriginRequestPolicies
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOriginRequestPolicies' {Maybe Text
marker :: Maybe Text
$sel:marker:ListOriginRequestPolicies' :: ListOriginRequestPolicies -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListOriginRequestPolicies
s@ListOriginRequestPolicies' {} Maybe Text
a -> ListOriginRequestPolicies
s {$sel:marker:ListOriginRequestPolicies' :: Maybe Text
marker = Maybe Text
a} :: ListOriginRequestPolicies)
listOriginRequestPolicies_maxItems :: Lens.Lens' ListOriginRequestPolicies (Prelude.Maybe Prelude.Text)
listOriginRequestPolicies_maxItems :: (Maybe Text -> f (Maybe Text))
-> ListOriginRequestPolicies -> f ListOriginRequestPolicies
listOriginRequestPolicies_maxItems = (ListOriginRequestPolicies -> Maybe Text)
-> (ListOriginRequestPolicies
-> Maybe Text -> ListOriginRequestPolicies)
-> Lens
ListOriginRequestPolicies
ListOriginRequestPolicies
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOriginRequestPolicies' {Maybe Text
maxItems :: Maybe Text
$sel:maxItems:ListOriginRequestPolicies' :: ListOriginRequestPolicies -> Maybe Text
maxItems} -> Maybe Text
maxItems) (\s :: ListOriginRequestPolicies
s@ListOriginRequestPolicies' {} Maybe Text
a -> ListOriginRequestPolicies
s {$sel:maxItems:ListOriginRequestPolicies' :: Maybe Text
maxItems = Maybe Text
a} :: ListOriginRequestPolicies)
listOriginRequestPolicies_type :: Lens.Lens' ListOriginRequestPolicies (Prelude.Maybe OriginRequestPolicyType)
listOriginRequestPolicies_type :: (Maybe OriginRequestPolicyType
-> f (Maybe OriginRequestPolicyType))
-> ListOriginRequestPolicies -> f ListOriginRequestPolicies
listOriginRequestPolicies_type = (ListOriginRequestPolicies -> Maybe OriginRequestPolicyType)
-> (ListOriginRequestPolicies
-> Maybe OriginRequestPolicyType -> ListOriginRequestPolicies)
-> Lens
ListOriginRequestPolicies
ListOriginRequestPolicies
(Maybe OriginRequestPolicyType)
(Maybe OriginRequestPolicyType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOriginRequestPolicies' {Maybe OriginRequestPolicyType
type' :: Maybe OriginRequestPolicyType
$sel:type':ListOriginRequestPolicies' :: ListOriginRequestPolicies -> Maybe OriginRequestPolicyType
type'} -> Maybe OriginRequestPolicyType
type') (\s :: ListOriginRequestPolicies
s@ListOriginRequestPolicies' {} Maybe OriginRequestPolicyType
a -> ListOriginRequestPolicies
s {$sel:type':ListOriginRequestPolicies' :: Maybe OriginRequestPolicyType
type' = Maybe OriginRequestPolicyType
a} :: ListOriginRequestPolicies)
instance Core.AWSRequest ListOriginRequestPolicies where
type
AWSResponse ListOriginRequestPolicies =
ListOriginRequestPoliciesResponse
request :: ListOriginRequestPolicies -> Request ListOriginRequestPolicies
request = Service
-> ListOriginRequestPolicies -> Request ListOriginRequestPolicies
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy ListOriginRequestPolicies
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListOriginRequestPolicies)))
response =
(Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse ListOriginRequestPolicies))
-> Logger
-> Service
-> Proxy ListOriginRequestPolicies
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListOriginRequestPolicies)))
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 OriginRequestPolicyList
-> Int -> ListOriginRequestPoliciesResponse
ListOriginRequestPoliciesResponse'
(Maybe OriginRequestPolicyList
-> Int -> ListOriginRequestPoliciesResponse)
-> Either String (Maybe OriginRequestPolicyList)
-> Either String (Int -> ListOriginRequestPoliciesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node] -> Either String (Maybe OriginRequestPolicyList)
forall a. FromXML a => [Node] -> Either String a
Core.parseXML [Node]
x)
Either String (Int -> ListOriginRequestPoliciesResponse)
-> Either String Int
-> Either String ListOriginRequestPoliciesResponse
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 ListOriginRequestPolicies
instance Prelude.NFData ListOriginRequestPolicies
instance Core.ToHeaders ListOriginRequestPolicies where
toHeaders :: ListOriginRequestPolicies -> ResponseHeaders
toHeaders = ResponseHeaders -> ListOriginRequestPolicies -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath ListOriginRequestPolicies where
toPath :: ListOriginRequestPolicies -> ByteString
toPath =
ByteString -> ListOriginRequestPolicies -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/2020-05-31/origin-request-policy"
instance Core.ToQuery ListOriginRequestPolicies where
toQuery :: ListOriginRequestPolicies -> QueryString
toQuery ListOriginRequestPolicies' {Maybe Text
Maybe OriginRequestPolicyType
type' :: Maybe OriginRequestPolicyType
maxItems :: Maybe Text
marker :: Maybe Text
$sel:type':ListOriginRequestPolicies' :: ListOriginRequestPolicies -> Maybe OriginRequestPolicyType
$sel:maxItems:ListOriginRequestPolicies' :: ListOriginRequestPolicies -> Maybe Text
$sel:marker:ListOriginRequestPolicies' :: ListOriginRequestPolicies -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Marker" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
marker,
ByteString
"MaxItems" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
maxItems,
ByteString
"Type" ByteString -> Maybe OriginRequestPolicyType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe OriginRequestPolicyType
type'
]
data ListOriginRequestPoliciesResponse = ListOriginRequestPoliciesResponse'
{
ListOriginRequestPoliciesResponse -> Maybe OriginRequestPolicyList
originRequestPolicyList :: Prelude.Maybe OriginRequestPolicyList,
ListOriginRequestPoliciesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListOriginRequestPoliciesResponse
-> ListOriginRequestPoliciesResponse -> Bool
(ListOriginRequestPoliciesResponse
-> ListOriginRequestPoliciesResponse -> Bool)
-> (ListOriginRequestPoliciesResponse
-> ListOriginRequestPoliciesResponse -> Bool)
-> Eq ListOriginRequestPoliciesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListOriginRequestPoliciesResponse
-> ListOriginRequestPoliciesResponse -> Bool
$c/= :: ListOriginRequestPoliciesResponse
-> ListOriginRequestPoliciesResponse -> Bool
== :: ListOriginRequestPoliciesResponse
-> ListOriginRequestPoliciesResponse -> Bool
$c== :: ListOriginRequestPoliciesResponse
-> ListOriginRequestPoliciesResponse -> Bool
Prelude.Eq, ReadPrec [ListOriginRequestPoliciesResponse]
ReadPrec ListOriginRequestPoliciesResponse
Int -> ReadS ListOriginRequestPoliciesResponse
ReadS [ListOriginRequestPoliciesResponse]
(Int -> ReadS ListOriginRequestPoliciesResponse)
-> ReadS [ListOriginRequestPoliciesResponse]
-> ReadPrec ListOriginRequestPoliciesResponse
-> ReadPrec [ListOriginRequestPoliciesResponse]
-> Read ListOriginRequestPoliciesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListOriginRequestPoliciesResponse]
$creadListPrec :: ReadPrec [ListOriginRequestPoliciesResponse]
readPrec :: ReadPrec ListOriginRequestPoliciesResponse
$creadPrec :: ReadPrec ListOriginRequestPoliciesResponse
readList :: ReadS [ListOriginRequestPoliciesResponse]
$creadList :: ReadS [ListOriginRequestPoliciesResponse]
readsPrec :: Int -> ReadS ListOriginRequestPoliciesResponse
$creadsPrec :: Int -> ReadS ListOriginRequestPoliciesResponse
Prelude.Read, Int -> ListOriginRequestPoliciesResponse -> ShowS
[ListOriginRequestPoliciesResponse] -> ShowS
ListOriginRequestPoliciesResponse -> String
(Int -> ListOriginRequestPoliciesResponse -> ShowS)
-> (ListOriginRequestPoliciesResponse -> String)
-> ([ListOriginRequestPoliciesResponse] -> ShowS)
-> Show ListOriginRequestPoliciesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListOriginRequestPoliciesResponse] -> ShowS
$cshowList :: [ListOriginRequestPoliciesResponse] -> ShowS
show :: ListOriginRequestPoliciesResponse -> String
$cshow :: ListOriginRequestPoliciesResponse -> String
showsPrec :: Int -> ListOriginRequestPoliciesResponse -> ShowS
$cshowsPrec :: Int -> ListOriginRequestPoliciesResponse -> ShowS
Prelude.Show, (forall x.
ListOriginRequestPoliciesResponse
-> Rep ListOriginRequestPoliciesResponse x)
-> (forall x.
Rep ListOriginRequestPoliciesResponse x
-> ListOriginRequestPoliciesResponse)
-> Generic ListOriginRequestPoliciesResponse
forall x.
Rep ListOriginRequestPoliciesResponse x
-> ListOriginRequestPoliciesResponse
forall x.
ListOriginRequestPoliciesResponse
-> Rep ListOriginRequestPoliciesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListOriginRequestPoliciesResponse x
-> ListOriginRequestPoliciesResponse
$cfrom :: forall x.
ListOriginRequestPoliciesResponse
-> Rep ListOriginRequestPoliciesResponse x
Prelude.Generic)
newListOriginRequestPoliciesResponse ::
Prelude.Int ->
ListOriginRequestPoliciesResponse
newListOriginRequestPoliciesResponse :: Int -> ListOriginRequestPoliciesResponse
newListOriginRequestPoliciesResponse Int
pHttpStatus_ =
ListOriginRequestPoliciesResponse' :: Maybe OriginRequestPolicyList
-> Int -> ListOriginRequestPoliciesResponse
ListOriginRequestPoliciesResponse'
{ $sel:originRequestPolicyList:ListOriginRequestPoliciesResponse' :: Maybe OriginRequestPolicyList
originRequestPolicyList =
Maybe OriginRequestPolicyList
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListOriginRequestPoliciesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listOriginRequestPoliciesResponse_originRequestPolicyList :: Lens.Lens' ListOriginRequestPoliciesResponse (Prelude.Maybe OriginRequestPolicyList)
listOriginRequestPoliciesResponse_originRequestPolicyList :: (Maybe OriginRequestPolicyList
-> f (Maybe OriginRequestPolicyList))
-> ListOriginRequestPoliciesResponse
-> f ListOriginRequestPoliciesResponse
listOriginRequestPoliciesResponse_originRequestPolicyList = (ListOriginRequestPoliciesResponse
-> Maybe OriginRequestPolicyList)
-> (ListOriginRequestPoliciesResponse
-> Maybe OriginRequestPolicyList
-> ListOriginRequestPoliciesResponse)
-> Lens
ListOriginRequestPoliciesResponse
ListOriginRequestPoliciesResponse
(Maybe OriginRequestPolicyList)
(Maybe OriginRequestPolicyList)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOriginRequestPoliciesResponse' {Maybe OriginRequestPolicyList
originRequestPolicyList :: Maybe OriginRequestPolicyList
$sel:originRequestPolicyList:ListOriginRequestPoliciesResponse' :: ListOriginRequestPoliciesResponse -> Maybe OriginRequestPolicyList
originRequestPolicyList} -> Maybe OriginRequestPolicyList
originRequestPolicyList) (\s :: ListOriginRequestPoliciesResponse
s@ListOriginRequestPoliciesResponse' {} Maybe OriginRequestPolicyList
a -> ListOriginRequestPoliciesResponse
s {$sel:originRequestPolicyList:ListOriginRequestPoliciesResponse' :: Maybe OriginRequestPolicyList
originRequestPolicyList = Maybe OriginRequestPolicyList
a} :: ListOriginRequestPoliciesResponse)
listOriginRequestPoliciesResponse_httpStatus :: Lens.Lens' ListOriginRequestPoliciesResponse Prelude.Int
listOriginRequestPoliciesResponse_httpStatus :: (Int -> f Int)
-> ListOriginRequestPoliciesResponse
-> f ListOriginRequestPoliciesResponse
listOriginRequestPoliciesResponse_httpStatus = (ListOriginRequestPoliciesResponse -> Int)
-> (ListOriginRequestPoliciesResponse
-> Int -> ListOriginRequestPoliciesResponse)
-> Lens
ListOriginRequestPoliciesResponse
ListOriginRequestPoliciesResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListOriginRequestPoliciesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListOriginRequestPoliciesResponse' :: ListOriginRequestPoliciesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListOriginRequestPoliciesResponse
s@ListOriginRequestPoliciesResponse' {} Int
a -> ListOriginRequestPoliciesResponse
s {$sel:httpStatus:ListOriginRequestPoliciesResponse' :: Int
httpStatus = Int
a} :: ListOriginRequestPoliciesResponse)
instance
Prelude.NFData
ListOriginRequestPoliciesResponse