{-# 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.Config.ListDiscoveredResources
(
ListDiscoveredResources (..),
newListDiscoveredResources,
listDiscoveredResources_resourceIds,
listDiscoveredResources_resourceName,
listDiscoveredResources_includeDeletedResources,
listDiscoveredResources_nextToken,
listDiscoveredResources_limit,
listDiscoveredResources_resourceType,
ListDiscoveredResourcesResponse (..),
newListDiscoveredResourcesResponse,
listDiscoveredResourcesResponse_nextToken,
listDiscoveredResourcesResponse_resourceIdentifiers,
listDiscoveredResourcesResponse_httpStatus,
)
where
import Amazonka.Config.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 ListDiscoveredResources = ListDiscoveredResources'
{
ListDiscoveredResources -> Maybe [Text]
resourceIds :: Prelude.Maybe [Prelude.Text],
ListDiscoveredResources -> Maybe Text
resourceName :: Prelude.Maybe Prelude.Text,
ListDiscoveredResources -> Maybe Bool
includeDeletedResources :: Prelude.Maybe Prelude.Bool,
ListDiscoveredResources -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListDiscoveredResources -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
ListDiscoveredResources -> ResourceType
resourceType :: ResourceType
}
deriving (ListDiscoveredResources -> ListDiscoveredResources -> Bool
(ListDiscoveredResources -> ListDiscoveredResources -> Bool)
-> (ListDiscoveredResources -> ListDiscoveredResources -> Bool)
-> Eq ListDiscoveredResources
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDiscoveredResources -> ListDiscoveredResources -> Bool
$c/= :: ListDiscoveredResources -> ListDiscoveredResources -> Bool
== :: ListDiscoveredResources -> ListDiscoveredResources -> Bool
$c== :: ListDiscoveredResources -> ListDiscoveredResources -> Bool
Prelude.Eq, ReadPrec [ListDiscoveredResources]
ReadPrec ListDiscoveredResources
Int -> ReadS ListDiscoveredResources
ReadS [ListDiscoveredResources]
(Int -> ReadS ListDiscoveredResources)
-> ReadS [ListDiscoveredResources]
-> ReadPrec ListDiscoveredResources
-> ReadPrec [ListDiscoveredResources]
-> Read ListDiscoveredResources
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDiscoveredResources]
$creadListPrec :: ReadPrec [ListDiscoveredResources]
readPrec :: ReadPrec ListDiscoveredResources
$creadPrec :: ReadPrec ListDiscoveredResources
readList :: ReadS [ListDiscoveredResources]
$creadList :: ReadS [ListDiscoveredResources]
readsPrec :: Int -> ReadS ListDiscoveredResources
$creadsPrec :: Int -> ReadS ListDiscoveredResources
Prelude.Read, Int -> ListDiscoveredResources -> ShowS
[ListDiscoveredResources] -> ShowS
ListDiscoveredResources -> String
(Int -> ListDiscoveredResources -> ShowS)
-> (ListDiscoveredResources -> String)
-> ([ListDiscoveredResources] -> ShowS)
-> Show ListDiscoveredResources
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDiscoveredResources] -> ShowS
$cshowList :: [ListDiscoveredResources] -> ShowS
show :: ListDiscoveredResources -> String
$cshow :: ListDiscoveredResources -> String
showsPrec :: Int -> ListDiscoveredResources -> ShowS
$cshowsPrec :: Int -> ListDiscoveredResources -> ShowS
Prelude.Show, (forall x.
ListDiscoveredResources -> Rep ListDiscoveredResources x)
-> (forall x.
Rep ListDiscoveredResources x -> ListDiscoveredResources)
-> Generic ListDiscoveredResources
forall x. Rep ListDiscoveredResources x -> ListDiscoveredResources
forall x. ListDiscoveredResources -> Rep ListDiscoveredResources x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListDiscoveredResources x -> ListDiscoveredResources
$cfrom :: forall x. ListDiscoveredResources -> Rep ListDiscoveredResources x
Prelude.Generic)
newListDiscoveredResources ::
ResourceType ->
ListDiscoveredResources
newListDiscoveredResources :: ResourceType -> ListDiscoveredResources
newListDiscoveredResources ResourceType
pResourceType_ =
ListDiscoveredResources' :: Maybe [Text]
-> Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Natural
-> ResourceType
-> ListDiscoveredResources
ListDiscoveredResources'
{ $sel:resourceIds:ListDiscoveredResources' :: Maybe [Text]
resourceIds =
Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:resourceName:ListDiscoveredResources' :: Maybe Text
resourceName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:includeDeletedResources:ListDiscoveredResources' :: Maybe Bool
includeDeletedResources = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListDiscoveredResources' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:limit:ListDiscoveredResources' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:resourceType:ListDiscoveredResources' :: ResourceType
resourceType = ResourceType
pResourceType_
}
listDiscoveredResources_resourceIds :: Lens.Lens' ListDiscoveredResources (Prelude.Maybe [Prelude.Text])
listDiscoveredResources_resourceIds :: (Maybe [Text] -> f (Maybe [Text]))
-> ListDiscoveredResources -> f ListDiscoveredResources
listDiscoveredResources_resourceIds = (ListDiscoveredResources -> Maybe [Text])
-> (ListDiscoveredResources
-> Maybe [Text] -> ListDiscoveredResources)
-> Lens
ListDiscoveredResources
ListDiscoveredResources
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDiscoveredResources' {Maybe [Text]
resourceIds :: Maybe [Text]
$sel:resourceIds:ListDiscoveredResources' :: ListDiscoveredResources -> Maybe [Text]
resourceIds} -> Maybe [Text]
resourceIds) (\s :: ListDiscoveredResources
s@ListDiscoveredResources' {} Maybe [Text]
a -> ListDiscoveredResources
s {$sel:resourceIds:ListDiscoveredResources' :: Maybe [Text]
resourceIds = Maybe [Text]
a} :: ListDiscoveredResources) ((Maybe [Text] -> f (Maybe [Text]))
-> ListDiscoveredResources -> f ListDiscoveredResources)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListDiscoveredResources
-> f ListDiscoveredResources
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listDiscoveredResources_resourceName :: Lens.Lens' ListDiscoveredResources (Prelude.Maybe Prelude.Text)
listDiscoveredResources_resourceName :: (Maybe Text -> f (Maybe Text))
-> ListDiscoveredResources -> f ListDiscoveredResources
listDiscoveredResources_resourceName = (ListDiscoveredResources -> Maybe Text)
-> (ListDiscoveredResources
-> Maybe Text -> ListDiscoveredResources)
-> Lens
ListDiscoveredResources
ListDiscoveredResources
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDiscoveredResources' {Maybe Text
resourceName :: Maybe Text
$sel:resourceName:ListDiscoveredResources' :: ListDiscoveredResources -> Maybe Text
resourceName} -> Maybe Text
resourceName) (\s :: ListDiscoveredResources
s@ListDiscoveredResources' {} Maybe Text
a -> ListDiscoveredResources
s {$sel:resourceName:ListDiscoveredResources' :: Maybe Text
resourceName = Maybe Text
a} :: ListDiscoveredResources)
listDiscoveredResources_includeDeletedResources :: Lens.Lens' ListDiscoveredResources (Prelude.Maybe Prelude.Bool)
listDiscoveredResources_includeDeletedResources :: (Maybe Bool -> f (Maybe Bool))
-> ListDiscoveredResources -> f ListDiscoveredResources
listDiscoveredResources_includeDeletedResources = (ListDiscoveredResources -> Maybe Bool)
-> (ListDiscoveredResources
-> Maybe Bool -> ListDiscoveredResources)
-> Lens
ListDiscoveredResources
ListDiscoveredResources
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDiscoveredResources' {Maybe Bool
includeDeletedResources :: Maybe Bool
$sel:includeDeletedResources:ListDiscoveredResources' :: ListDiscoveredResources -> Maybe Bool
includeDeletedResources} -> Maybe Bool
includeDeletedResources) (\s :: ListDiscoveredResources
s@ListDiscoveredResources' {} Maybe Bool
a -> ListDiscoveredResources
s {$sel:includeDeletedResources:ListDiscoveredResources' :: Maybe Bool
includeDeletedResources = Maybe Bool
a} :: ListDiscoveredResources)
listDiscoveredResources_nextToken :: Lens.Lens' ListDiscoveredResources (Prelude.Maybe Prelude.Text)
listDiscoveredResources_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDiscoveredResources -> f ListDiscoveredResources
listDiscoveredResources_nextToken = (ListDiscoveredResources -> Maybe Text)
-> (ListDiscoveredResources
-> Maybe Text -> ListDiscoveredResources)
-> Lens
ListDiscoveredResources
ListDiscoveredResources
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDiscoveredResources' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDiscoveredResources' :: ListDiscoveredResources -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDiscoveredResources
s@ListDiscoveredResources' {} Maybe Text
a -> ListDiscoveredResources
s {$sel:nextToken:ListDiscoveredResources' :: Maybe Text
nextToken = Maybe Text
a} :: ListDiscoveredResources)
listDiscoveredResources_limit :: Lens.Lens' ListDiscoveredResources (Prelude.Maybe Prelude.Natural)
listDiscoveredResources_limit :: (Maybe Natural -> f (Maybe Natural))
-> ListDiscoveredResources -> f ListDiscoveredResources
listDiscoveredResources_limit = (ListDiscoveredResources -> Maybe Natural)
-> (ListDiscoveredResources
-> Maybe Natural -> ListDiscoveredResources)
-> Lens
ListDiscoveredResources
ListDiscoveredResources
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDiscoveredResources' {Maybe Natural
limit :: Maybe Natural
$sel:limit:ListDiscoveredResources' :: ListDiscoveredResources -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: ListDiscoveredResources
s@ListDiscoveredResources' {} Maybe Natural
a -> ListDiscoveredResources
s {$sel:limit:ListDiscoveredResources' :: Maybe Natural
limit = Maybe Natural
a} :: ListDiscoveredResources)
listDiscoveredResources_resourceType :: Lens.Lens' ListDiscoveredResources ResourceType
listDiscoveredResources_resourceType :: (ResourceType -> f ResourceType)
-> ListDiscoveredResources -> f ListDiscoveredResources
listDiscoveredResources_resourceType = (ListDiscoveredResources -> ResourceType)
-> (ListDiscoveredResources
-> ResourceType -> ListDiscoveredResources)
-> Lens
ListDiscoveredResources
ListDiscoveredResources
ResourceType
ResourceType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDiscoveredResources' {ResourceType
resourceType :: ResourceType
$sel:resourceType:ListDiscoveredResources' :: ListDiscoveredResources -> ResourceType
resourceType} -> ResourceType
resourceType) (\s :: ListDiscoveredResources
s@ListDiscoveredResources' {} ResourceType
a -> ListDiscoveredResources
s {$sel:resourceType:ListDiscoveredResources' :: ResourceType
resourceType = ResourceType
a} :: ListDiscoveredResources)
instance Core.AWSPager ListDiscoveredResources where
page :: ListDiscoveredResources
-> AWSResponse ListDiscoveredResources
-> Maybe ListDiscoveredResources
page ListDiscoveredResources
rq AWSResponse ListDiscoveredResources
rs
| Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListDiscoveredResources
ListDiscoveredResourcesResponse
rs
ListDiscoveredResourcesResponse
-> Getting (First Text) ListDiscoveredResourcesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListDiscoveredResourcesResponse
-> Const (First Text) ListDiscoveredResourcesResponse
Lens' ListDiscoveredResourcesResponse (Maybe Text)
listDiscoveredResourcesResponse_nextToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> ListDiscoveredResourcesResponse
-> Const (First Text) ListDiscoveredResourcesResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListDiscoveredResourcesResponse 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 ListDiscoveredResources
forall a. Maybe a
Prelude.Nothing
| Maybe [ResourceIdentifier] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListDiscoveredResources
ListDiscoveredResourcesResponse
rs
ListDiscoveredResourcesResponse
-> Getting
(First [ResourceIdentifier])
ListDiscoveredResourcesResponse
[ResourceIdentifier]
-> Maybe [ResourceIdentifier]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ResourceIdentifier]
-> Const (First [ResourceIdentifier]) (Maybe [ResourceIdentifier]))
-> ListDiscoveredResourcesResponse
-> Const
(First [ResourceIdentifier]) ListDiscoveredResourcesResponse
Lens' ListDiscoveredResourcesResponse (Maybe [ResourceIdentifier])
listDiscoveredResourcesResponse_resourceIdentifiers
((Maybe [ResourceIdentifier]
-> Const (First [ResourceIdentifier]) (Maybe [ResourceIdentifier]))
-> ListDiscoveredResourcesResponse
-> Const
(First [ResourceIdentifier]) ListDiscoveredResourcesResponse)
-> (([ResourceIdentifier]
-> Const (First [ResourceIdentifier]) [ResourceIdentifier])
-> Maybe [ResourceIdentifier]
-> Const (First [ResourceIdentifier]) (Maybe [ResourceIdentifier]))
-> Getting
(First [ResourceIdentifier])
ListDiscoveredResourcesResponse
[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 ListDiscoveredResources
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
ListDiscoveredResources -> Maybe ListDiscoveredResources
forall a. a -> Maybe a
Prelude.Just (ListDiscoveredResources -> Maybe ListDiscoveredResources)
-> ListDiscoveredResources -> Maybe ListDiscoveredResources
forall a b. (a -> b) -> a -> b
Prelude.$
ListDiscoveredResources
rq
ListDiscoveredResources
-> (ListDiscoveredResources -> ListDiscoveredResources)
-> ListDiscoveredResources
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListDiscoveredResources -> Identity ListDiscoveredResources
Lens
ListDiscoveredResources
ListDiscoveredResources
(Maybe Text)
(Maybe Text)
listDiscoveredResources_nextToken
((Maybe Text -> Identity (Maybe Text))
-> ListDiscoveredResources -> Identity ListDiscoveredResources)
-> Maybe Text -> ListDiscoveredResources -> ListDiscoveredResources
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListDiscoveredResources
ListDiscoveredResourcesResponse
rs
ListDiscoveredResourcesResponse
-> Getting (First Text) ListDiscoveredResourcesResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListDiscoveredResourcesResponse
-> Const (First Text) ListDiscoveredResourcesResponse
Lens' ListDiscoveredResourcesResponse (Maybe Text)
listDiscoveredResourcesResponse_nextToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> ListDiscoveredResourcesResponse
-> Const (First Text) ListDiscoveredResourcesResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListDiscoveredResourcesResponse 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 ListDiscoveredResources where
type
AWSResponse ListDiscoveredResources =
ListDiscoveredResourcesResponse
request :: ListDiscoveredResources -> Request ListDiscoveredResources
request = Service
-> ListDiscoveredResources -> Request ListDiscoveredResources
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy ListDiscoveredResources
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListDiscoveredResources)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListDiscoveredResources))
-> Logger
-> Service
-> Proxy ListDiscoveredResources
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListDiscoveredResources)))
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 Text
-> Maybe [ResourceIdentifier]
-> Int
-> ListDiscoveredResourcesResponse
ListDiscoveredResourcesResponse'
(Maybe Text
-> Maybe [ResourceIdentifier]
-> Int
-> ListDiscoveredResourcesResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe [ResourceIdentifier]
-> Int -> ListDiscoveredResourcesResponse)
forall (f :: * -> *) a b. Functor 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 -> ListDiscoveredResourcesResponse)
-> Either String (Maybe [ResourceIdentifier])
-> Either String (Int -> ListDiscoveredResourcesResponse)
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 -> ListDiscoveredResourcesResponse)
-> Either String Int
-> Either String ListDiscoveredResourcesResponse
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 ListDiscoveredResources
instance Prelude.NFData ListDiscoveredResources
instance Core.ToHeaders ListDiscoveredResources where
toHeaders :: ListDiscoveredResources -> ResponseHeaders
toHeaders =
ResponseHeaders -> ListDiscoveredResources -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"StarlingDoveService.ListDiscoveredResources" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Core.ToJSON ListDiscoveredResources where
toJSON :: ListDiscoveredResources -> Value
toJSON ListDiscoveredResources' {Maybe Bool
Maybe Natural
Maybe [Text]
Maybe Text
ResourceType
resourceType :: ResourceType
limit :: Maybe Natural
nextToken :: Maybe Text
includeDeletedResources :: Maybe Bool
resourceName :: Maybe Text
resourceIds :: Maybe [Text]
$sel:resourceType:ListDiscoveredResources' :: ListDiscoveredResources -> ResourceType
$sel:limit:ListDiscoveredResources' :: ListDiscoveredResources -> Maybe Natural
$sel:nextToken:ListDiscoveredResources' :: ListDiscoveredResources -> Maybe Text
$sel:includeDeletedResources:ListDiscoveredResources' :: ListDiscoveredResources -> Maybe Bool
$sel:resourceName:ListDiscoveredResources' :: ListDiscoveredResources -> Maybe Text
$sel:resourceIds:ListDiscoveredResources' :: ListDiscoveredResources -> Maybe [Text]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"resourceIds" 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]
resourceIds,
(Text
"resourceName" 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
resourceName,
(Text
"includeDeletedResources" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
includeDeletedResources,
(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
"limit" 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
limit,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"resourceType" Text -> ResourceType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ResourceType
resourceType)
]
)
instance Core.ToPath ListDiscoveredResources where
toPath :: ListDiscoveredResources -> ByteString
toPath = ByteString -> ListDiscoveredResources -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ListDiscoveredResources where
toQuery :: ListDiscoveredResources -> QueryString
toQuery = QueryString -> ListDiscoveredResources -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data ListDiscoveredResourcesResponse = ListDiscoveredResourcesResponse'
{
ListDiscoveredResourcesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListDiscoveredResourcesResponse -> Maybe [ResourceIdentifier]
resourceIdentifiers :: Prelude.Maybe [ResourceIdentifier],
ListDiscoveredResourcesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListDiscoveredResourcesResponse
-> ListDiscoveredResourcesResponse -> Bool
(ListDiscoveredResourcesResponse
-> ListDiscoveredResourcesResponse -> Bool)
-> (ListDiscoveredResourcesResponse
-> ListDiscoveredResourcesResponse -> Bool)
-> Eq ListDiscoveredResourcesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDiscoveredResourcesResponse
-> ListDiscoveredResourcesResponse -> Bool
$c/= :: ListDiscoveredResourcesResponse
-> ListDiscoveredResourcesResponse -> Bool
== :: ListDiscoveredResourcesResponse
-> ListDiscoveredResourcesResponse -> Bool
$c== :: ListDiscoveredResourcesResponse
-> ListDiscoveredResourcesResponse -> Bool
Prelude.Eq, ReadPrec [ListDiscoveredResourcesResponse]
ReadPrec ListDiscoveredResourcesResponse
Int -> ReadS ListDiscoveredResourcesResponse
ReadS [ListDiscoveredResourcesResponse]
(Int -> ReadS ListDiscoveredResourcesResponse)
-> ReadS [ListDiscoveredResourcesResponse]
-> ReadPrec ListDiscoveredResourcesResponse
-> ReadPrec [ListDiscoveredResourcesResponse]
-> Read ListDiscoveredResourcesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDiscoveredResourcesResponse]
$creadListPrec :: ReadPrec [ListDiscoveredResourcesResponse]
readPrec :: ReadPrec ListDiscoveredResourcesResponse
$creadPrec :: ReadPrec ListDiscoveredResourcesResponse
readList :: ReadS [ListDiscoveredResourcesResponse]
$creadList :: ReadS [ListDiscoveredResourcesResponse]
readsPrec :: Int -> ReadS ListDiscoveredResourcesResponse
$creadsPrec :: Int -> ReadS ListDiscoveredResourcesResponse
Prelude.Read, Int -> ListDiscoveredResourcesResponse -> ShowS
[ListDiscoveredResourcesResponse] -> ShowS
ListDiscoveredResourcesResponse -> String
(Int -> ListDiscoveredResourcesResponse -> ShowS)
-> (ListDiscoveredResourcesResponse -> String)
-> ([ListDiscoveredResourcesResponse] -> ShowS)
-> Show ListDiscoveredResourcesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDiscoveredResourcesResponse] -> ShowS
$cshowList :: [ListDiscoveredResourcesResponse] -> ShowS
show :: ListDiscoveredResourcesResponse -> String
$cshow :: ListDiscoveredResourcesResponse -> String
showsPrec :: Int -> ListDiscoveredResourcesResponse -> ShowS
$cshowsPrec :: Int -> ListDiscoveredResourcesResponse -> ShowS
Prelude.Show, (forall x.
ListDiscoveredResourcesResponse
-> Rep ListDiscoveredResourcesResponse x)
-> (forall x.
Rep ListDiscoveredResourcesResponse x
-> ListDiscoveredResourcesResponse)
-> Generic ListDiscoveredResourcesResponse
forall x.
Rep ListDiscoveredResourcesResponse x
-> ListDiscoveredResourcesResponse
forall x.
ListDiscoveredResourcesResponse
-> Rep ListDiscoveredResourcesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDiscoveredResourcesResponse x
-> ListDiscoveredResourcesResponse
$cfrom :: forall x.
ListDiscoveredResourcesResponse
-> Rep ListDiscoveredResourcesResponse x
Prelude.Generic)
newListDiscoveredResourcesResponse ::
Prelude.Int ->
ListDiscoveredResourcesResponse
newListDiscoveredResourcesResponse :: Int -> ListDiscoveredResourcesResponse
newListDiscoveredResourcesResponse Int
pHttpStatus_ =
ListDiscoveredResourcesResponse' :: Maybe Text
-> Maybe [ResourceIdentifier]
-> Int
-> ListDiscoveredResourcesResponse
ListDiscoveredResourcesResponse'
{ $sel:nextToken:ListDiscoveredResourcesResponse' :: Maybe Text
nextToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:resourceIdentifiers:ListDiscoveredResourcesResponse' :: Maybe [ResourceIdentifier]
resourceIdentifiers = Maybe [ResourceIdentifier]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListDiscoveredResourcesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listDiscoveredResourcesResponse_nextToken :: Lens.Lens' ListDiscoveredResourcesResponse (Prelude.Maybe Prelude.Text)
listDiscoveredResourcesResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDiscoveredResourcesResponse
-> f ListDiscoveredResourcesResponse
listDiscoveredResourcesResponse_nextToken = (ListDiscoveredResourcesResponse -> Maybe Text)
-> (ListDiscoveredResourcesResponse
-> Maybe Text -> ListDiscoveredResourcesResponse)
-> Lens' ListDiscoveredResourcesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDiscoveredResourcesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDiscoveredResourcesResponse' :: ListDiscoveredResourcesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDiscoveredResourcesResponse
s@ListDiscoveredResourcesResponse' {} Maybe Text
a -> ListDiscoveredResourcesResponse
s {$sel:nextToken:ListDiscoveredResourcesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDiscoveredResourcesResponse)
listDiscoveredResourcesResponse_resourceIdentifiers :: Lens.Lens' ListDiscoveredResourcesResponse (Prelude.Maybe [ResourceIdentifier])
listDiscoveredResourcesResponse_resourceIdentifiers :: (Maybe [ResourceIdentifier] -> f (Maybe [ResourceIdentifier]))
-> ListDiscoveredResourcesResponse
-> f ListDiscoveredResourcesResponse
listDiscoveredResourcesResponse_resourceIdentifiers = (ListDiscoveredResourcesResponse -> Maybe [ResourceIdentifier])
-> (ListDiscoveredResourcesResponse
-> Maybe [ResourceIdentifier] -> ListDiscoveredResourcesResponse)
-> Lens'
ListDiscoveredResourcesResponse (Maybe [ResourceIdentifier])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDiscoveredResourcesResponse' {Maybe [ResourceIdentifier]
resourceIdentifiers :: Maybe [ResourceIdentifier]
$sel:resourceIdentifiers:ListDiscoveredResourcesResponse' :: ListDiscoveredResourcesResponse -> Maybe [ResourceIdentifier]
resourceIdentifiers} -> Maybe [ResourceIdentifier]
resourceIdentifiers) (\s :: ListDiscoveredResourcesResponse
s@ListDiscoveredResourcesResponse' {} Maybe [ResourceIdentifier]
a -> ListDiscoveredResourcesResponse
s {$sel:resourceIdentifiers:ListDiscoveredResourcesResponse' :: Maybe [ResourceIdentifier]
resourceIdentifiers = Maybe [ResourceIdentifier]
a} :: ListDiscoveredResourcesResponse) ((Maybe [ResourceIdentifier] -> f (Maybe [ResourceIdentifier]))
-> ListDiscoveredResourcesResponse
-> f ListDiscoveredResourcesResponse)
-> ((Maybe [ResourceIdentifier] -> f (Maybe [ResourceIdentifier]))
-> Maybe [ResourceIdentifier] -> f (Maybe [ResourceIdentifier]))
-> (Maybe [ResourceIdentifier] -> f (Maybe [ResourceIdentifier]))
-> ListDiscoveredResourcesResponse
-> f ListDiscoveredResourcesResponse
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
listDiscoveredResourcesResponse_httpStatus :: Lens.Lens' ListDiscoveredResourcesResponse Prelude.Int
listDiscoveredResourcesResponse_httpStatus :: (Int -> f Int)
-> ListDiscoveredResourcesResponse
-> f ListDiscoveredResourcesResponse
listDiscoveredResourcesResponse_httpStatus = (ListDiscoveredResourcesResponse -> Int)
-> (ListDiscoveredResourcesResponse
-> Int -> ListDiscoveredResourcesResponse)
-> Lens
ListDiscoveredResourcesResponse
ListDiscoveredResourcesResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDiscoveredResourcesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListDiscoveredResourcesResponse' :: ListDiscoveredResourcesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListDiscoveredResourcesResponse
s@ListDiscoveredResourcesResponse' {} Int
a -> ListDiscoveredResourcesResponse
s {$sel:httpStatus:ListDiscoveredResourcesResponse' :: Int
httpStatus = Int
a} :: ListDiscoveredResourcesResponse)
instance
Prelude.NFData
ListDiscoveredResourcesResponse