{-# 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.CodeDeploy.BatchGetOnPremisesInstances
(
BatchGetOnPremisesInstances (..),
newBatchGetOnPremisesInstances,
batchGetOnPremisesInstances_instanceNames,
BatchGetOnPremisesInstancesResponse (..),
newBatchGetOnPremisesInstancesResponse,
batchGetOnPremisesInstancesResponse_instanceInfos,
batchGetOnPremisesInstancesResponse_httpStatus,
)
where
import Amazonka.CodeDeploy.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 BatchGetOnPremisesInstances = BatchGetOnPremisesInstances'
{
BatchGetOnPremisesInstances -> [Text]
instanceNames :: [Prelude.Text]
}
deriving (BatchGetOnPremisesInstances -> BatchGetOnPremisesInstances -> Bool
(BatchGetOnPremisesInstances
-> BatchGetOnPremisesInstances -> Bool)
-> (BatchGetOnPremisesInstances
-> BatchGetOnPremisesInstances -> Bool)
-> Eq BatchGetOnPremisesInstances
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetOnPremisesInstances -> BatchGetOnPremisesInstances -> Bool
$c/= :: BatchGetOnPremisesInstances -> BatchGetOnPremisesInstances -> Bool
== :: BatchGetOnPremisesInstances -> BatchGetOnPremisesInstances -> Bool
$c== :: BatchGetOnPremisesInstances -> BatchGetOnPremisesInstances -> Bool
Prelude.Eq, ReadPrec [BatchGetOnPremisesInstances]
ReadPrec BatchGetOnPremisesInstances
Int -> ReadS BatchGetOnPremisesInstances
ReadS [BatchGetOnPremisesInstances]
(Int -> ReadS BatchGetOnPremisesInstances)
-> ReadS [BatchGetOnPremisesInstances]
-> ReadPrec BatchGetOnPremisesInstances
-> ReadPrec [BatchGetOnPremisesInstances]
-> Read BatchGetOnPremisesInstances
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchGetOnPremisesInstances]
$creadListPrec :: ReadPrec [BatchGetOnPremisesInstances]
readPrec :: ReadPrec BatchGetOnPremisesInstances
$creadPrec :: ReadPrec BatchGetOnPremisesInstances
readList :: ReadS [BatchGetOnPremisesInstances]
$creadList :: ReadS [BatchGetOnPremisesInstances]
readsPrec :: Int -> ReadS BatchGetOnPremisesInstances
$creadsPrec :: Int -> ReadS BatchGetOnPremisesInstances
Prelude.Read, Int -> BatchGetOnPremisesInstances -> ShowS
[BatchGetOnPremisesInstances] -> ShowS
BatchGetOnPremisesInstances -> String
(Int -> BatchGetOnPremisesInstances -> ShowS)
-> (BatchGetOnPremisesInstances -> String)
-> ([BatchGetOnPremisesInstances] -> ShowS)
-> Show BatchGetOnPremisesInstances
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetOnPremisesInstances] -> ShowS
$cshowList :: [BatchGetOnPremisesInstances] -> ShowS
show :: BatchGetOnPremisesInstances -> String
$cshow :: BatchGetOnPremisesInstances -> String
showsPrec :: Int -> BatchGetOnPremisesInstances -> ShowS
$cshowsPrec :: Int -> BatchGetOnPremisesInstances -> ShowS
Prelude.Show, (forall x.
BatchGetOnPremisesInstances -> Rep BatchGetOnPremisesInstances x)
-> (forall x.
Rep BatchGetOnPremisesInstances x -> BatchGetOnPremisesInstances)
-> Generic BatchGetOnPremisesInstances
forall x.
Rep BatchGetOnPremisesInstances x -> BatchGetOnPremisesInstances
forall x.
BatchGetOnPremisesInstances -> Rep BatchGetOnPremisesInstances x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchGetOnPremisesInstances x -> BatchGetOnPremisesInstances
$cfrom :: forall x.
BatchGetOnPremisesInstances -> Rep BatchGetOnPremisesInstances x
Prelude.Generic)
newBatchGetOnPremisesInstances ::
BatchGetOnPremisesInstances
newBatchGetOnPremisesInstances :: BatchGetOnPremisesInstances
newBatchGetOnPremisesInstances =
BatchGetOnPremisesInstances' :: [Text] -> BatchGetOnPremisesInstances
BatchGetOnPremisesInstances'
{ $sel:instanceNames:BatchGetOnPremisesInstances' :: [Text]
instanceNames =
[Text]
forall a. Monoid a => a
Prelude.mempty
}
batchGetOnPremisesInstances_instanceNames :: Lens.Lens' BatchGetOnPremisesInstances [Prelude.Text]
batchGetOnPremisesInstances_instanceNames :: ([Text] -> f [Text])
-> BatchGetOnPremisesInstances -> f BatchGetOnPremisesInstances
batchGetOnPremisesInstances_instanceNames = (BatchGetOnPremisesInstances -> [Text])
-> (BatchGetOnPremisesInstances
-> [Text] -> BatchGetOnPremisesInstances)
-> Lens
BatchGetOnPremisesInstances
BatchGetOnPremisesInstances
[Text]
[Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetOnPremisesInstances' {[Text]
instanceNames :: [Text]
$sel:instanceNames:BatchGetOnPremisesInstances' :: BatchGetOnPremisesInstances -> [Text]
instanceNames} -> [Text]
instanceNames) (\s :: BatchGetOnPremisesInstances
s@BatchGetOnPremisesInstances' {} [Text]
a -> BatchGetOnPremisesInstances
s {$sel:instanceNames:BatchGetOnPremisesInstances' :: [Text]
instanceNames = [Text]
a} :: BatchGetOnPremisesInstances) (([Text] -> f [Text])
-> BatchGetOnPremisesInstances -> f BatchGetOnPremisesInstances)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> BatchGetOnPremisesInstances
-> f BatchGetOnPremisesInstances
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Text] -> f [Text]) -> [Text] -> f [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest BatchGetOnPremisesInstances where
type
AWSResponse BatchGetOnPremisesInstances =
BatchGetOnPremisesInstancesResponse
request :: BatchGetOnPremisesInstances -> Request BatchGetOnPremisesInstances
request = Service
-> BatchGetOnPremisesInstances
-> Request BatchGetOnPremisesInstances
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy BatchGetOnPremisesInstances
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse BatchGetOnPremisesInstances)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse BatchGetOnPremisesInstances))
-> Logger
-> Service
-> Proxy BatchGetOnPremisesInstances
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse BatchGetOnPremisesInstances)))
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 [InstanceInfo] -> Int -> BatchGetOnPremisesInstancesResponse
BatchGetOnPremisesInstancesResponse'
(Maybe [InstanceInfo]
-> Int -> BatchGetOnPremisesInstancesResponse)
-> Either String (Maybe [InstanceInfo])
-> Either String (Int -> BatchGetOnPremisesInstancesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [InstanceInfo]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"instanceInfos" Either String (Maybe (Maybe [InstanceInfo]))
-> Maybe [InstanceInfo] -> Either String (Maybe [InstanceInfo])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [InstanceInfo]
forall a. Monoid a => a
Prelude.mempty)
Either String (Int -> BatchGetOnPremisesInstancesResponse)
-> Either String Int
-> Either String BatchGetOnPremisesInstancesResponse
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 BatchGetOnPremisesInstances
instance Prelude.NFData BatchGetOnPremisesInstances
instance Core.ToHeaders BatchGetOnPremisesInstances where
toHeaders :: BatchGetOnPremisesInstances -> ResponseHeaders
toHeaders =
ResponseHeaders -> BatchGetOnPremisesInstances -> 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
"CodeDeploy_20141006.BatchGetOnPremisesInstances" ::
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 BatchGetOnPremisesInstances where
toJSON :: BatchGetOnPremisesInstances -> Value
toJSON BatchGetOnPremisesInstances' {[Text]
instanceNames :: [Text]
$sel:instanceNames:BatchGetOnPremisesInstances' :: BatchGetOnPremisesInstances -> [Text]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"instanceNames" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
instanceNames)
]
)
instance Core.ToPath BatchGetOnPremisesInstances where
toPath :: BatchGetOnPremisesInstances -> ByteString
toPath = ByteString -> BatchGetOnPremisesInstances -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery BatchGetOnPremisesInstances where
toQuery :: BatchGetOnPremisesInstances -> QueryString
toQuery = QueryString -> BatchGetOnPremisesInstances -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data BatchGetOnPremisesInstancesResponse = BatchGetOnPremisesInstancesResponse'
{
BatchGetOnPremisesInstancesResponse -> Maybe [InstanceInfo]
instanceInfos :: Prelude.Maybe [InstanceInfo],
BatchGetOnPremisesInstancesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (BatchGetOnPremisesInstancesResponse
-> BatchGetOnPremisesInstancesResponse -> Bool
(BatchGetOnPremisesInstancesResponse
-> BatchGetOnPremisesInstancesResponse -> Bool)
-> (BatchGetOnPremisesInstancesResponse
-> BatchGetOnPremisesInstancesResponse -> Bool)
-> Eq BatchGetOnPremisesInstancesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetOnPremisesInstancesResponse
-> BatchGetOnPremisesInstancesResponse -> Bool
$c/= :: BatchGetOnPremisesInstancesResponse
-> BatchGetOnPremisesInstancesResponse -> Bool
== :: BatchGetOnPremisesInstancesResponse
-> BatchGetOnPremisesInstancesResponse -> Bool
$c== :: BatchGetOnPremisesInstancesResponse
-> BatchGetOnPremisesInstancesResponse -> Bool
Prelude.Eq, ReadPrec [BatchGetOnPremisesInstancesResponse]
ReadPrec BatchGetOnPremisesInstancesResponse
Int -> ReadS BatchGetOnPremisesInstancesResponse
ReadS [BatchGetOnPremisesInstancesResponse]
(Int -> ReadS BatchGetOnPremisesInstancesResponse)
-> ReadS [BatchGetOnPremisesInstancesResponse]
-> ReadPrec BatchGetOnPremisesInstancesResponse
-> ReadPrec [BatchGetOnPremisesInstancesResponse]
-> Read BatchGetOnPremisesInstancesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchGetOnPremisesInstancesResponse]
$creadListPrec :: ReadPrec [BatchGetOnPremisesInstancesResponse]
readPrec :: ReadPrec BatchGetOnPremisesInstancesResponse
$creadPrec :: ReadPrec BatchGetOnPremisesInstancesResponse
readList :: ReadS [BatchGetOnPremisesInstancesResponse]
$creadList :: ReadS [BatchGetOnPremisesInstancesResponse]
readsPrec :: Int -> ReadS BatchGetOnPremisesInstancesResponse
$creadsPrec :: Int -> ReadS BatchGetOnPremisesInstancesResponse
Prelude.Read, Int -> BatchGetOnPremisesInstancesResponse -> ShowS
[BatchGetOnPremisesInstancesResponse] -> ShowS
BatchGetOnPremisesInstancesResponse -> String
(Int -> BatchGetOnPremisesInstancesResponse -> ShowS)
-> (BatchGetOnPremisesInstancesResponse -> String)
-> ([BatchGetOnPremisesInstancesResponse] -> ShowS)
-> Show BatchGetOnPremisesInstancesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetOnPremisesInstancesResponse] -> ShowS
$cshowList :: [BatchGetOnPremisesInstancesResponse] -> ShowS
show :: BatchGetOnPremisesInstancesResponse -> String
$cshow :: BatchGetOnPremisesInstancesResponse -> String
showsPrec :: Int -> BatchGetOnPremisesInstancesResponse -> ShowS
$cshowsPrec :: Int -> BatchGetOnPremisesInstancesResponse -> ShowS
Prelude.Show, (forall x.
BatchGetOnPremisesInstancesResponse
-> Rep BatchGetOnPremisesInstancesResponse x)
-> (forall x.
Rep BatchGetOnPremisesInstancesResponse x
-> BatchGetOnPremisesInstancesResponse)
-> Generic BatchGetOnPremisesInstancesResponse
forall x.
Rep BatchGetOnPremisesInstancesResponse x
-> BatchGetOnPremisesInstancesResponse
forall x.
BatchGetOnPremisesInstancesResponse
-> Rep BatchGetOnPremisesInstancesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchGetOnPremisesInstancesResponse x
-> BatchGetOnPremisesInstancesResponse
$cfrom :: forall x.
BatchGetOnPremisesInstancesResponse
-> Rep BatchGetOnPremisesInstancesResponse x
Prelude.Generic)
newBatchGetOnPremisesInstancesResponse ::
Prelude.Int ->
BatchGetOnPremisesInstancesResponse
newBatchGetOnPremisesInstancesResponse :: Int -> BatchGetOnPremisesInstancesResponse
newBatchGetOnPremisesInstancesResponse Int
pHttpStatus_ =
BatchGetOnPremisesInstancesResponse' :: Maybe [InstanceInfo] -> Int -> BatchGetOnPremisesInstancesResponse
BatchGetOnPremisesInstancesResponse'
{ $sel:instanceInfos:BatchGetOnPremisesInstancesResponse' :: Maybe [InstanceInfo]
instanceInfos =
Maybe [InstanceInfo]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:BatchGetOnPremisesInstancesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
batchGetOnPremisesInstancesResponse_instanceInfos :: Lens.Lens' BatchGetOnPremisesInstancesResponse (Prelude.Maybe [InstanceInfo])
batchGetOnPremisesInstancesResponse_instanceInfos :: (Maybe [InstanceInfo] -> f (Maybe [InstanceInfo]))
-> BatchGetOnPremisesInstancesResponse
-> f BatchGetOnPremisesInstancesResponse
batchGetOnPremisesInstancesResponse_instanceInfos = (BatchGetOnPremisesInstancesResponse -> Maybe [InstanceInfo])
-> (BatchGetOnPremisesInstancesResponse
-> Maybe [InstanceInfo] -> BatchGetOnPremisesInstancesResponse)
-> Lens
BatchGetOnPremisesInstancesResponse
BatchGetOnPremisesInstancesResponse
(Maybe [InstanceInfo])
(Maybe [InstanceInfo])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetOnPremisesInstancesResponse' {Maybe [InstanceInfo]
instanceInfos :: Maybe [InstanceInfo]
$sel:instanceInfos:BatchGetOnPremisesInstancesResponse' :: BatchGetOnPremisesInstancesResponse -> Maybe [InstanceInfo]
instanceInfos} -> Maybe [InstanceInfo]
instanceInfos) (\s :: BatchGetOnPremisesInstancesResponse
s@BatchGetOnPremisesInstancesResponse' {} Maybe [InstanceInfo]
a -> BatchGetOnPremisesInstancesResponse
s {$sel:instanceInfos:BatchGetOnPremisesInstancesResponse' :: Maybe [InstanceInfo]
instanceInfos = Maybe [InstanceInfo]
a} :: BatchGetOnPremisesInstancesResponse) ((Maybe [InstanceInfo] -> f (Maybe [InstanceInfo]))
-> BatchGetOnPremisesInstancesResponse
-> f BatchGetOnPremisesInstancesResponse)
-> ((Maybe [InstanceInfo] -> f (Maybe [InstanceInfo]))
-> Maybe [InstanceInfo] -> f (Maybe [InstanceInfo]))
-> (Maybe [InstanceInfo] -> f (Maybe [InstanceInfo]))
-> BatchGetOnPremisesInstancesResponse
-> f BatchGetOnPremisesInstancesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [InstanceInfo] [InstanceInfo] [InstanceInfo] [InstanceInfo]
-> Iso
(Maybe [InstanceInfo])
(Maybe [InstanceInfo])
(Maybe [InstanceInfo])
(Maybe [InstanceInfo])
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 [InstanceInfo] [InstanceInfo] [InstanceInfo] [InstanceInfo]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
batchGetOnPremisesInstancesResponse_httpStatus :: Lens.Lens' BatchGetOnPremisesInstancesResponse Prelude.Int
batchGetOnPremisesInstancesResponse_httpStatus :: (Int -> f Int)
-> BatchGetOnPremisesInstancesResponse
-> f BatchGetOnPremisesInstancesResponse
batchGetOnPremisesInstancesResponse_httpStatus = (BatchGetOnPremisesInstancesResponse -> Int)
-> (BatchGetOnPremisesInstancesResponse
-> Int -> BatchGetOnPremisesInstancesResponse)
-> Lens
BatchGetOnPremisesInstancesResponse
BatchGetOnPremisesInstancesResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetOnPremisesInstancesResponse' {Int
httpStatus :: Int
$sel:httpStatus:BatchGetOnPremisesInstancesResponse' :: BatchGetOnPremisesInstancesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: BatchGetOnPremisesInstancesResponse
s@BatchGetOnPremisesInstancesResponse' {} Int
a -> BatchGetOnPremisesInstancesResponse
s {$sel:httpStatus:BatchGetOnPremisesInstancesResponse' :: Int
httpStatus = Int
a} :: BatchGetOnPremisesInstancesResponse)
instance
Prelude.NFData
BatchGetOnPremisesInstancesResponse