{-# 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.ListDistributionsByCachePolicyId
(
ListDistributionsByCachePolicyId (..),
newListDistributionsByCachePolicyId,
listDistributionsByCachePolicyId_marker,
listDistributionsByCachePolicyId_maxItems,
listDistributionsByCachePolicyId_cachePolicyId,
ListDistributionsByCachePolicyIdResponse (..),
newListDistributionsByCachePolicyIdResponse,
listDistributionsByCachePolicyIdResponse_distributionIdList,
listDistributionsByCachePolicyIdResponse_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 ListDistributionsByCachePolicyId = ListDistributionsByCachePolicyId'
{
ListDistributionsByCachePolicyId -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
ListDistributionsByCachePolicyId -> Maybe Text
maxItems :: Prelude.Maybe Prelude.Text,
ListDistributionsByCachePolicyId -> Text
cachePolicyId :: Prelude.Text
}
deriving (ListDistributionsByCachePolicyId
-> ListDistributionsByCachePolicyId -> Bool
(ListDistributionsByCachePolicyId
-> ListDistributionsByCachePolicyId -> Bool)
-> (ListDistributionsByCachePolicyId
-> ListDistributionsByCachePolicyId -> Bool)
-> Eq ListDistributionsByCachePolicyId
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDistributionsByCachePolicyId
-> ListDistributionsByCachePolicyId -> Bool
$c/= :: ListDistributionsByCachePolicyId
-> ListDistributionsByCachePolicyId -> Bool
== :: ListDistributionsByCachePolicyId
-> ListDistributionsByCachePolicyId -> Bool
$c== :: ListDistributionsByCachePolicyId
-> ListDistributionsByCachePolicyId -> Bool
Prelude.Eq, ReadPrec [ListDistributionsByCachePolicyId]
ReadPrec ListDistributionsByCachePolicyId
Int -> ReadS ListDistributionsByCachePolicyId
ReadS [ListDistributionsByCachePolicyId]
(Int -> ReadS ListDistributionsByCachePolicyId)
-> ReadS [ListDistributionsByCachePolicyId]
-> ReadPrec ListDistributionsByCachePolicyId
-> ReadPrec [ListDistributionsByCachePolicyId]
-> Read ListDistributionsByCachePolicyId
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDistributionsByCachePolicyId]
$creadListPrec :: ReadPrec [ListDistributionsByCachePolicyId]
readPrec :: ReadPrec ListDistributionsByCachePolicyId
$creadPrec :: ReadPrec ListDistributionsByCachePolicyId
readList :: ReadS [ListDistributionsByCachePolicyId]
$creadList :: ReadS [ListDistributionsByCachePolicyId]
readsPrec :: Int -> ReadS ListDistributionsByCachePolicyId
$creadsPrec :: Int -> ReadS ListDistributionsByCachePolicyId
Prelude.Read, Int -> ListDistributionsByCachePolicyId -> ShowS
[ListDistributionsByCachePolicyId] -> ShowS
ListDistributionsByCachePolicyId -> String
(Int -> ListDistributionsByCachePolicyId -> ShowS)
-> (ListDistributionsByCachePolicyId -> String)
-> ([ListDistributionsByCachePolicyId] -> ShowS)
-> Show ListDistributionsByCachePolicyId
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDistributionsByCachePolicyId] -> ShowS
$cshowList :: [ListDistributionsByCachePolicyId] -> ShowS
show :: ListDistributionsByCachePolicyId -> String
$cshow :: ListDistributionsByCachePolicyId -> String
showsPrec :: Int -> ListDistributionsByCachePolicyId -> ShowS
$cshowsPrec :: Int -> ListDistributionsByCachePolicyId -> ShowS
Prelude.Show, (forall x.
ListDistributionsByCachePolicyId
-> Rep ListDistributionsByCachePolicyId x)
-> (forall x.
Rep ListDistributionsByCachePolicyId x
-> ListDistributionsByCachePolicyId)
-> Generic ListDistributionsByCachePolicyId
forall x.
Rep ListDistributionsByCachePolicyId x
-> ListDistributionsByCachePolicyId
forall x.
ListDistributionsByCachePolicyId
-> Rep ListDistributionsByCachePolicyId x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDistributionsByCachePolicyId x
-> ListDistributionsByCachePolicyId
$cfrom :: forall x.
ListDistributionsByCachePolicyId
-> Rep ListDistributionsByCachePolicyId x
Prelude.Generic)
newListDistributionsByCachePolicyId ::
Prelude.Text ->
ListDistributionsByCachePolicyId
newListDistributionsByCachePolicyId :: Text -> ListDistributionsByCachePolicyId
newListDistributionsByCachePolicyId Text
pCachePolicyId_ =
ListDistributionsByCachePolicyId' :: Maybe Text
-> Maybe Text -> Text -> ListDistributionsByCachePolicyId
ListDistributionsByCachePolicyId'
{ $sel:marker:ListDistributionsByCachePolicyId' :: Maybe Text
marker =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxItems:ListDistributionsByCachePolicyId' :: Maybe Text
maxItems = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:cachePolicyId:ListDistributionsByCachePolicyId' :: Text
cachePolicyId = Text
pCachePolicyId_
}
listDistributionsByCachePolicyId_marker :: Lens.Lens' ListDistributionsByCachePolicyId (Prelude.Maybe Prelude.Text)
listDistributionsByCachePolicyId_marker :: (Maybe Text -> f (Maybe Text))
-> ListDistributionsByCachePolicyId
-> f ListDistributionsByCachePolicyId
listDistributionsByCachePolicyId_marker = (ListDistributionsByCachePolicyId -> Maybe Text)
-> (ListDistributionsByCachePolicyId
-> Maybe Text -> ListDistributionsByCachePolicyId)
-> Lens
ListDistributionsByCachePolicyId
ListDistributionsByCachePolicyId
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDistributionsByCachePolicyId' {Maybe Text
marker :: Maybe Text
$sel:marker:ListDistributionsByCachePolicyId' :: ListDistributionsByCachePolicyId -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListDistributionsByCachePolicyId
s@ListDistributionsByCachePolicyId' {} Maybe Text
a -> ListDistributionsByCachePolicyId
s {$sel:marker:ListDistributionsByCachePolicyId' :: Maybe Text
marker = Maybe Text
a} :: ListDistributionsByCachePolicyId)
listDistributionsByCachePolicyId_maxItems :: Lens.Lens' ListDistributionsByCachePolicyId (Prelude.Maybe Prelude.Text)
listDistributionsByCachePolicyId_maxItems :: (Maybe Text -> f (Maybe Text))
-> ListDistributionsByCachePolicyId
-> f ListDistributionsByCachePolicyId
listDistributionsByCachePolicyId_maxItems = (ListDistributionsByCachePolicyId -> Maybe Text)
-> (ListDistributionsByCachePolicyId
-> Maybe Text -> ListDistributionsByCachePolicyId)
-> Lens
ListDistributionsByCachePolicyId
ListDistributionsByCachePolicyId
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDistributionsByCachePolicyId' {Maybe Text
maxItems :: Maybe Text
$sel:maxItems:ListDistributionsByCachePolicyId' :: ListDistributionsByCachePolicyId -> Maybe Text
maxItems} -> Maybe Text
maxItems) (\s :: ListDistributionsByCachePolicyId
s@ListDistributionsByCachePolicyId' {} Maybe Text
a -> ListDistributionsByCachePolicyId
s {$sel:maxItems:ListDistributionsByCachePolicyId' :: Maybe Text
maxItems = Maybe Text
a} :: ListDistributionsByCachePolicyId)
listDistributionsByCachePolicyId_cachePolicyId :: Lens.Lens' ListDistributionsByCachePolicyId Prelude.Text
listDistributionsByCachePolicyId_cachePolicyId :: (Text -> f Text)
-> ListDistributionsByCachePolicyId
-> f ListDistributionsByCachePolicyId
listDistributionsByCachePolicyId_cachePolicyId = (ListDistributionsByCachePolicyId -> Text)
-> (ListDistributionsByCachePolicyId
-> Text -> ListDistributionsByCachePolicyId)
-> Lens
ListDistributionsByCachePolicyId
ListDistributionsByCachePolicyId
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDistributionsByCachePolicyId' {Text
cachePolicyId :: Text
$sel:cachePolicyId:ListDistributionsByCachePolicyId' :: ListDistributionsByCachePolicyId -> Text
cachePolicyId} -> Text
cachePolicyId) (\s :: ListDistributionsByCachePolicyId
s@ListDistributionsByCachePolicyId' {} Text
a -> ListDistributionsByCachePolicyId
s {$sel:cachePolicyId:ListDistributionsByCachePolicyId' :: Text
cachePolicyId = Text
a} :: ListDistributionsByCachePolicyId)
instance
Core.AWSRequest
ListDistributionsByCachePolicyId
where
type
AWSResponse ListDistributionsByCachePolicyId =
ListDistributionsByCachePolicyIdResponse
request :: ListDistributionsByCachePolicyId
-> Request ListDistributionsByCachePolicyId
request = Service
-> ListDistributionsByCachePolicyId
-> Request ListDistributionsByCachePolicyId
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy ListDistributionsByCachePolicyId
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse ListDistributionsByCachePolicyId)))
response =
(Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse ListDistributionsByCachePolicyId))
-> Logger
-> Service
-> Proxy ListDistributionsByCachePolicyId
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse ListDistributionsByCachePolicyId)))
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 DistributionIdList
-> Int -> ListDistributionsByCachePolicyIdResponse
ListDistributionsByCachePolicyIdResponse'
(Maybe DistributionIdList
-> Int -> ListDistributionsByCachePolicyIdResponse)
-> Either String (Maybe DistributionIdList)
-> Either String (Int -> ListDistributionsByCachePolicyIdResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node] -> Either String (Maybe DistributionIdList)
forall a. FromXML a => [Node] -> Either String a
Core.parseXML [Node]
x)
Either String (Int -> ListDistributionsByCachePolicyIdResponse)
-> Either String Int
-> Either String ListDistributionsByCachePolicyIdResponse
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
ListDistributionsByCachePolicyId
instance
Prelude.NFData
ListDistributionsByCachePolicyId
instance
Core.ToHeaders
ListDistributionsByCachePolicyId
where
toHeaders :: ListDistributionsByCachePolicyId -> ResponseHeaders
toHeaders = ResponseHeaders
-> ListDistributionsByCachePolicyId -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath ListDistributionsByCachePolicyId where
toPath :: ListDistributionsByCachePolicyId -> ByteString
toPath ListDistributionsByCachePolicyId' {Maybe Text
Text
cachePolicyId :: Text
maxItems :: Maybe Text
marker :: Maybe Text
$sel:cachePolicyId:ListDistributionsByCachePolicyId' :: ListDistributionsByCachePolicyId -> Text
$sel:maxItems:ListDistributionsByCachePolicyId' :: ListDistributionsByCachePolicyId -> Maybe Text
$sel:marker:ListDistributionsByCachePolicyId' :: ListDistributionsByCachePolicyId -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/2020-05-31/distributionsByCachePolicyId/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
cachePolicyId
]
instance
Core.ToQuery
ListDistributionsByCachePolicyId
where
toQuery :: ListDistributionsByCachePolicyId -> QueryString
toQuery ListDistributionsByCachePolicyId' {Maybe Text
Text
cachePolicyId :: Text
maxItems :: Maybe Text
marker :: Maybe Text
$sel:cachePolicyId:ListDistributionsByCachePolicyId' :: ListDistributionsByCachePolicyId -> Text
$sel:maxItems:ListDistributionsByCachePolicyId' :: ListDistributionsByCachePolicyId -> Maybe Text
$sel:marker:ListDistributionsByCachePolicyId' :: ListDistributionsByCachePolicyId -> 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
]
data ListDistributionsByCachePolicyIdResponse = ListDistributionsByCachePolicyIdResponse'
{
ListDistributionsByCachePolicyIdResponse
-> Maybe DistributionIdList
distributionIdList :: Prelude.Maybe DistributionIdList,
ListDistributionsByCachePolicyIdResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListDistributionsByCachePolicyIdResponse
-> ListDistributionsByCachePolicyIdResponse -> Bool
(ListDistributionsByCachePolicyIdResponse
-> ListDistributionsByCachePolicyIdResponse -> Bool)
-> (ListDistributionsByCachePolicyIdResponse
-> ListDistributionsByCachePolicyIdResponse -> Bool)
-> Eq ListDistributionsByCachePolicyIdResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDistributionsByCachePolicyIdResponse
-> ListDistributionsByCachePolicyIdResponse -> Bool
$c/= :: ListDistributionsByCachePolicyIdResponse
-> ListDistributionsByCachePolicyIdResponse -> Bool
== :: ListDistributionsByCachePolicyIdResponse
-> ListDistributionsByCachePolicyIdResponse -> Bool
$c== :: ListDistributionsByCachePolicyIdResponse
-> ListDistributionsByCachePolicyIdResponse -> Bool
Prelude.Eq, ReadPrec [ListDistributionsByCachePolicyIdResponse]
ReadPrec ListDistributionsByCachePolicyIdResponse
Int -> ReadS ListDistributionsByCachePolicyIdResponse
ReadS [ListDistributionsByCachePolicyIdResponse]
(Int -> ReadS ListDistributionsByCachePolicyIdResponse)
-> ReadS [ListDistributionsByCachePolicyIdResponse]
-> ReadPrec ListDistributionsByCachePolicyIdResponse
-> ReadPrec [ListDistributionsByCachePolicyIdResponse]
-> Read ListDistributionsByCachePolicyIdResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDistributionsByCachePolicyIdResponse]
$creadListPrec :: ReadPrec [ListDistributionsByCachePolicyIdResponse]
readPrec :: ReadPrec ListDistributionsByCachePolicyIdResponse
$creadPrec :: ReadPrec ListDistributionsByCachePolicyIdResponse
readList :: ReadS [ListDistributionsByCachePolicyIdResponse]
$creadList :: ReadS [ListDistributionsByCachePolicyIdResponse]
readsPrec :: Int -> ReadS ListDistributionsByCachePolicyIdResponse
$creadsPrec :: Int -> ReadS ListDistributionsByCachePolicyIdResponse
Prelude.Read, Int -> ListDistributionsByCachePolicyIdResponse -> ShowS
[ListDistributionsByCachePolicyIdResponse] -> ShowS
ListDistributionsByCachePolicyIdResponse -> String
(Int -> ListDistributionsByCachePolicyIdResponse -> ShowS)
-> (ListDistributionsByCachePolicyIdResponse -> String)
-> ([ListDistributionsByCachePolicyIdResponse] -> ShowS)
-> Show ListDistributionsByCachePolicyIdResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDistributionsByCachePolicyIdResponse] -> ShowS
$cshowList :: [ListDistributionsByCachePolicyIdResponse] -> ShowS
show :: ListDistributionsByCachePolicyIdResponse -> String
$cshow :: ListDistributionsByCachePolicyIdResponse -> String
showsPrec :: Int -> ListDistributionsByCachePolicyIdResponse -> ShowS
$cshowsPrec :: Int -> ListDistributionsByCachePolicyIdResponse -> ShowS
Prelude.Show, (forall x.
ListDistributionsByCachePolicyIdResponse
-> Rep ListDistributionsByCachePolicyIdResponse x)
-> (forall x.
Rep ListDistributionsByCachePolicyIdResponse x
-> ListDistributionsByCachePolicyIdResponse)
-> Generic ListDistributionsByCachePolicyIdResponse
forall x.
Rep ListDistributionsByCachePolicyIdResponse x
-> ListDistributionsByCachePolicyIdResponse
forall x.
ListDistributionsByCachePolicyIdResponse
-> Rep ListDistributionsByCachePolicyIdResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDistributionsByCachePolicyIdResponse x
-> ListDistributionsByCachePolicyIdResponse
$cfrom :: forall x.
ListDistributionsByCachePolicyIdResponse
-> Rep ListDistributionsByCachePolicyIdResponse x
Prelude.Generic)
newListDistributionsByCachePolicyIdResponse ::
Prelude.Int ->
ListDistributionsByCachePolicyIdResponse
newListDistributionsByCachePolicyIdResponse :: Int -> ListDistributionsByCachePolicyIdResponse
newListDistributionsByCachePolicyIdResponse
Int
pHttpStatus_ =
ListDistributionsByCachePolicyIdResponse' :: Maybe DistributionIdList
-> Int -> ListDistributionsByCachePolicyIdResponse
ListDistributionsByCachePolicyIdResponse'
{ $sel:distributionIdList:ListDistributionsByCachePolicyIdResponse' :: Maybe DistributionIdList
distributionIdList =
Maybe DistributionIdList
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListDistributionsByCachePolicyIdResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listDistributionsByCachePolicyIdResponse_distributionIdList :: Lens.Lens' ListDistributionsByCachePolicyIdResponse (Prelude.Maybe DistributionIdList)
listDistributionsByCachePolicyIdResponse_distributionIdList :: (Maybe DistributionIdList -> f (Maybe DistributionIdList))
-> ListDistributionsByCachePolicyIdResponse
-> f ListDistributionsByCachePolicyIdResponse
listDistributionsByCachePolicyIdResponse_distributionIdList = (ListDistributionsByCachePolicyIdResponse
-> Maybe DistributionIdList)
-> (ListDistributionsByCachePolicyIdResponse
-> Maybe DistributionIdList
-> ListDistributionsByCachePolicyIdResponse)
-> Lens
ListDistributionsByCachePolicyIdResponse
ListDistributionsByCachePolicyIdResponse
(Maybe DistributionIdList)
(Maybe DistributionIdList)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDistributionsByCachePolicyIdResponse' {Maybe DistributionIdList
distributionIdList :: Maybe DistributionIdList
$sel:distributionIdList:ListDistributionsByCachePolicyIdResponse' :: ListDistributionsByCachePolicyIdResponse
-> Maybe DistributionIdList
distributionIdList} -> Maybe DistributionIdList
distributionIdList) (\s :: ListDistributionsByCachePolicyIdResponse
s@ListDistributionsByCachePolicyIdResponse' {} Maybe DistributionIdList
a -> ListDistributionsByCachePolicyIdResponse
s {$sel:distributionIdList:ListDistributionsByCachePolicyIdResponse' :: Maybe DistributionIdList
distributionIdList = Maybe DistributionIdList
a} :: ListDistributionsByCachePolicyIdResponse)
listDistributionsByCachePolicyIdResponse_httpStatus :: Lens.Lens' ListDistributionsByCachePolicyIdResponse Prelude.Int
listDistributionsByCachePolicyIdResponse_httpStatus :: (Int -> f Int)
-> ListDistributionsByCachePolicyIdResponse
-> f ListDistributionsByCachePolicyIdResponse
listDistributionsByCachePolicyIdResponse_httpStatus = (ListDistributionsByCachePolicyIdResponse -> Int)
-> (ListDistributionsByCachePolicyIdResponse
-> Int -> ListDistributionsByCachePolicyIdResponse)
-> Lens
ListDistributionsByCachePolicyIdResponse
ListDistributionsByCachePolicyIdResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDistributionsByCachePolicyIdResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListDistributionsByCachePolicyIdResponse' :: ListDistributionsByCachePolicyIdResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListDistributionsByCachePolicyIdResponse
s@ListDistributionsByCachePolicyIdResponse' {} Int
a -> ListDistributionsByCachePolicyIdResponse
s {$sel:httpStatus:ListDistributionsByCachePolicyIdResponse' :: Int
httpStatus = Int
a} :: ListDistributionsByCachePolicyIdResponse)
instance
Prelude.NFData
ListDistributionsByCachePolicyIdResponse