{-# 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.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 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
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]
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
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.
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'
{ $sel:marker:ListDistributionsByKeyGroup' :: Maybe Text
marker =
forall a. Maybe a
Prelude.Nothing,
$sel:maxItems:ListDistributionsByKeyGroup' :: Maybe Text
maxItems = forall a. Maybe a
Prelude.Nothing,
$sel:keyGroupId:ListDistributionsByKeyGroup' :: Text
keyGroupId = Text
pKeyGroupId_
}
listDistributionsByKeyGroup_marker :: Lens.Lens' ListDistributionsByKeyGroup (Prelude.Maybe Prelude.Text)
listDistributionsByKeyGroup_marker :: Lens' ListDistributionsByKeyGroup (Maybe Text)
listDistributionsByKeyGroup_marker = 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 :: Lens' ListDistributionsByKeyGroup (Maybe Text)
listDistributionsByKeyGroup_maxItems = 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 :: Lens' ListDistributionsByKeyGroup Text
listDistributionsByKeyGroup_keyGroupId = 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 :: (Service -> Service)
-> ListDistributionsByKeyGroup
-> Request ListDistributionsByKeyGroup
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 ListDistributionsByKeyGroup
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListDistributionsByKeyGroup)))
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 DistributionIdList
-> Int -> ListDistributionsByKeyGroupResponse
ListDistributionsByKeyGroupResponse'
forall (f :: * -> *) a b. Functor 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 ListDistributionsByKeyGroup where
hashWithSalt :: Int -> ListDistributionsByKeyGroup -> Int
hashWithSalt Int
_salt 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
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
marker
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
maxItems
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
keyGroupId
instance Prelude.NFData ListDistributionsByKeyGroup where
rnf :: ListDistributionsByKeyGroup -> ()
rnf 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
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
marker
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
maxItems
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
keyGroupId
instance Data.ToHeaders ListDistributionsByKeyGroup where
toHeaders :: ListDistributionsByKeyGroup -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance Data.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
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"/2020-05-31/distributionsByKeyGroupId/",
forall a. ToByteString a => a -> ByteString
Data.toBS Text
keyGroupId
]
instance Data.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
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"Marker" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
marker,
ByteString
"MaxItems" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
maxItems
]
data ListDistributionsByKeyGroupResponse = ListDistributionsByKeyGroupResponse'
{ ListDistributionsByKeyGroupResponse -> Maybe DistributionIdList
distributionIdList :: Prelude.Maybe DistributionIdList,
ListDistributionsByKeyGroupResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListDistributionsByKeyGroupResponse
-> ListDistributionsByKeyGroupResponse -> Bool
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]
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
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.
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'
{ $sel:distributionIdList:ListDistributionsByKeyGroupResponse' :: Maybe DistributionIdList
distributionIdList =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListDistributionsByKeyGroupResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listDistributionsByKeyGroupResponse_distributionIdList :: Lens.Lens' ListDistributionsByKeyGroupResponse (Prelude.Maybe DistributionIdList)
listDistributionsByKeyGroupResponse_distributionIdList :: Lens'
ListDistributionsByKeyGroupResponse (Maybe DistributionIdList)
listDistributionsByKeyGroupResponse_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 :: Lens' ListDistributionsByKeyGroupResponse Int
listDistributionsByKeyGroupResponse_httpStatus = 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
where
rnf :: ListDistributionsByKeyGroupResponse -> ()
rnf ListDistributionsByKeyGroupResponse' {Int
Maybe DistributionIdList
httpStatus :: Int
distributionIdList :: Maybe DistributionIdList
$sel:httpStatus:ListDistributionsByKeyGroupResponse' :: ListDistributionsByKeyGroupResponse -> Int
$sel:distributionIdList:ListDistributionsByKeyGroupResponse' :: ListDistributionsByKeyGroupResponse -> Maybe DistributionIdList
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe DistributionIdList
distributionIdList
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus