{-# 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.ResourceGroups.ListGroupResources
(
ListGroupResources (..),
newListGroupResources,
listGroupResources_group,
listGroupResources_filters,
listGroupResources_nextToken,
listGroupResources_groupName,
listGroupResources_maxResults,
ListGroupResourcesResponse (..),
newListGroupResourcesResponse,
listGroupResourcesResponse_resources,
listGroupResourcesResponse_queryErrors,
listGroupResourcesResponse_nextToken,
listGroupResourcesResponse_resourceIdentifiers,
listGroupResourcesResponse_httpStatus,
)
where
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 Amazonka.ResourceGroups.Types
import qualified Amazonka.Response as Response
data ListGroupResources = ListGroupResources'
{
ListGroupResources -> Maybe Text
group' :: Prelude.Maybe Prelude.Text,
ListGroupResources -> Maybe [ResourceFilter]
filters :: Prelude.Maybe [ResourceFilter],
ListGroupResources -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListGroupResources -> Maybe Text
groupName :: Prelude.Maybe Prelude.Text,
ListGroupResources -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
}
deriving (ListGroupResources -> ListGroupResources -> Bool
(ListGroupResources -> ListGroupResources -> Bool)
-> (ListGroupResources -> ListGroupResources -> Bool)
-> Eq ListGroupResources
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListGroupResources -> ListGroupResources -> Bool
$c/= :: ListGroupResources -> ListGroupResources -> Bool
== :: ListGroupResources -> ListGroupResources -> Bool
$c== :: ListGroupResources -> ListGroupResources -> Bool
Prelude.Eq, ReadPrec [ListGroupResources]
ReadPrec ListGroupResources
Int -> ReadS ListGroupResources
ReadS [ListGroupResources]
(Int -> ReadS ListGroupResources)
-> ReadS [ListGroupResources]
-> ReadPrec ListGroupResources
-> ReadPrec [ListGroupResources]
-> Read ListGroupResources
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListGroupResources]
$creadListPrec :: ReadPrec [ListGroupResources]
readPrec :: ReadPrec ListGroupResources
$creadPrec :: ReadPrec ListGroupResources
readList :: ReadS [ListGroupResources]
$creadList :: ReadS [ListGroupResources]
readsPrec :: Int -> ReadS ListGroupResources
$creadsPrec :: Int -> ReadS ListGroupResources
Prelude.Read, Int -> ListGroupResources -> ShowS
[ListGroupResources] -> ShowS
ListGroupResources -> String
(Int -> ListGroupResources -> ShowS)
-> (ListGroupResources -> String)
-> ([ListGroupResources] -> ShowS)
-> Show ListGroupResources
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListGroupResources] -> ShowS
$cshowList :: [ListGroupResources] -> ShowS
show :: ListGroupResources -> String
$cshow :: ListGroupResources -> String
showsPrec :: Int -> ListGroupResources -> ShowS
$cshowsPrec :: Int -> ListGroupResources -> ShowS
Prelude.Show, (forall x. ListGroupResources -> Rep ListGroupResources x)
-> (forall x. Rep ListGroupResources x -> ListGroupResources)
-> Generic ListGroupResources
forall x. Rep ListGroupResources x -> ListGroupResources
forall x. ListGroupResources -> Rep ListGroupResources x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListGroupResources x -> ListGroupResources
$cfrom :: forall x. ListGroupResources -> Rep ListGroupResources x
Prelude.Generic)
newListGroupResources ::
ListGroupResources
newListGroupResources :: ListGroupResources
newListGroupResources =
ListGroupResources' :: Maybe Text
-> Maybe [ResourceFilter]
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> ListGroupResources
ListGroupResources'
{ $sel:group':ListGroupResources' :: Maybe Text
group' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:filters:ListGroupResources' :: Maybe [ResourceFilter]
filters = Maybe [ResourceFilter]
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListGroupResources' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:groupName:ListGroupResources' :: Maybe Text
groupName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListGroupResources' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
listGroupResources_group :: Lens.Lens' ListGroupResources (Prelude.Maybe Prelude.Text)
listGroupResources_group :: (Maybe Text -> f (Maybe Text))
-> ListGroupResources -> f ListGroupResources
listGroupResources_group = (ListGroupResources -> Maybe Text)
-> (ListGroupResources -> Maybe Text -> ListGroupResources)
-> Lens
ListGroupResources ListGroupResources (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroupResources' {Maybe Text
group' :: Maybe Text
$sel:group':ListGroupResources' :: ListGroupResources -> Maybe Text
group'} -> Maybe Text
group') (\s :: ListGroupResources
s@ListGroupResources' {} Maybe Text
a -> ListGroupResources
s {$sel:group':ListGroupResources' :: Maybe Text
group' = Maybe Text
a} :: ListGroupResources)
listGroupResources_filters :: Lens.Lens' ListGroupResources (Prelude.Maybe [ResourceFilter])
listGroupResources_filters :: (Maybe [ResourceFilter] -> f (Maybe [ResourceFilter]))
-> ListGroupResources -> f ListGroupResources
listGroupResources_filters = (ListGroupResources -> Maybe [ResourceFilter])
-> (ListGroupResources
-> Maybe [ResourceFilter] -> ListGroupResources)
-> Lens
ListGroupResources
ListGroupResources
(Maybe [ResourceFilter])
(Maybe [ResourceFilter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroupResources' {Maybe [ResourceFilter]
filters :: Maybe [ResourceFilter]
$sel:filters:ListGroupResources' :: ListGroupResources -> Maybe [ResourceFilter]
filters} -> Maybe [ResourceFilter]
filters) (\s :: ListGroupResources
s@ListGroupResources' {} Maybe [ResourceFilter]
a -> ListGroupResources
s {$sel:filters:ListGroupResources' :: Maybe [ResourceFilter]
filters = Maybe [ResourceFilter]
a} :: ListGroupResources) ((Maybe [ResourceFilter] -> f (Maybe [ResourceFilter]))
-> ListGroupResources -> f ListGroupResources)
-> ((Maybe [ResourceFilter] -> f (Maybe [ResourceFilter]))
-> Maybe [ResourceFilter] -> f (Maybe [ResourceFilter]))
-> (Maybe [ResourceFilter] -> f (Maybe [ResourceFilter]))
-> ListGroupResources
-> f ListGroupResources
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ResourceFilter] [ResourceFilter] [ResourceFilter] [ResourceFilter]
-> Iso
(Maybe [ResourceFilter])
(Maybe [ResourceFilter])
(Maybe [ResourceFilter])
(Maybe [ResourceFilter])
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 AnIso
[ResourceFilter] [ResourceFilter] [ResourceFilter] [ResourceFilter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listGroupResources_nextToken :: Lens.Lens' ListGroupResources (Prelude.Maybe Prelude.Text)
listGroupResources_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListGroupResources -> f ListGroupResources
listGroupResources_nextToken = (ListGroupResources -> Maybe Text)
-> (ListGroupResources -> Maybe Text -> ListGroupResources)
-> Lens
ListGroupResources ListGroupResources (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroupResources' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListGroupResources' :: ListGroupResources -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListGroupResources
s@ListGroupResources' {} Maybe Text
a -> ListGroupResources
s {$sel:nextToken:ListGroupResources' :: Maybe Text
nextToken = Maybe Text
a} :: ListGroupResources)
listGroupResources_groupName :: Lens.Lens' ListGroupResources (Prelude.Maybe Prelude.Text)
listGroupResources_groupName :: (Maybe Text -> f (Maybe Text))
-> ListGroupResources -> f ListGroupResources
listGroupResources_groupName = (ListGroupResources -> Maybe Text)
-> (ListGroupResources -> Maybe Text -> ListGroupResources)
-> Lens
ListGroupResources ListGroupResources (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroupResources' {Maybe Text
groupName :: Maybe Text
$sel:groupName:ListGroupResources' :: ListGroupResources -> Maybe Text
groupName} -> Maybe Text
groupName) (\s :: ListGroupResources
s@ListGroupResources' {} Maybe Text
a -> ListGroupResources
s {$sel:groupName:ListGroupResources' :: Maybe Text
groupName = Maybe Text
a} :: ListGroupResources)
listGroupResources_maxResults :: Lens.Lens' ListGroupResources (Prelude.Maybe Prelude.Natural)
listGroupResources_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListGroupResources -> f ListGroupResources
listGroupResources_maxResults = (ListGroupResources -> Maybe Natural)
-> (ListGroupResources -> Maybe Natural -> ListGroupResources)
-> Lens
ListGroupResources
ListGroupResources
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroupResources' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListGroupResources' :: ListGroupResources -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListGroupResources
s@ListGroupResources' {} Maybe Natural
a -> ListGroupResources
s {$sel:maxResults:ListGroupResources' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListGroupResources)
instance Core.AWSPager ListGroupResources where
page :: ListGroupResources
-> AWSResponse ListGroupResources -> Maybe ListGroupResources
page ListGroupResources
rq AWSResponse ListGroupResources
rs
| Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListGroupResources
ListGroupResourcesResponse
rs
ListGroupResourcesResponse
-> Getting (First Text) ListGroupResourcesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListGroupResourcesResponse
-> Const (First Text) ListGroupResourcesResponse
Lens' ListGroupResourcesResponse (Maybe Text)
listGroupResourcesResponse_nextToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> ListGroupResourcesResponse
-> Const (First Text) ListGroupResourcesResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListGroupResourcesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe ListGroupResources
forall a. Maybe a
Prelude.Nothing
| Maybe [ResourceIdentifier] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListGroupResources
ListGroupResourcesResponse
rs
ListGroupResourcesResponse
-> Getting
(First [ResourceIdentifier])
ListGroupResourcesResponse
[ResourceIdentifier]
-> Maybe [ResourceIdentifier]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ResourceIdentifier]
-> Const (First [ResourceIdentifier]) (Maybe [ResourceIdentifier]))
-> ListGroupResourcesResponse
-> Const (First [ResourceIdentifier]) ListGroupResourcesResponse
Lens' ListGroupResourcesResponse (Maybe [ResourceIdentifier])
listGroupResourcesResponse_resourceIdentifiers
((Maybe [ResourceIdentifier]
-> Const (First [ResourceIdentifier]) (Maybe [ResourceIdentifier]))
-> ListGroupResourcesResponse
-> Const (First [ResourceIdentifier]) ListGroupResourcesResponse)
-> (([ResourceIdentifier]
-> Const (First [ResourceIdentifier]) [ResourceIdentifier])
-> Maybe [ResourceIdentifier]
-> Const (First [ResourceIdentifier]) (Maybe [ResourceIdentifier]))
-> Getting
(First [ResourceIdentifier])
ListGroupResourcesResponse
[ResourceIdentifier]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ResourceIdentifier]
-> Const (First [ResourceIdentifier]) [ResourceIdentifier])
-> Maybe [ResourceIdentifier]
-> Const (First [ResourceIdentifier]) (Maybe [ResourceIdentifier])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe ListGroupResources
forall a. Maybe a
Prelude.Nothing
| Maybe [ListGroupResourcesItem] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListGroupResources
ListGroupResourcesResponse
rs
ListGroupResourcesResponse
-> Getting
(First [ListGroupResourcesItem])
ListGroupResourcesResponse
[ListGroupResourcesItem]
-> Maybe [ListGroupResourcesItem]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ListGroupResourcesItem]
-> Const
(First [ListGroupResourcesItem]) (Maybe [ListGroupResourcesItem]))
-> ListGroupResourcesResponse
-> Const
(First [ListGroupResourcesItem]) ListGroupResourcesResponse
Lens' ListGroupResourcesResponse (Maybe [ListGroupResourcesItem])
listGroupResourcesResponse_resources
((Maybe [ListGroupResourcesItem]
-> Const
(First [ListGroupResourcesItem]) (Maybe [ListGroupResourcesItem]))
-> ListGroupResourcesResponse
-> Const
(First [ListGroupResourcesItem]) ListGroupResourcesResponse)
-> (([ListGroupResourcesItem]
-> Const (First [ListGroupResourcesItem]) [ListGroupResourcesItem])
-> Maybe [ListGroupResourcesItem]
-> Const
(First [ListGroupResourcesItem]) (Maybe [ListGroupResourcesItem]))
-> Getting
(First [ListGroupResourcesItem])
ListGroupResourcesResponse
[ListGroupResourcesItem]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ListGroupResourcesItem]
-> Const (First [ListGroupResourcesItem]) [ListGroupResourcesItem])
-> Maybe [ListGroupResourcesItem]
-> Const
(First [ListGroupResourcesItem]) (Maybe [ListGroupResourcesItem])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe ListGroupResources
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
ListGroupResources -> Maybe ListGroupResources
forall a. a -> Maybe a
Prelude.Just (ListGroupResources -> Maybe ListGroupResources)
-> ListGroupResources -> Maybe ListGroupResources
forall a b. (a -> b) -> a -> b
Prelude.$
ListGroupResources
rq
ListGroupResources
-> (ListGroupResources -> ListGroupResources) -> ListGroupResources
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListGroupResources -> Identity ListGroupResources
Lens
ListGroupResources ListGroupResources (Maybe Text) (Maybe Text)
listGroupResources_nextToken
((Maybe Text -> Identity (Maybe Text))
-> ListGroupResources -> Identity ListGroupResources)
-> Maybe Text -> ListGroupResources -> ListGroupResources
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListGroupResources
ListGroupResourcesResponse
rs
ListGroupResourcesResponse
-> Getting (First Text) ListGroupResourcesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListGroupResourcesResponse
-> Const (First Text) ListGroupResourcesResponse
Lens' ListGroupResourcesResponse (Maybe Text)
listGroupResourcesResponse_nextToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> ListGroupResourcesResponse
-> Const (First Text) ListGroupResourcesResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListGroupResourcesResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
instance Core.AWSRequest ListGroupResources where
type
AWSResponse ListGroupResources =
ListGroupResourcesResponse
request :: ListGroupResources -> Request ListGroupResources
request = Service -> ListGroupResources -> Request ListGroupResources
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy ListGroupResources
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListGroupResources)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListGroupResources))
-> Logger
-> Service
-> Proxy ListGroupResources
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListGroupResources)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe [ListGroupResourcesItem]
-> Maybe [QueryError]
-> Maybe Text
-> Maybe [ResourceIdentifier]
-> Int
-> ListGroupResourcesResponse
ListGroupResourcesResponse'
(Maybe [ListGroupResourcesItem]
-> Maybe [QueryError]
-> Maybe Text
-> Maybe [ResourceIdentifier]
-> Int
-> ListGroupResourcesResponse)
-> Either String (Maybe [ListGroupResourcesItem])
-> Either
String
(Maybe [QueryError]
-> Maybe Text
-> Maybe [ResourceIdentifier]
-> Int
-> ListGroupResourcesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text -> Either String (Maybe (Maybe [ListGroupResourcesItem]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Resources" Either String (Maybe (Maybe [ListGroupResourcesItem]))
-> Maybe [ListGroupResourcesItem]
-> Either String (Maybe [ListGroupResourcesItem])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ListGroupResourcesItem]
forall a. Monoid a => a
Prelude.mempty)
Either
String
(Maybe [QueryError]
-> Maybe Text
-> Maybe [ResourceIdentifier]
-> Int
-> ListGroupResourcesResponse)
-> Either String (Maybe [QueryError])
-> Either
String
(Maybe Text
-> Maybe [ResourceIdentifier] -> Int -> ListGroupResourcesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [QueryError]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"QueryErrors" Either String (Maybe (Maybe [QueryError]))
-> Maybe [QueryError] -> Either String (Maybe [QueryError])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [QueryError]
forall a. Monoid a => a
Prelude.mempty)
Either
String
(Maybe Text
-> Maybe [ResourceIdentifier] -> Int -> ListGroupResourcesResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe [ResourceIdentifier] -> Int -> ListGroupResourcesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"NextToken")
Either
String
(Maybe [ResourceIdentifier] -> Int -> ListGroupResourcesResponse)
-> Either String (Maybe [ResourceIdentifier])
-> Either String (Int -> ListGroupResourcesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [ResourceIdentifier]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ResourceIdentifiers"
Either String (Maybe (Maybe [ResourceIdentifier]))
-> Maybe [ResourceIdentifier]
-> Either String (Maybe [ResourceIdentifier])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ResourceIdentifier]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Int -> ListGroupResourcesResponse)
-> Either String Int -> Either String ListGroupResourcesResponse
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 ListGroupResources
instance Prelude.NFData ListGroupResources
instance Core.ToHeaders ListGroupResources where
toHeaders :: ListGroupResources -> ResponseHeaders
toHeaders = ResponseHeaders -> ListGroupResources -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON ListGroupResources where
toJSON :: ListGroupResources -> Value
toJSON ListGroupResources' {Maybe Natural
Maybe [ResourceFilter]
Maybe Text
maxResults :: Maybe Natural
groupName :: Maybe Text
nextToken :: Maybe Text
filters :: Maybe [ResourceFilter]
group' :: Maybe Text
$sel:maxResults:ListGroupResources' :: ListGroupResources -> Maybe Natural
$sel:groupName:ListGroupResources' :: ListGroupResources -> Maybe Text
$sel:nextToken:ListGroupResources' :: ListGroupResources -> Maybe Text
$sel:filters:ListGroupResources' :: ListGroupResources -> Maybe [ResourceFilter]
$sel:group':ListGroupResources' :: ListGroupResources -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Group" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
group',
(Text
"Filters" Text -> [ResourceFilter] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([ResourceFilter] -> Pair) -> Maybe [ResourceFilter] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ResourceFilter]
filters,
(Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
(Text
"GroupName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
groupName,
(Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults
]
)
instance Core.ToPath ListGroupResources where
toPath :: ListGroupResources -> ByteString
toPath = ByteString -> ListGroupResources -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/list-group-resources"
instance Core.ToQuery ListGroupResources where
toQuery :: ListGroupResources -> QueryString
toQuery = QueryString -> ListGroupResources -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data ListGroupResourcesResponse = ListGroupResourcesResponse'
{
ListGroupResourcesResponse -> Maybe [ListGroupResourcesItem]
resources :: Prelude.Maybe [ListGroupResourcesItem],
ListGroupResourcesResponse -> Maybe [QueryError]
queryErrors :: Prelude.Maybe [QueryError],
ListGroupResourcesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListGroupResourcesResponse -> Maybe [ResourceIdentifier]
resourceIdentifiers :: Prelude.Maybe [ResourceIdentifier],
ListGroupResourcesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListGroupResourcesResponse -> ListGroupResourcesResponse -> Bool
(ListGroupResourcesResponse -> ListGroupResourcesResponse -> Bool)
-> (ListGroupResourcesResponse
-> ListGroupResourcesResponse -> Bool)
-> Eq ListGroupResourcesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListGroupResourcesResponse -> ListGroupResourcesResponse -> Bool
$c/= :: ListGroupResourcesResponse -> ListGroupResourcesResponse -> Bool
== :: ListGroupResourcesResponse -> ListGroupResourcesResponse -> Bool
$c== :: ListGroupResourcesResponse -> ListGroupResourcesResponse -> Bool
Prelude.Eq, ReadPrec [ListGroupResourcesResponse]
ReadPrec ListGroupResourcesResponse
Int -> ReadS ListGroupResourcesResponse
ReadS [ListGroupResourcesResponse]
(Int -> ReadS ListGroupResourcesResponse)
-> ReadS [ListGroupResourcesResponse]
-> ReadPrec ListGroupResourcesResponse
-> ReadPrec [ListGroupResourcesResponse]
-> Read ListGroupResourcesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListGroupResourcesResponse]
$creadListPrec :: ReadPrec [ListGroupResourcesResponse]
readPrec :: ReadPrec ListGroupResourcesResponse
$creadPrec :: ReadPrec ListGroupResourcesResponse
readList :: ReadS [ListGroupResourcesResponse]
$creadList :: ReadS [ListGroupResourcesResponse]
readsPrec :: Int -> ReadS ListGroupResourcesResponse
$creadsPrec :: Int -> ReadS ListGroupResourcesResponse
Prelude.Read, Int -> ListGroupResourcesResponse -> ShowS
[ListGroupResourcesResponse] -> ShowS
ListGroupResourcesResponse -> String
(Int -> ListGroupResourcesResponse -> ShowS)
-> (ListGroupResourcesResponse -> String)
-> ([ListGroupResourcesResponse] -> ShowS)
-> Show ListGroupResourcesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListGroupResourcesResponse] -> ShowS
$cshowList :: [ListGroupResourcesResponse] -> ShowS
show :: ListGroupResourcesResponse -> String
$cshow :: ListGroupResourcesResponse -> String
showsPrec :: Int -> ListGroupResourcesResponse -> ShowS
$cshowsPrec :: Int -> ListGroupResourcesResponse -> ShowS
Prelude.Show, (forall x.
ListGroupResourcesResponse -> Rep ListGroupResourcesResponse x)
-> (forall x.
Rep ListGroupResourcesResponse x -> ListGroupResourcesResponse)
-> Generic ListGroupResourcesResponse
forall x.
Rep ListGroupResourcesResponse x -> ListGroupResourcesResponse
forall x.
ListGroupResourcesResponse -> Rep ListGroupResourcesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListGroupResourcesResponse x -> ListGroupResourcesResponse
$cfrom :: forall x.
ListGroupResourcesResponse -> Rep ListGroupResourcesResponse x
Prelude.Generic)
newListGroupResourcesResponse ::
Prelude.Int ->
ListGroupResourcesResponse
newListGroupResourcesResponse :: Int -> ListGroupResourcesResponse
newListGroupResourcesResponse Int
pHttpStatus_ =
ListGroupResourcesResponse' :: Maybe [ListGroupResourcesItem]
-> Maybe [QueryError]
-> Maybe Text
-> Maybe [ResourceIdentifier]
-> Int
-> ListGroupResourcesResponse
ListGroupResourcesResponse'
{ $sel:resources:ListGroupResourcesResponse' :: Maybe [ListGroupResourcesItem]
resources =
Maybe [ListGroupResourcesItem]
forall a. Maybe a
Prelude.Nothing,
$sel:queryErrors:ListGroupResourcesResponse' :: Maybe [QueryError]
queryErrors = Maybe [QueryError]
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListGroupResourcesResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:resourceIdentifiers:ListGroupResourcesResponse' :: Maybe [ResourceIdentifier]
resourceIdentifiers = Maybe [ResourceIdentifier]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListGroupResourcesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listGroupResourcesResponse_resources :: Lens.Lens' ListGroupResourcesResponse (Prelude.Maybe [ListGroupResourcesItem])
listGroupResourcesResponse_resources :: (Maybe [ListGroupResourcesItem]
-> f (Maybe [ListGroupResourcesItem]))
-> ListGroupResourcesResponse -> f ListGroupResourcesResponse
listGroupResourcesResponse_resources = (ListGroupResourcesResponse -> Maybe [ListGroupResourcesItem])
-> (ListGroupResourcesResponse
-> Maybe [ListGroupResourcesItem] -> ListGroupResourcesResponse)
-> Lens'
ListGroupResourcesResponse (Maybe [ListGroupResourcesItem])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroupResourcesResponse' {Maybe [ListGroupResourcesItem]
resources :: Maybe [ListGroupResourcesItem]
$sel:resources:ListGroupResourcesResponse' :: ListGroupResourcesResponse -> Maybe [ListGroupResourcesItem]
resources} -> Maybe [ListGroupResourcesItem]
resources) (\s :: ListGroupResourcesResponse
s@ListGroupResourcesResponse' {} Maybe [ListGroupResourcesItem]
a -> ListGroupResourcesResponse
s {$sel:resources:ListGroupResourcesResponse' :: Maybe [ListGroupResourcesItem]
resources = Maybe [ListGroupResourcesItem]
a} :: ListGroupResourcesResponse) ((Maybe [ListGroupResourcesItem]
-> f (Maybe [ListGroupResourcesItem]))
-> ListGroupResourcesResponse -> f ListGroupResourcesResponse)
-> ((Maybe [ListGroupResourcesItem]
-> f (Maybe [ListGroupResourcesItem]))
-> Maybe [ListGroupResourcesItem]
-> f (Maybe [ListGroupResourcesItem]))
-> (Maybe [ListGroupResourcesItem]
-> f (Maybe [ListGroupResourcesItem]))
-> ListGroupResourcesResponse
-> f ListGroupResourcesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ListGroupResourcesItem]
[ListGroupResourcesItem]
[ListGroupResourcesItem]
[ListGroupResourcesItem]
-> Iso
(Maybe [ListGroupResourcesItem])
(Maybe [ListGroupResourcesItem])
(Maybe [ListGroupResourcesItem])
(Maybe [ListGroupResourcesItem])
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 AnIso
[ListGroupResourcesItem]
[ListGroupResourcesItem]
[ListGroupResourcesItem]
[ListGroupResourcesItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listGroupResourcesResponse_queryErrors :: Lens.Lens' ListGroupResourcesResponse (Prelude.Maybe [QueryError])
listGroupResourcesResponse_queryErrors :: (Maybe [QueryError] -> f (Maybe [QueryError]))
-> ListGroupResourcesResponse -> f ListGroupResourcesResponse
listGroupResourcesResponse_queryErrors = (ListGroupResourcesResponse -> Maybe [QueryError])
-> (ListGroupResourcesResponse
-> Maybe [QueryError] -> ListGroupResourcesResponse)
-> Lens
ListGroupResourcesResponse
ListGroupResourcesResponse
(Maybe [QueryError])
(Maybe [QueryError])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroupResourcesResponse' {Maybe [QueryError]
queryErrors :: Maybe [QueryError]
$sel:queryErrors:ListGroupResourcesResponse' :: ListGroupResourcesResponse -> Maybe [QueryError]
queryErrors} -> Maybe [QueryError]
queryErrors) (\s :: ListGroupResourcesResponse
s@ListGroupResourcesResponse' {} Maybe [QueryError]
a -> ListGroupResourcesResponse
s {$sel:queryErrors:ListGroupResourcesResponse' :: Maybe [QueryError]
queryErrors = Maybe [QueryError]
a} :: ListGroupResourcesResponse) ((Maybe [QueryError] -> f (Maybe [QueryError]))
-> ListGroupResourcesResponse -> f ListGroupResourcesResponse)
-> ((Maybe [QueryError] -> f (Maybe [QueryError]))
-> Maybe [QueryError] -> f (Maybe [QueryError]))
-> (Maybe [QueryError] -> f (Maybe [QueryError]))
-> ListGroupResourcesResponse
-> f ListGroupResourcesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [QueryError] [QueryError] [QueryError] [QueryError]
-> Iso
(Maybe [QueryError])
(Maybe [QueryError])
(Maybe [QueryError])
(Maybe [QueryError])
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 AnIso [QueryError] [QueryError] [QueryError] [QueryError]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listGroupResourcesResponse_nextToken :: Lens.Lens' ListGroupResourcesResponse (Prelude.Maybe Prelude.Text)
listGroupResourcesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListGroupResourcesResponse -> f ListGroupResourcesResponse
listGroupResourcesResponse_nextToken = (ListGroupResourcesResponse -> Maybe Text)
-> (ListGroupResourcesResponse
-> Maybe Text -> ListGroupResourcesResponse)
-> Lens' ListGroupResourcesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroupResourcesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListGroupResourcesResponse' :: ListGroupResourcesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListGroupResourcesResponse
s@ListGroupResourcesResponse' {} Maybe Text
a -> ListGroupResourcesResponse
s {$sel:nextToken:ListGroupResourcesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListGroupResourcesResponse)
listGroupResourcesResponse_resourceIdentifiers :: Lens.Lens' ListGroupResourcesResponse (Prelude.Maybe [ResourceIdentifier])
listGroupResourcesResponse_resourceIdentifiers :: (Maybe [ResourceIdentifier] -> f (Maybe [ResourceIdentifier]))
-> ListGroupResourcesResponse -> f ListGroupResourcesResponse
listGroupResourcesResponse_resourceIdentifiers = (ListGroupResourcesResponse -> Maybe [ResourceIdentifier])
-> (ListGroupResourcesResponse
-> Maybe [ResourceIdentifier] -> ListGroupResourcesResponse)
-> Lens' ListGroupResourcesResponse (Maybe [ResourceIdentifier])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroupResourcesResponse' {Maybe [ResourceIdentifier]
resourceIdentifiers :: Maybe [ResourceIdentifier]
$sel:resourceIdentifiers:ListGroupResourcesResponse' :: ListGroupResourcesResponse -> Maybe [ResourceIdentifier]
resourceIdentifiers} -> Maybe [ResourceIdentifier]
resourceIdentifiers) (\s :: ListGroupResourcesResponse
s@ListGroupResourcesResponse' {} Maybe [ResourceIdentifier]
a -> ListGroupResourcesResponse
s {$sel:resourceIdentifiers:ListGroupResourcesResponse' :: Maybe [ResourceIdentifier]
resourceIdentifiers = Maybe [ResourceIdentifier]
a} :: ListGroupResourcesResponse) ((Maybe [ResourceIdentifier] -> f (Maybe [ResourceIdentifier]))
-> ListGroupResourcesResponse -> f ListGroupResourcesResponse)
-> ((Maybe [ResourceIdentifier] -> f (Maybe [ResourceIdentifier]))
-> Maybe [ResourceIdentifier] -> f (Maybe [ResourceIdentifier]))
-> (Maybe [ResourceIdentifier] -> f (Maybe [ResourceIdentifier]))
-> ListGroupResourcesResponse
-> f ListGroupResourcesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ResourceIdentifier]
[ResourceIdentifier]
[ResourceIdentifier]
[ResourceIdentifier]
-> Iso
(Maybe [ResourceIdentifier])
(Maybe [ResourceIdentifier])
(Maybe [ResourceIdentifier])
(Maybe [ResourceIdentifier])
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 AnIso
[ResourceIdentifier]
[ResourceIdentifier]
[ResourceIdentifier]
[ResourceIdentifier]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listGroupResourcesResponse_httpStatus :: Lens.Lens' ListGroupResourcesResponse Prelude.Int
listGroupResourcesResponse_httpStatus :: (Int -> f Int)
-> ListGroupResourcesResponse -> f ListGroupResourcesResponse
listGroupResourcesResponse_httpStatus = (ListGroupResourcesResponse -> Int)
-> (ListGroupResourcesResponse
-> Int -> ListGroupResourcesResponse)
-> Lens
ListGroupResourcesResponse ListGroupResourcesResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListGroupResourcesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListGroupResourcesResponse' :: ListGroupResourcesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListGroupResourcesResponse
s@ListGroupResourcesResponse' {} Int
a -> ListGroupResourcesResponse
s {$sel:httpStatus:ListGroupResourcesResponse' :: Int
httpStatus = Int
a} :: ListGroupResourcesResponse)
instance Prelude.NFData ListGroupResourcesResponse