{-# 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.EMR.ListInstances
(
ListInstances (..),
newListInstances,
listInstances_instanceGroupTypes,
listInstances_instanceFleetType,
listInstances_marker,
listInstances_instanceFleetId,
listInstances_instanceStates,
listInstances_instanceGroupId,
listInstances_clusterId,
ListInstancesResponse (..),
newListInstancesResponse,
listInstancesResponse_marker,
listInstancesResponse_instances,
listInstancesResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.EMR.Types
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 ListInstances = ListInstances'
{
ListInstances -> Maybe [InstanceGroupType]
instanceGroupTypes :: Prelude.Maybe [InstanceGroupType],
ListInstances -> Maybe InstanceFleetType
instanceFleetType :: Prelude.Maybe InstanceFleetType,
ListInstances -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
ListInstances -> Maybe Text
instanceFleetId :: Prelude.Maybe Prelude.Text,
ListInstances -> Maybe [InstanceState]
instanceStates :: Prelude.Maybe [InstanceState],
ListInstances -> Maybe Text
instanceGroupId :: Prelude.Maybe Prelude.Text,
ListInstances -> Text
clusterId :: Prelude.Text
}
deriving (ListInstances -> ListInstances -> Bool
(ListInstances -> ListInstances -> Bool)
-> (ListInstances -> ListInstances -> Bool) -> Eq ListInstances
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListInstances -> ListInstances -> Bool
$c/= :: ListInstances -> ListInstances -> Bool
== :: ListInstances -> ListInstances -> Bool
$c== :: ListInstances -> ListInstances -> Bool
Prelude.Eq, ReadPrec [ListInstances]
ReadPrec ListInstances
Int -> ReadS ListInstances
ReadS [ListInstances]
(Int -> ReadS ListInstances)
-> ReadS [ListInstances]
-> ReadPrec ListInstances
-> ReadPrec [ListInstances]
-> Read ListInstances
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListInstances]
$creadListPrec :: ReadPrec [ListInstances]
readPrec :: ReadPrec ListInstances
$creadPrec :: ReadPrec ListInstances
readList :: ReadS [ListInstances]
$creadList :: ReadS [ListInstances]
readsPrec :: Int -> ReadS ListInstances
$creadsPrec :: Int -> ReadS ListInstances
Prelude.Read, Int -> ListInstances -> ShowS
[ListInstances] -> ShowS
ListInstances -> String
(Int -> ListInstances -> ShowS)
-> (ListInstances -> String)
-> ([ListInstances] -> ShowS)
-> Show ListInstances
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListInstances] -> ShowS
$cshowList :: [ListInstances] -> ShowS
show :: ListInstances -> String
$cshow :: ListInstances -> String
showsPrec :: Int -> ListInstances -> ShowS
$cshowsPrec :: Int -> ListInstances -> ShowS
Prelude.Show, (forall x. ListInstances -> Rep ListInstances x)
-> (forall x. Rep ListInstances x -> ListInstances)
-> Generic ListInstances
forall x. Rep ListInstances x -> ListInstances
forall x. ListInstances -> Rep ListInstances x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListInstances x -> ListInstances
$cfrom :: forall x. ListInstances -> Rep ListInstances x
Prelude.Generic)
newListInstances ::
Prelude.Text ->
ListInstances
newListInstances :: Text -> ListInstances
newListInstances Text
pClusterId_ =
ListInstances' :: Maybe [InstanceGroupType]
-> Maybe InstanceFleetType
-> Maybe Text
-> Maybe Text
-> Maybe [InstanceState]
-> Maybe Text
-> Text
-> ListInstances
ListInstances'
{ $sel:instanceGroupTypes:ListInstances' :: Maybe [InstanceGroupType]
instanceGroupTypes =
Maybe [InstanceGroupType]
forall a. Maybe a
Prelude.Nothing,
$sel:instanceFleetType:ListInstances' :: Maybe InstanceFleetType
instanceFleetType = Maybe InstanceFleetType
forall a. Maybe a
Prelude.Nothing,
$sel:marker:ListInstances' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:instanceFleetId:ListInstances' :: Maybe Text
instanceFleetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:instanceStates:ListInstances' :: Maybe [InstanceState]
instanceStates = Maybe [InstanceState]
forall a. Maybe a
Prelude.Nothing,
$sel:instanceGroupId:ListInstances' :: Maybe Text
instanceGroupId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:clusterId:ListInstances' :: Text
clusterId = Text
pClusterId_
}
listInstances_instanceGroupTypes :: Lens.Lens' ListInstances (Prelude.Maybe [InstanceGroupType])
listInstances_instanceGroupTypes :: (Maybe [InstanceGroupType] -> f (Maybe [InstanceGroupType]))
-> ListInstances -> f ListInstances
listInstances_instanceGroupTypes = (ListInstances -> Maybe [InstanceGroupType])
-> (ListInstances -> Maybe [InstanceGroupType] -> ListInstances)
-> Lens
ListInstances
ListInstances
(Maybe [InstanceGroupType])
(Maybe [InstanceGroupType])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstances' {Maybe [InstanceGroupType]
instanceGroupTypes :: Maybe [InstanceGroupType]
$sel:instanceGroupTypes:ListInstances' :: ListInstances -> Maybe [InstanceGroupType]
instanceGroupTypes} -> Maybe [InstanceGroupType]
instanceGroupTypes) (\s :: ListInstances
s@ListInstances' {} Maybe [InstanceGroupType]
a -> ListInstances
s {$sel:instanceGroupTypes:ListInstances' :: Maybe [InstanceGroupType]
instanceGroupTypes = Maybe [InstanceGroupType]
a} :: ListInstances) ((Maybe [InstanceGroupType] -> f (Maybe [InstanceGroupType]))
-> ListInstances -> f ListInstances)
-> ((Maybe [InstanceGroupType] -> f (Maybe [InstanceGroupType]))
-> Maybe [InstanceGroupType] -> f (Maybe [InstanceGroupType]))
-> (Maybe [InstanceGroupType] -> f (Maybe [InstanceGroupType]))
-> ListInstances
-> f ListInstances
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[InstanceGroupType]
[InstanceGroupType]
[InstanceGroupType]
[InstanceGroupType]
-> Iso
(Maybe [InstanceGroupType])
(Maybe [InstanceGroupType])
(Maybe [InstanceGroupType])
(Maybe [InstanceGroupType])
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
[InstanceGroupType]
[InstanceGroupType]
[InstanceGroupType]
[InstanceGroupType]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listInstances_instanceFleetType :: Lens.Lens' ListInstances (Prelude.Maybe InstanceFleetType)
listInstances_instanceFleetType :: (Maybe InstanceFleetType -> f (Maybe InstanceFleetType))
-> ListInstances -> f ListInstances
listInstances_instanceFleetType = (ListInstances -> Maybe InstanceFleetType)
-> (ListInstances -> Maybe InstanceFleetType -> ListInstances)
-> Lens
ListInstances
ListInstances
(Maybe InstanceFleetType)
(Maybe InstanceFleetType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstances' {Maybe InstanceFleetType
instanceFleetType :: Maybe InstanceFleetType
$sel:instanceFleetType:ListInstances' :: ListInstances -> Maybe InstanceFleetType
instanceFleetType} -> Maybe InstanceFleetType
instanceFleetType) (\s :: ListInstances
s@ListInstances' {} Maybe InstanceFleetType
a -> ListInstances
s {$sel:instanceFleetType:ListInstances' :: Maybe InstanceFleetType
instanceFleetType = Maybe InstanceFleetType
a} :: ListInstances)
listInstances_marker :: Lens.Lens' ListInstances (Prelude.Maybe Prelude.Text)
listInstances_marker :: (Maybe Text -> f (Maybe Text)) -> ListInstances -> f ListInstances
listInstances_marker = (ListInstances -> Maybe Text)
-> (ListInstances -> Maybe Text -> ListInstances)
-> Lens ListInstances ListInstances (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstances' {Maybe Text
marker :: Maybe Text
$sel:marker:ListInstances' :: ListInstances -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListInstances
s@ListInstances' {} Maybe Text
a -> ListInstances
s {$sel:marker:ListInstances' :: Maybe Text
marker = Maybe Text
a} :: ListInstances)
listInstances_instanceFleetId :: Lens.Lens' ListInstances (Prelude.Maybe Prelude.Text)
listInstances_instanceFleetId :: (Maybe Text -> f (Maybe Text)) -> ListInstances -> f ListInstances
listInstances_instanceFleetId = (ListInstances -> Maybe Text)
-> (ListInstances -> Maybe Text -> ListInstances)
-> Lens ListInstances ListInstances (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstances' {Maybe Text
instanceFleetId :: Maybe Text
$sel:instanceFleetId:ListInstances' :: ListInstances -> Maybe Text
instanceFleetId} -> Maybe Text
instanceFleetId) (\s :: ListInstances
s@ListInstances' {} Maybe Text
a -> ListInstances
s {$sel:instanceFleetId:ListInstances' :: Maybe Text
instanceFleetId = Maybe Text
a} :: ListInstances)
listInstances_instanceStates :: Lens.Lens' ListInstances (Prelude.Maybe [InstanceState])
listInstances_instanceStates :: (Maybe [InstanceState] -> f (Maybe [InstanceState]))
-> ListInstances -> f ListInstances
listInstances_instanceStates = (ListInstances -> Maybe [InstanceState])
-> (ListInstances -> Maybe [InstanceState] -> ListInstances)
-> Lens
ListInstances
ListInstances
(Maybe [InstanceState])
(Maybe [InstanceState])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstances' {Maybe [InstanceState]
instanceStates :: Maybe [InstanceState]
$sel:instanceStates:ListInstances' :: ListInstances -> Maybe [InstanceState]
instanceStates} -> Maybe [InstanceState]
instanceStates) (\s :: ListInstances
s@ListInstances' {} Maybe [InstanceState]
a -> ListInstances
s {$sel:instanceStates:ListInstances' :: Maybe [InstanceState]
instanceStates = Maybe [InstanceState]
a} :: ListInstances) ((Maybe [InstanceState] -> f (Maybe [InstanceState]))
-> ListInstances -> f ListInstances)
-> ((Maybe [InstanceState] -> f (Maybe [InstanceState]))
-> Maybe [InstanceState] -> f (Maybe [InstanceState]))
-> (Maybe [InstanceState] -> f (Maybe [InstanceState]))
-> ListInstances
-> f ListInstances
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[InstanceState] [InstanceState] [InstanceState] [InstanceState]
-> Iso
(Maybe [InstanceState])
(Maybe [InstanceState])
(Maybe [InstanceState])
(Maybe [InstanceState])
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
[InstanceState] [InstanceState] [InstanceState] [InstanceState]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listInstances_instanceGroupId :: Lens.Lens' ListInstances (Prelude.Maybe Prelude.Text)
listInstances_instanceGroupId :: (Maybe Text -> f (Maybe Text)) -> ListInstances -> f ListInstances
listInstances_instanceGroupId = (ListInstances -> Maybe Text)
-> (ListInstances -> Maybe Text -> ListInstances)
-> Lens ListInstances ListInstances (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstances' {Maybe Text
instanceGroupId :: Maybe Text
$sel:instanceGroupId:ListInstances' :: ListInstances -> Maybe Text
instanceGroupId} -> Maybe Text
instanceGroupId) (\s :: ListInstances
s@ListInstances' {} Maybe Text
a -> ListInstances
s {$sel:instanceGroupId:ListInstances' :: Maybe Text
instanceGroupId = Maybe Text
a} :: ListInstances)
listInstances_clusterId :: Lens.Lens' ListInstances Prelude.Text
listInstances_clusterId :: (Text -> f Text) -> ListInstances -> f ListInstances
listInstances_clusterId = (ListInstances -> Text)
-> (ListInstances -> Text -> ListInstances)
-> Lens ListInstances ListInstances Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstances' {Text
clusterId :: Text
$sel:clusterId:ListInstances' :: ListInstances -> Text
clusterId} -> Text
clusterId) (\s :: ListInstances
s@ListInstances' {} Text
a -> ListInstances
s {$sel:clusterId:ListInstances' :: Text
clusterId = Text
a} :: ListInstances)
instance Core.AWSPager ListInstances where
page :: ListInstances -> AWSResponse ListInstances -> Maybe ListInstances
page ListInstances
rq AWSResponse ListInstances
rs
| Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListInstances
ListInstancesResponse
rs
ListInstancesResponse
-> Getting (First Text) ListInstancesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListInstancesResponse
-> Const (First Text) ListInstancesResponse
Lens' ListInstancesResponse (Maybe Text)
listInstancesResponse_marker ((Maybe Text -> Const (First Text) (Maybe Text))
-> ListInstancesResponse
-> Const (First Text) ListInstancesResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListInstancesResponse 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 ListInstances
forall a. Maybe a
Prelude.Nothing
| Maybe [Instance] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListInstances
ListInstancesResponse
rs
ListInstancesResponse
-> Getting (First [Instance]) ListInstancesResponse [Instance]
-> Maybe [Instance]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Instance] -> Const (First [Instance]) (Maybe [Instance]))
-> ListInstancesResponse
-> Const (First [Instance]) ListInstancesResponse
Lens' ListInstancesResponse (Maybe [Instance])
listInstancesResponse_instances ((Maybe [Instance] -> Const (First [Instance]) (Maybe [Instance]))
-> ListInstancesResponse
-> Const (First [Instance]) ListInstancesResponse)
-> (([Instance] -> Const (First [Instance]) [Instance])
-> Maybe [Instance] -> Const (First [Instance]) (Maybe [Instance]))
-> Getting (First [Instance]) ListInstancesResponse [Instance]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Instance] -> Const (First [Instance]) [Instance])
-> Maybe [Instance] -> Const (First [Instance]) (Maybe [Instance])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe ListInstances
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
ListInstances -> Maybe ListInstances
forall a. a -> Maybe a
Prelude.Just (ListInstances -> Maybe ListInstances)
-> ListInstances -> Maybe ListInstances
forall a b. (a -> b) -> a -> b
Prelude.$
ListInstances
rq
ListInstances -> (ListInstances -> ListInstances) -> ListInstances
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> ListInstances -> Identity ListInstances
Lens ListInstances ListInstances (Maybe Text) (Maybe Text)
listInstances_marker
((Maybe Text -> Identity (Maybe Text))
-> ListInstances -> Identity ListInstances)
-> Maybe Text -> ListInstances -> ListInstances
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListInstances
ListInstancesResponse
rs
ListInstancesResponse
-> Getting (First Text) ListInstancesResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> ListInstancesResponse
-> Const (First Text) ListInstancesResponse
Lens' ListInstancesResponse (Maybe Text)
listInstancesResponse_marker ((Maybe Text -> Const (First Text) (Maybe Text))
-> ListInstancesResponse
-> Const (First Text) ListInstancesResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) ListInstancesResponse 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 ListInstances where
type
AWSResponse ListInstances =
ListInstancesResponse
request :: ListInstances -> Request ListInstances
request = Service -> ListInstances -> Request ListInstances
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy ListInstances
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListInstances)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListInstances))
-> Logger
-> Service
-> Proxy ListInstances
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListInstances)))
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 [Instance] -> Int -> ListInstancesResponse
ListInstancesResponse'
(Maybe Text -> Maybe [Instance] -> Int -> ListInstancesResponse)
-> Either String (Maybe Text)
-> Either String (Maybe [Instance] -> Int -> ListInstancesResponse)
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
"Marker")
Either String (Maybe [Instance] -> Int -> ListInstancesResponse)
-> Either String (Maybe [Instance])
-> Either String (Int -> ListInstancesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe (Maybe [Instance]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Instances" Either String (Maybe (Maybe [Instance]))
-> Maybe [Instance] -> Either String (Maybe [Instance])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Instance]
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> ListInstancesResponse)
-> Either String Int -> Either String ListInstancesResponse
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 ListInstances
instance Prelude.NFData ListInstances
instance Core.ToHeaders ListInstances where
toHeaders :: ListInstances -> ResponseHeaders
toHeaders =
ResponseHeaders -> ListInstances -> 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
"ElasticMapReduce.ListInstances" ::
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 ListInstances where
toJSON :: ListInstances -> Value
toJSON ListInstances' {Maybe [InstanceGroupType]
Maybe [InstanceState]
Maybe Text
Maybe InstanceFleetType
Text
clusterId :: Text
instanceGroupId :: Maybe Text
instanceStates :: Maybe [InstanceState]
instanceFleetId :: Maybe Text
marker :: Maybe Text
instanceFleetType :: Maybe InstanceFleetType
instanceGroupTypes :: Maybe [InstanceGroupType]
$sel:clusterId:ListInstances' :: ListInstances -> Text
$sel:instanceGroupId:ListInstances' :: ListInstances -> Maybe Text
$sel:instanceStates:ListInstances' :: ListInstances -> Maybe [InstanceState]
$sel:instanceFleetId:ListInstances' :: ListInstances -> Maybe Text
$sel:marker:ListInstances' :: ListInstances -> Maybe Text
$sel:instanceFleetType:ListInstances' :: ListInstances -> Maybe InstanceFleetType
$sel:instanceGroupTypes:ListInstances' :: ListInstances -> Maybe [InstanceGroupType]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"InstanceGroupTypes" Text -> [InstanceGroupType] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([InstanceGroupType] -> Pair)
-> Maybe [InstanceGroupType] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [InstanceGroupType]
instanceGroupTypes,
(Text
"InstanceFleetType" Text -> InstanceFleetType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(InstanceFleetType -> Pair)
-> Maybe InstanceFleetType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe InstanceFleetType
instanceFleetType,
(Text
"Marker" 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
marker,
(Text
"InstanceFleetId" 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
instanceFleetId,
(Text
"InstanceStates" Text -> [InstanceState] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([InstanceState] -> Pair) -> Maybe [InstanceState] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [InstanceState]
instanceStates,
(Text
"InstanceGroupId" 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
instanceGroupId,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ClusterId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
clusterId)
]
)
instance Core.ToPath ListInstances where
toPath :: ListInstances -> ByteString
toPath = ByteString -> ListInstances -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery ListInstances where
toQuery :: ListInstances -> QueryString
toQuery = QueryString -> ListInstances -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data ListInstancesResponse = ListInstancesResponse'
{
ListInstancesResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
ListInstancesResponse -> Maybe [Instance]
instances :: Prelude.Maybe [Instance],
ListInstancesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListInstancesResponse -> ListInstancesResponse -> Bool
(ListInstancesResponse -> ListInstancesResponse -> Bool)
-> (ListInstancesResponse -> ListInstancesResponse -> Bool)
-> Eq ListInstancesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListInstancesResponse -> ListInstancesResponse -> Bool
$c/= :: ListInstancesResponse -> ListInstancesResponse -> Bool
== :: ListInstancesResponse -> ListInstancesResponse -> Bool
$c== :: ListInstancesResponse -> ListInstancesResponse -> Bool
Prelude.Eq, ReadPrec [ListInstancesResponse]
ReadPrec ListInstancesResponse
Int -> ReadS ListInstancesResponse
ReadS [ListInstancesResponse]
(Int -> ReadS ListInstancesResponse)
-> ReadS [ListInstancesResponse]
-> ReadPrec ListInstancesResponse
-> ReadPrec [ListInstancesResponse]
-> Read ListInstancesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListInstancesResponse]
$creadListPrec :: ReadPrec [ListInstancesResponse]
readPrec :: ReadPrec ListInstancesResponse
$creadPrec :: ReadPrec ListInstancesResponse
readList :: ReadS [ListInstancesResponse]
$creadList :: ReadS [ListInstancesResponse]
readsPrec :: Int -> ReadS ListInstancesResponse
$creadsPrec :: Int -> ReadS ListInstancesResponse
Prelude.Read, Int -> ListInstancesResponse -> ShowS
[ListInstancesResponse] -> ShowS
ListInstancesResponse -> String
(Int -> ListInstancesResponse -> ShowS)
-> (ListInstancesResponse -> String)
-> ([ListInstancesResponse] -> ShowS)
-> Show ListInstancesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListInstancesResponse] -> ShowS
$cshowList :: [ListInstancesResponse] -> ShowS
show :: ListInstancesResponse -> String
$cshow :: ListInstancesResponse -> String
showsPrec :: Int -> ListInstancesResponse -> ShowS
$cshowsPrec :: Int -> ListInstancesResponse -> ShowS
Prelude.Show, (forall x. ListInstancesResponse -> Rep ListInstancesResponse x)
-> (forall x. Rep ListInstancesResponse x -> ListInstancesResponse)
-> Generic ListInstancesResponse
forall x. Rep ListInstancesResponse x -> ListInstancesResponse
forall x. ListInstancesResponse -> Rep ListInstancesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListInstancesResponse x -> ListInstancesResponse
$cfrom :: forall x. ListInstancesResponse -> Rep ListInstancesResponse x
Prelude.Generic)
newListInstancesResponse ::
Prelude.Int ->
ListInstancesResponse
newListInstancesResponse :: Int -> ListInstancesResponse
newListInstancesResponse Int
pHttpStatus_ =
ListInstancesResponse' :: Maybe Text -> Maybe [Instance] -> Int -> ListInstancesResponse
ListInstancesResponse'
{ $sel:marker:ListInstancesResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:instances:ListInstancesResponse' :: Maybe [Instance]
instances = Maybe [Instance]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListInstancesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listInstancesResponse_marker :: Lens.Lens' ListInstancesResponse (Prelude.Maybe Prelude.Text)
listInstancesResponse_marker :: (Maybe Text -> f (Maybe Text))
-> ListInstancesResponse -> f ListInstancesResponse
listInstancesResponse_marker = (ListInstancesResponse -> Maybe Text)
-> (ListInstancesResponse -> Maybe Text -> ListInstancesResponse)
-> Lens' ListInstancesResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstancesResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:ListInstancesResponse' :: ListInstancesResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: ListInstancesResponse
s@ListInstancesResponse' {} Maybe Text
a -> ListInstancesResponse
s {$sel:marker:ListInstancesResponse' :: Maybe Text
marker = Maybe Text
a} :: ListInstancesResponse)
listInstancesResponse_instances :: Lens.Lens' ListInstancesResponse (Prelude.Maybe [Instance])
listInstancesResponse_instances :: (Maybe [Instance] -> f (Maybe [Instance]))
-> ListInstancesResponse -> f ListInstancesResponse
listInstancesResponse_instances = (ListInstancesResponse -> Maybe [Instance])
-> (ListInstancesResponse
-> Maybe [Instance] -> ListInstancesResponse)
-> Lens' ListInstancesResponse (Maybe [Instance])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstancesResponse' {Maybe [Instance]
instances :: Maybe [Instance]
$sel:instances:ListInstancesResponse' :: ListInstancesResponse -> Maybe [Instance]
instances} -> Maybe [Instance]
instances) (\s :: ListInstancesResponse
s@ListInstancesResponse' {} Maybe [Instance]
a -> ListInstancesResponse
s {$sel:instances:ListInstancesResponse' :: Maybe [Instance]
instances = Maybe [Instance]
a} :: ListInstancesResponse) ((Maybe [Instance] -> f (Maybe [Instance]))
-> ListInstancesResponse -> f ListInstancesResponse)
-> ((Maybe [Instance] -> f (Maybe [Instance]))
-> Maybe [Instance] -> f (Maybe [Instance]))
-> (Maybe [Instance] -> f (Maybe [Instance]))
-> ListInstancesResponse
-> f ListInstancesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Instance] [Instance] [Instance] [Instance]
-> Iso
(Maybe [Instance])
(Maybe [Instance])
(Maybe [Instance])
(Maybe [Instance])
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 [Instance] [Instance] [Instance] [Instance]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listInstancesResponse_httpStatus :: Lens.Lens' ListInstancesResponse Prelude.Int
listInstancesResponse_httpStatus :: (Int -> f Int) -> ListInstancesResponse -> f ListInstancesResponse
listInstancesResponse_httpStatus = (ListInstancesResponse -> Int)
-> (ListInstancesResponse -> Int -> ListInstancesResponse)
-> Lens ListInstancesResponse ListInstancesResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstancesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListInstancesResponse' :: ListInstancesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListInstancesResponse
s@ListInstancesResponse' {} Int
a -> ListInstancesResponse
s {$sel:httpStatus:ListInstancesResponse' :: Int
httpStatus = Int
a} :: ListInstancesResponse)
instance Prelude.NFData ListInstancesResponse