{-# 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.Synthetics.ListAssociatedGroups
(
ListAssociatedGroups (..),
newListAssociatedGroups,
listAssociatedGroups_maxResults,
listAssociatedGroups_nextToken,
listAssociatedGroups_resourceArn,
ListAssociatedGroupsResponse (..),
newListAssociatedGroupsResponse,
listAssociatedGroupsResponse_groups,
listAssociatedGroupsResponse_nextToken,
listAssociatedGroupsResponse_httpStatus,
)
where
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
import Amazonka.Synthetics.Types
data ListAssociatedGroups = ListAssociatedGroups'
{
ListAssociatedGroups -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListAssociatedGroups -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListAssociatedGroups -> Text
resourceArn :: Prelude.Text
}
deriving (ListAssociatedGroups -> ListAssociatedGroups -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAssociatedGroups -> ListAssociatedGroups -> Bool
$c/= :: ListAssociatedGroups -> ListAssociatedGroups -> Bool
== :: ListAssociatedGroups -> ListAssociatedGroups -> Bool
$c== :: ListAssociatedGroups -> ListAssociatedGroups -> Bool
Prelude.Eq, ReadPrec [ListAssociatedGroups]
ReadPrec ListAssociatedGroups
Int -> ReadS ListAssociatedGroups
ReadS [ListAssociatedGroups]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAssociatedGroups]
$creadListPrec :: ReadPrec [ListAssociatedGroups]
readPrec :: ReadPrec ListAssociatedGroups
$creadPrec :: ReadPrec ListAssociatedGroups
readList :: ReadS [ListAssociatedGroups]
$creadList :: ReadS [ListAssociatedGroups]
readsPrec :: Int -> ReadS ListAssociatedGroups
$creadsPrec :: Int -> ReadS ListAssociatedGroups
Prelude.Read, Int -> ListAssociatedGroups -> ShowS
[ListAssociatedGroups] -> ShowS
ListAssociatedGroups -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAssociatedGroups] -> ShowS
$cshowList :: [ListAssociatedGroups] -> ShowS
show :: ListAssociatedGroups -> String
$cshow :: ListAssociatedGroups -> String
showsPrec :: Int -> ListAssociatedGroups -> ShowS
$cshowsPrec :: Int -> ListAssociatedGroups -> ShowS
Prelude.Show, forall x. Rep ListAssociatedGroups x -> ListAssociatedGroups
forall x. ListAssociatedGroups -> Rep ListAssociatedGroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAssociatedGroups x -> ListAssociatedGroups
$cfrom :: forall x. ListAssociatedGroups -> Rep ListAssociatedGroups x
Prelude.Generic)
newListAssociatedGroups ::
Prelude.Text ->
ListAssociatedGroups
newListAssociatedGroups :: Text -> ListAssociatedGroups
newListAssociatedGroups Text
pResourceArn_ =
ListAssociatedGroups'
{ $sel:maxResults:ListAssociatedGroups' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListAssociatedGroups' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:resourceArn:ListAssociatedGroups' :: Text
resourceArn = Text
pResourceArn_
}
listAssociatedGroups_maxResults :: Lens.Lens' ListAssociatedGroups (Prelude.Maybe Prelude.Natural)
listAssociatedGroups_maxResults :: Lens' ListAssociatedGroups (Maybe Natural)
listAssociatedGroups_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociatedGroups' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListAssociatedGroups' :: ListAssociatedGroups -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListAssociatedGroups
s@ListAssociatedGroups' {} Maybe Natural
a -> ListAssociatedGroups
s {$sel:maxResults:ListAssociatedGroups' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListAssociatedGroups)
listAssociatedGroups_nextToken :: Lens.Lens' ListAssociatedGroups (Prelude.Maybe Prelude.Text)
listAssociatedGroups_nextToken :: Lens' ListAssociatedGroups (Maybe Text)
listAssociatedGroups_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociatedGroups' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAssociatedGroups' :: ListAssociatedGroups -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAssociatedGroups
s@ListAssociatedGroups' {} Maybe Text
a -> ListAssociatedGroups
s {$sel:nextToken:ListAssociatedGroups' :: Maybe Text
nextToken = Maybe Text
a} :: ListAssociatedGroups)
listAssociatedGroups_resourceArn :: Lens.Lens' ListAssociatedGroups Prelude.Text
listAssociatedGroups_resourceArn :: Lens' ListAssociatedGroups Text
listAssociatedGroups_resourceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociatedGroups' {Text
resourceArn :: Text
$sel:resourceArn:ListAssociatedGroups' :: ListAssociatedGroups -> Text
resourceArn} -> Text
resourceArn) (\s :: ListAssociatedGroups
s@ListAssociatedGroups' {} Text
a -> ListAssociatedGroups
s {$sel:resourceArn:ListAssociatedGroups' :: Text
resourceArn = Text
a} :: ListAssociatedGroups)
instance Core.AWSRequest ListAssociatedGroups where
type
AWSResponse ListAssociatedGroups =
ListAssociatedGroupsResponse
request :: (Service -> Service)
-> ListAssociatedGroups -> Request ListAssociatedGroups
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListAssociatedGroups
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListAssociatedGroups)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe [GroupSummary]
-> Maybe Text -> Int -> ListAssociatedGroupsResponse
ListAssociatedGroupsResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Groups" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
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 ListAssociatedGroups where
hashWithSalt :: Int -> ListAssociatedGroups -> Int
hashWithSalt Int
_salt ListAssociatedGroups' {Maybe Natural
Maybe Text
Text
resourceArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:resourceArn:ListAssociatedGroups' :: ListAssociatedGroups -> Text
$sel:nextToken:ListAssociatedGroups' :: ListAssociatedGroups -> Maybe Text
$sel:maxResults:ListAssociatedGroups' :: ListAssociatedGroups -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceArn
instance Prelude.NFData ListAssociatedGroups where
rnf :: ListAssociatedGroups -> ()
rnf ListAssociatedGroups' {Maybe Natural
Maybe Text
Text
resourceArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:resourceArn:ListAssociatedGroups' :: ListAssociatedGroups -> Text
$sel:nextToken:ListAssociatedGroups' :: ListAssociatedGroups -> Maybe Text
$sel:maxResults:ListAssociatedGroups' :: ListAssociatedGroups -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
resourceArn
instance Data.ToHeaders ListAssociatedGroups where
toHeaders :: ListAssociatedGroups -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON ListAssociatedGroups where
toJSON :: ListAssociatedGroups -> Value
toJSON ListAssociatedGroups' {Maybe Natural
Maybe Text
Text
resourceArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:resourceArn:ListAssociatedGroups' :: ListAssociatedGroups -> Text
$sel:nextToken:ListAssociatedGroups' :: ListAssociatedGroups -> Maybe Text
$sel:maxResults:ListAssociatedGroups' :: ListAssociatedGroups -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
(Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken
]
)
instance Data.ToPath ListAssociatedGroups where
toPath :: ListAssociatedGroups -> ByteString
toPath ListAssociatedGroups' {Maybe Natural
Maybe Text
Text
resourceArn :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:resourceArn:ListAssociatedGroups' :: ListAssociatedGroups -> Text
$sel:nextToken:ListAssociatedGroups' :: ListAssociatedGroups -> Maybe Text
$sel:maxResults:ListAssociatedGroups' :: ListAssociatedGroups -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/resource/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
resourceArn, ByteString
"/groups"]
instance Data.ToQuery ListAssociatedGroups where
toQuery :: ListAssociatedGroups -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListAssociatedGroupsResponse = ListAssociatedGroupsResponse'
{
ListAssociatedGroupsResponse -> Maybe [GroupSummary]
groups :: Prelude.Maybe [GroupSummary],
ListAssociatedGroupsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListAssociatedGroupsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListAssociatedGroupsResponse
-> ListAssociatedGroupsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAssociatedGroupsResponse
-> ListAssociatedGroupsResponse -> Bool
$c/= :: ListAssociatedGroupsResponse
-> ListAssociatedGroupsResponse -> Bool
== :: ListAssociatedGroupsResponse
-> ListAssociatedGroupsResponse -> Bool
$c== :: ListAssociatedGroupsResponse
-> ListAssociatedGroupsResponse -> Bool
Prelude.Eq, ReadPrec [ListAssociatedGroupsResponse]
ReadPrec ListAssociatedGroupsResponse
Int -> ReadS ListAssociatedGroupsResponse
ReadS [ListAssociatedGroupsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAssociatedGroupsResponse]
$creadListPrec :: ReadPrec [ListAssociatedGroupsResponse]
readPrec :: ReadPrec ListAssociatedGroupsResponse
$creadPrec :: ReadPrec ListAssociatedGroupsResponse
readList :: ReadS [ListAssociatedGroupsResponse]
$creadList :: ReadS [ListAssociatedGroupsResponse]
readsPrec :: Int -> ReadS ListAssociatedGroupsResponse
$creadsPrec :: Int -> ReadS ListAssociatedGroupsResponse
Prelude.Read, Int -> ListAssociatedGroupsResponse -> ShowS
[ListAssociatedGroupsResponse] -> ShowS
ListAssociatedGroupsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAssociatedGroupsResponse] -> ShowS
$cshowList :: [ListAssociatedGroupsResponse] -> ShowS
show :: ListAssociatedGroupsResponse -> String
$cshow :: ListAssociatedGroupsResponse -> String
showsPrec :: Int -> ListAssociatedGroupsResponse -> ShowS
$cshowsPrec :: Int -> ListAssociatedGroupsResponse -> ShowS
Prelude.Show, forall x.
Rep ListAssociatedGroupsResponse x -> ListAssociatedGroupsResponse
forall x.
ListAssociatedGroupsResponse -> Rep ListAssociatedGroupsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListAssociatedGroupsResponse x -> ListAssociatedGroupsResponse
$cfrom :: forall x.
ListAssociatedGroupsResponse -> Rep ListAssociatedGroupsResponse x
Prelude.Generic)
newListAssociatedGroupsResponse ::
Prelude.Int ->
ListAssociatedGroupsResponse
newListAssociatedGroupsResponse :: Int -> ListAssociatedGroupsResponse
newListAssociatedGroupsResponse Int
pHttpStatus_ =
ListAssociatedGroupsResponse'
{ $sel:groups:ListAssociatedGroupsResponse' :: Maybe [GroupSummary]
groups =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListAssociatedGroupsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListAssociatedGroupsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listAssociatedGroupsResponse_groups :: Lens.Lens' ListAssociatedGroupsResponse (Prelude.Maybe [GroupSummary])
listAssociatedGroupsResponse_groups :: Lens' ListAssociatedGroupsResponse (Maybe [GroupSummary])
listAssociatedGroupsResponse_groups = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociatedGroupsResponse' {Maybe [GroupSummary]
groups :: Maybe [GroupSummary]
$sel:groups:ListAssociatedGroupsResponse' :: ListAssociatedGroupsResponse -> Maybe [GroupSummary]
groups} -> Maybe [GroupSummary]
groups) (\s :: ListAssociatedGroupsResponse
s@ListAssociatedGroupsResponse' {} Maybe [GroupSummary]
a -> ListAssociatedGroupsResponse
s {$sel:groups:ListAssociatedGroupsResponse' :: Maybe [GroupSummary]
groups = Maybe [GroupSummary]
a} :: ListAssociatedGroupsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listAssociatedGroupsResponse_nextToken :: Lens.Lens' ListAssociatedGroupsResponse (Prelude.Maybe Prelude.Text)
listAssociatedGroupsResponse_nextToken :: Lens' ListAssociatedGroupsResponse (Maybe Text)
listAssociatedGroupsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociatedGroupsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListAssociatedGroupsResponse' :: ListAssociatedGroupsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListAssociatedGroupsResponse
s@ListAssociatedGroupsResponse' {} Maybe Text
a -> ListAssociatedGroupsResponse
s {$sel:nextToken:ListAssociatedGroupsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListAssociatedGroupsResponse)
listAssociatedGroupsResponse_httpStatus :: Lens.Lens' ListAssociatedGroupsResponse Prelude.Int
listAssociatedGroupsResponse_httpStatus :: Lens' ListAssociatedGroupsResponse Int
listAssociatedGroupsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAssociatedGroupsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListAssociatedGroupsResponse' :: ListAssociatedGroupsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListAssociatedGroupsResponse
s@ListAssociatedGroupsResponse' {} Int
a -> ListAssociatedGroupsResponse
s {$sel:httpStatus:ListAssociatedGroupsResponse' :: Int
httpStatus = Int
a} :: ListAssociatedGroupsResponse)
instance Prelude.NFData ListAssociatedGroupsResponse where
rnf :: ListAssociatedGroupsResponse -> ()
rnf ListAssociatedGroupsResponse' {Int
Maybe [GroupSummary]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
groups :: Maybe [GroupSummary]
$sel:httpStatus:ListAssociatedGroupsResponse' :: ListAssociatedGroupsResponse -> Int
$sel:nextToken:ListAssociatedGroupsResponse' :: ListAssociatedGroupsResponse -> Maybe Text
$sel:groups:ListAssociatedGroupsResponse' :: ListAssociatedGroupsResponse -> Maybe [GroupSummary]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [GroupSummary]
groups
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus