{-# 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.ListDistributionsByKeyGroup
(
ListDistributionsByKeyGroup (..),
newListDistributionsByKeyGroup,
listDistributionsByKeyGroup_marker,
listDistributionsByKeyGroup_maxItems,
listDistributionsByKeyGroup_keyGroupId,
ListDistributionsByKeyGroupResponse (..),
newListDistributionsByKeyGroupResponse,
listDistributionsByKeyGroupResponse_distributionIdList,
listDistributionsByKeyGroupResponse_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 ListDistributionsByKeyGroup = ListDistributionsByKeyGroup'
{
ListDistributionsByKeyGroup -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
ListDistributionsByKeyGroup -> Maybe Text
maxItems :: Prelude.Maybe Prelude.Text,
ListDistributionsByKeyGroup -> Text
keyGroupId :: Prelude.Text
}
deriving (ListDistributionsByKeyGroup -> ListDistributionsByKeyGroup -> Bool
(ListDistributionsByKeyGroup
-> ListDistributionsByKeyGroup -> Bool)
-> (ListDistributionsByKeyGroup
-> ListDistributionsByKeyGroup -> Bool)
-> Eq ListDistributionsByKeyGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDistributionsByKeyGroup -> ListDistributionsByKeyGroup -> Bool
$c/= :: ListDistributionsByKeyGroup -> ListDistributionsByKeyGroup -> Bool
== :: ListDistributionsByKeyGroup -> ListDistributionsByKeyGroup -> Bool
$c== :: ListDistributionsByKeyGroup -> ListDistributionsByKeyGroup -> Bool
Prelude.Eq, ReadPrec [ListDistributionsByKeyGroup]
ReadPrec ListDistributionsByKeyGroup
Int -> ReadS ListDistributionsByKeyGroup
ReadS [ListDistributionsByKeyGroup]
(Int -> ReadS ListDistributionsByKeyGroup)
-> ReadS [ListDistributionsByKeyGroup]
-> ReadPrec ListDistributionsByKeyGroup
-> ReadPrec [ListDistributionsByKeyGroup]
-> Read ListDistributionsByKeyGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDistributionsByKeyGroup]
$creadListPrec :: ReadPrec [ListDistributionsByKeyGroup]
readPrec :: ReadPrec ListDistributionsByKeyGroup
$creadPrec :: ReadPrec ListDistributionsByKeyGroup
readList :: ReadS [ListDistributionsByKeyGroup]
$creadList :: ReadS [ListDistributionsByKeyGroup]
readsPrec :: Int -> ReadS ListDistributionsByKeyGroup
$creadsPrec :: Int -> ReadS ListDistributionsByKeyGroup
Prelude.Read, Int -> ListDistributionsByKeyGroup -> ShowS
[ListDistributionsByKeyGroup] -> ShowS
ListDistributionsByKeyGroup -> String
(Int -> ListDistributionsByKeyGroup -> ShowS)
-> (ListDistributionsByKeyGroup -> String)
-> ([ListDistributionsByKeyGroup] -> ShowS)
-> Show ListDistributionsByKeyGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDistributionsByKeyGroup] -> ShowS
$cshowList :: [ListDistributionsByKeyGroup] -> ShowS
show :: ListDistributionsByKeyGroup -> String
$cshow :: ListDistributionsByKeyGroup -> String
showsPrec :: Int -> ListDistributionsByKeyGroup -> ShowS
$cshowsPrec :: Int -> ListDistributionsByKeyGroup -> ShowS
Prelude.Show, (forall x.
ListDistributionsByKeyGroup -> Rep ListDistributionsByKeyGroup x)
-> (forall x.
Rep ListDistributionsByKeyGroup x -> ListDistributionsByKeyGroup)
-> Generic ListDistributionsByKeyGroup
forall x.
Rep ListDistributionsByKeyGroup x -> ListDistributionsByKeyGroup
forall x.
ListDistributionsByKeyGroup -> Rep ListDistributionsByKeyGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDistributionsByKeyGroup x -> ListDistributionsByKeyGroup
$cfrom :: forall x.
ListDistributionsByKeyGroup -> Rep ListDistributionsByKeyGroup x
Prelude.Generic)
newListDistributionsByKeyGroup ::
Prelude.Text ->
ListDistributionsByKeyGroup
newListDistributionsByKeyGroup :: Text -> ListDistributionsByKeyGroup
newListDistributionsByKeyGroup Text
pKeyGroupId_ =
ListDistributionsByKeyGroup' :: Maybe Text -> Maybe Text -> Text -> ListDistributionsByKeyGroup
ListDistributionsByKeyGroup'
{ $sel:marker:ListDistributionsByKeyGroup' :: Maybe Text
marker =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxItems:ListDistributionsByKeyGroup' :: Maybe Text
maxItems = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:keyGroupId:ListDistributionsByKeyGroup' :: Text
keyGroupId = Text
pKeyGroupId_
}
listDistributionsByKeyGroup_marker :: Lens.Lens' ListDistributionsByKeyGroup (Prelude.Maybe Prelude.Text)
listDistributionsByKeyGroup_marker :: (Maybe Text -> f (Maybe Text))
-> ListDistributionsByKeyGroup -> f ListDistributionsByKeyGroup
listDistributionsByKeyGroup_marker = (ListDistributionsByKeyGroup -> Maybe Text)
-> (ListDistributionsByKeyGroup
-> Maybe Text -> ListDistributionsByKeyGroup)
-> Lens
ListDistributionsByKeyGroup
ListDistributionsByKeyGroup
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDistributionsByKeyGroup' {Maybe Text
marker :: Maybe Text
$sel:marker:ListDistributionsByKeyGroup' :: ListDistributionsByKeyGroup -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListDistributionsByKeyGroup
s@ListDistributionsByKeyGroup' {} Maybe Text
a -> ListDistributionsByKeyGroup
s {$sel:marker:ListDistributionsByKeyGroup' :: Maybe Text
marker = Maybe Text
a} :: ListDistributionsByKeyGroup)
listDistributionsByKeyGroup_maxItems :: Lens.Lens' ListDistributionsByKeyGroup (Prelude.Maybe Prelude.Text)
listDistributionsByKeyGroup_maxItems :: (Maybe Text -> f (Maybe Text))
-> ListDistributionsByKeyGroup -> f ListDistributionsByKeyGroup
listDistributionsByKeyGroup_maxItems = (ListDistributionsByKeyGroup -> Maybe Text)
-> (ListDistributionsByKeyGroup
-> Maybe Text -> ListDistributionsByKeyGroup)
-> Lens
ListDistributionsByKeyGroup
ListDistributionsByKeyGroup
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDistributionsByKeyGroup' {Maybe Text
maxItems :: Maybe Text
$sel:maxItems:ListDistributionsByKeyGroup' :: ListDistributionsByKeyGroup -> Maybe Text
maxItems} -> Maybe Text
maxItems) (\s :: ListDistributionsByKeyGroup
s@ListDistributionsByKeyGroup' {} Maybe Text
a -> ListDistributionsByKeyGroup
s {$sel:maxItems:ListDistributionsByKeyGroup' :: Maybe Text
maxItems = Maybe Text
a} :: ListDistributionsByKeyGroup)
listDistributionsByKeyGroup_keyGroupId :: Lens.Lens' ListDistributionsByKeyGroup Prelude.Text
listDistributionsByKeyGroup_keyGroupId :: (Text -> f Text)
-> ListDistributionsByKeyGroup -> f ListDistributionsByKeyGroup
listDistributionsByKeyGroup_keyGroupId = (ListDistributionsByKeyGroup -> Text)
-> (ListDistributionsByKeyGroup
-> Text -> ListDistributionsByKeyGroup)
-> Lens
ListDistributionsByKeyGroup ListDistributionsByKeyGroup Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDistributionsByKeyGroup' {Text
keyGroupId :: Text
$sel:keyGroupId:ListDistributionsByKeyGroup' :: ListDistributionsByKeyGroup -> Text
keyGroupId} -> Text
keyGroupId) (\s :: ListDistributionsByKeyGroup
s@ListDistributionsByKeyGroup' {} Text
a -> ListDistributionsByKeyGroup
s {$sel:keyGroupId:ListDistributionsByKeyGroup' :: Text
keyGroupId = Text
a} :: ListDistributionsByKeyGroup)
instance Core.AWSRequest ListDistributionsByKeyGroup where
type
AWSResponse ListDistributionsByKeyGroup =
ListDistributionsByKeyGroupResponse
request :: ListDistributionsByKeyGroup -> Request ListDistributionsByKeyGroup
request = Service
-> ListDistributionsByKeyGroup
-> Request ListDistributionsByKeyGroup
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy ListDistributionsByKeyGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListDistributionsByKeyGroup)))
response =
(Int
-> ResponseHeaders
-> [Node]
-> Either String (AWSResponse ListDistributionsByKeyGroup))
-> Logger
-> Service
-> Proxy ListDistributionsByKeyGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListDistributionsByKeyGroup)))
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 -> ListDistributionsByKeyGroupResponse
ListDistributionsByKeyGroupResponse'
(Maybe DistributionIdList
-> Int -> ListDistributionsByKeyGroupResponse)
-> Either String (Maybe DistributionIdList)
-> Either String (Int -> ListDistributionsByKeyGroupResponse)
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 -> ListDistributionsByKeyGroupResponse)
-> Either String Int
-> Either String ListDistributionsByKeyGroupResponse
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 ListDistributionsByKeyGroup
instance Prelude.NFData ListDistributionsByKeyGroup
instance Core.ToHeaders ListDistributionsByKeyGroup where
toHeaders :: ListDistributionsByKeyGroup -> ResponseHeaders
toHeaders = ResponseHeaders -> ListDistributionsByKeyGroup -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToPath ListDistributionsByKeyGroup where
toPath :: ListDistributionsByKeyGroup -> ByteString
toPath ListDistributionsByKeyGroup' {Maybe Text
Text
keyGroupId :: Text
maxItems :: Maybe Text
marker :: Maybe Text
$sel:keyGroupId:ListDistributionsByKeyGroup' :: ListDistributionsByKeyGroup -> Text
$sel:maxItems:ListDistributionsByKeyGroup' :: ListDistributionsByKeyGroup -> Maybe Text
$sel:marker:ListDistributionsByKeyGroup' :: ListDistributionsByKeyGroup -> Maybe Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/2020-05-31/distributionsByKeyGroupId/",
Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
keyGroupId
]
instance Core.ToQuery ListDistributionsByKeyGroup where
toQuery :: ListDistributionsByKeyGroup -> QueryString
toQuery ListDistributionsByKeyGroup' {Maybe Text
Text
keyGroupId :: Text
maxItems :: Maybe Text
marker :: Maybe Text
$sel:keyGroupId:ListDistributionsByKeyGroup' :: ListDistributionsByKeyGroup -> Text
$sel:maxItems:ListDistributionsByKeyGroup' :: ListDistributionsByKeyGroup -> Maybe Text
$sel:marker:ListDistributionsByKeyGroup' :: ListDistributionsByKeyGroup -> 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 ListDistributionsByKeyGroupResponse = ListDistributionsByKeyGroupResponse'
{ ListDistributionsByKeyGroupResponse -> Maybe DistributionIdList
distributionIdList :: Prelude.Maybe DistributionIdList,
ListDistributionsByKeyGroupResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListDistributionsByKeyGroupResponse
-> ListDistributionsByKeyGroupResponse -> Bool
(ListDistributionsByKeyGroupResponse
-> ListDistributionsByKeyGroupResponse -> Bool)
-> (ListDistributionsByKeyGroupResponse
-> ListDistributionsByKeyGroupResponse -> Bool)
-> Eq ListDistributionsByKeyGroupResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDistributionsByKeyGroupResponse
-> ListDistributionsByKeyGroupResponse -> Bool
$c/= :: ListDistributionsByKeyGroupResponse
-> ListDistributionsByKeyGroupResponse -> Bool
== :: ListDistributionsByKeyGroupResponse
-> ListDistributionsByKeyGroupResponse -> Bool
$c== :: ListDistributionsByKeyGroupResponse
-> ListDistributionsByKeyGroupResponse -> Bool
Prelude.Eq, ReadPrec [ListDistributionsByKeyGroupResponse]
ReadPrec ListDistributionsByKeyGroupResponse
Int -> ReadS ListDistributionsByKeyGroupResponse
ReadS [ListDistributionsByKeyGroupResponse]
(Int -> ReadS ListDistributionsByKeyGroupResponse)
-> ReadS [ListDistributionsByKeyGroupResponse]
-> ReadPrec ListDistributionsByKeyGroupResponse
-> ReadPrec [ListDistributionsByKeyGroupResponse]
-> Read ListDistributionsByKeyGroupResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDistributionsByKeyGroupResponse]
$creadListPrec :: ReadPrec [ListDistributionsByKeyGroupResponse]
readPrec :: ReadPrec ListDistributionsByKeyGroupResponse
$creadPrec :: ReadPrec ListDistributionsByKeyGroupResponse
readList :: ReadS [ListDistributionsByKeyGroupResponse]
$creadList :: ReadS [ListDistributionsByKeyGroupResponse]
readsPrec :: Int -> ReadS ListDistributionsByKeyGroupResponse
$creadsPrec :: Int -> ReadS ListDistributionsByKeyGroupResponse
Prelude.Read, Int -> ListDistributionsByKeyGroupResponse -> ShowS
[ListDistributionsByKeyGroupResponse] -> ShowS
ListDistributionsByKeyGroupResponse -> String
(Int -> ListDistributionsByKeyGroupResponse -> ShowS)
-> (ListDistributionsByKeyGroupResponse -> String)
-> ([ListDistributionsByKeyGroupResponse] -> ShowS)
-> Show ListDistributionsByKeyGroupResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDistributionsByKeyGroupResponse] -> ShowS
$cshowList :: [ListDistributionsByKeyGroupResponse] -> ShowS
show :: ListDistributionsByKeyGroupResponse -> String
$cshow :: ListDistributionsByKeyGroupResponse -> String
showsPrec :: Int -> ListDistributionsByKeyGroupResponse -> ShowS
$cshowsPrec :: Int -> ListDistributionsByKeyGroupResponse -> ShowS
Prelude.Show, (forall x.
ListDistributionsByKeyGroupResponse
-> Rep ListDistributionsByKeyGroupResponse x)
-> (forall x.
Rep ListDistributionsByKeyGroupResponse x
-> ListDistributionsByKeyGroupResponse)
-> Generic ListDistributionsByKeyGroupResponse
forall x.
Rep ListDistributionsByKeyGroupResponse x
-> ListDistributionsByKeyGroupResponse
forall x.
ListDistributionsByKeyGroupResponse
-> Rep ListDistributionsByKeyGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDistributionsByKeyGroupResponse x
-> ListDistributionsByKeyGroupResponse
$cfrom :: forall x.
ListDistributionsByKeyGroupResponse
-> Rep ListDistributionsByKeyGroupResponse x
Prelude.Generic)
newListDistributionsByKeyGroupResponse ::
Prelude.Int ->
ListDistributionsByKeyGroupResponse
newListDistributionsByKeyGroupResponse :: Int -> ListDistributionsByKeyGroupResponse
newListDistributionsByKeyGroupResponse Int
pHttpStatus_ =
ListDistributionsByKeyGroupResponse' :: Maybe DistributionIdList
-> Int -> ListDistributionsByKeyGroupResponse
ListDistributionsByKeyGroupResponse'
{ $sel:distributionIdList:ListDistributionsByKeyGroupResponse' :: Maybe DistributionIdList
distributionIdList =
Maybe DistributionIdList
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListDistributionsByKeyGroupResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listDistributionsByKeyGroupResponse_distributionIdList :: Lens.Lens' ListDistributionsByKeyGroupResponse (Prelude.Maybe DistributionIdList)
listDistributionsByKeyGroupResponse_distributionIdList :: (Maybe DistributionIdList -> f (Maybe DistributionIdList))
-> ListDistributionsByKeyGroupResponse
-> f ListDistributionsByKeyGroupResponse
listDistributionsByKeyGroupResponse_distributionIdList = (ListDistributionsByKeyGroupResponse -> Maybe DistributionIdList)
-> (ListDistributionsByKeyGroupResponse
-> Maybe DistributionIdList -> ListDistributionsByKeyGroupResponse)
-> Lens
ListDistributionsByKeyGroupResponse
ListDistributionsByKeyGroupResponse
(Maybe DistributionIdList)
(Maybe DistributionIdList)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDistributionsByKeyGroupResponse' {Maybe DistributionIdList
distributionIdList :: Maybe DistributionIdList
$sel:distributionIdList:ListDistributionsByKeyGroupResponse' :: ListDistributionsByKeyGroupResponse -> Maybe DistributionIdList
distributionIdList} -> Maybe DistributionIdList
distributionIdList) (\s :: ListDistributionsByKeyGroupResponse
s@ListDistributionsByKeyGroupResponse' {} Maybe DistributionIdList
a -> ListDistributionsByKeyGroupResponse
s {$sel:distributionIdList:ListDistributionsByKeyGroupResponse' :: Maybe DistributionIdList
distributionIdList = Maybe DistributionIdList
a} :: ListDistributionsByKeyGroupResponse)
listDistributionsByKeyGroupResponse_httpStatus :: Lens.Lens' ListDistributionsByKeyGroupResponse Prelude.Int
listDistributionsByKeyGroupResponse_httpStatus :: (Int -> f Int)
-> ListDistributionsByKeyGroupResponse
-> f ListDistributionsByKeyGroupResponse
listDistributionsByKeyGroupResponse_httpStatus = (ListDistributionsByKeyGroupResponse -> Int)
-> (ListDistributionsByKeyGroupResponse
-> Int -> ListDistributionsByKeyGroupResponse)
-> Lens
ListDistributionsByKeyGroupResponse
ListDistributionsByKeyGroupResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDistributionsByKeyGroupResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListDistributionsByKeyGroupResponse' :: ListDistributionsByKeyGroupResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListDistributionsByKeyGroupResponse
s@ListDistributionsByKeyGroupResponse' {} Int
a -> ListDistributionsByKeyGroupResponse
s {$sel:httpStatus:ListDistributionsByKeyGroupResponse' :: Int
httpStatus = Int
a} :: ListDistributionsByKeyGroupResponse)
instance
Prelude.NFData
ListDistributionsByKeyGroupResponse