{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.CodeDeploy.BatchGetDeploymentTargets
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns an array of one or more targets associated with a deployment.
-- This method works with all compute types and should be used instead of
-- the deprecated @BatchGetDeploymentInstances@. The maximum number of
-- targets that can be returned is 25.
--
-- The type of targets returned depends on the deployment\'s compute
-- platform or deployment method:
--
-- -   __EC2\/On-premises__: Information about EC2 instance targets.
--
-- -   __AWS Lambda__: Information about Lambda functions targets.
--
-- -   __Amazon ECS__: Information about Amazon ECS service targets.
--
-- -   __CloudFormation__: Information about targets of blue\/green
--     deployments initiated by a CloudFormation stack update.
module Amazonka.CodeDeploy.BatchGetDeploymentTargets
  ( -- * Creating a Request
    BatchGetDeploymentTargets (..),
    newBatchGetDeploymentTargets,

    -- * Request Lenses
    batchGetDeploymentTargets_deploymentId,
    batchGetDeploymentTargets_targetIds,

    -- * Destructuring the Response
    BatchGetDeploymentTargetsResponse (..),
    newBatchGetDeploymentTargetsResponse,

    -- * Response Lenses
    batchGetDeploymentTargetsResponse_deploymentTargets,
    batchGetDeploymentTargetsResponse_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

-- | /See:/ 'newBatchGetDeploymentTargets' smart constructor.
data BatchGetDeploymentTargets = BatchGetDeploymentTargets'
  { -- | The unique ID of a deployment.
    BatchGetDeploymentTargets -> Maybe Text
deploymentId :: Prelude.Maybe Prelude.Text,
    -- | The unique IDs of the deployment targets. The compute platform of the
    -- deployment determines the type of the targets and their formats. The
    -- maximum number of deployment target IDs you can specify is 25.
    --
    -- -   For deployments that use the EC2\/On-premises compute platform, the
    --     target IDs are EC2 or on-premises instances IDs, and their target
    --     type is @instanceTarget@.
    --
    -- -   For deployments that use the AWS Lambda compute platform, the target
    --     IDs are the names of Lambda functions, and their target type is
    --     @instanceTarget@.
    --
    -- -   For deployments that use the Amazon ECS compute platform, the target
    --     IDs are pairs of Amazon ECS clusters and services specified using
    --     the format @\<clustername>:\<servicename>@. Their target type is
    --     @ecsTarget@.
    --
    -- -   For deployments that are deployed with AWS CloudFormation, the
    --     target IDs are CloudFormation stack IDs. Their target type is
    --     @cloudFormationTarget@.
    BatchGetDeploymentTargets -> Maybe [Text]
targetIds :: Prelude.Maybe [Prelude.Text]
  }
  deriving (BatchGetDeploymentTargets -> BatchGetDeploymentTargets -> Bool
(BatchGetDeploymentTargets -> BatchGetDeploymentTargets -> Bool)
-> (BatchGetDeploymentTargets -> BatchGetDeploymentTargets -> Bool)
-> Eq BatchGetDeploymentTargets
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetDeploymentTargets -> BatchGetDeploymentTargets -> Bool
$c/= :: BatchGetDeploymentTargets -> BatchGetDeploymentTargets -> Bool
== :: BatchGetDeploymentTargets -> BatchGetDeploymentTargets -> Bool
$c== :: BatchGetDeploymentTargets -> BatchGetDeploymentTargets -> Bool
Prelude.Eq, ReadPrec [BatchGetDeploymentTargets]
ReadPrec BatchGetDeploymentTargets
Int -> ReadS BatchGetDeploymentTargets
ReadS [BatchGetDeploymentTargets]
(Int -> ReadS BatchGetDeploymentTargets)
-> ReadS [BatchGetDeploymentTargets]
-> ReadPrec BatchGetDeploymentTargets
-> ReadPrec [BatchGetDeploymentTargets]
-> Read BatchGetDeploymentTargets
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchGetDeploymentTargets]
$creadListPrec :: ReadPrec [BatchGetDeploymentTargets]
readPrec :: ReadPrec BatchGetDeploymentTargets
$creadPrec :: ReadPrec BatchGetDeploymentTargets
readList :: ReadS [BatchGetDeploymentTargets]
$creadList :: ReadS [BatchGetDeploymentTargets]
readsPrec :: Int -> ReadS BatchGetDeploymentTargets
$creadsPrec :: Int -> ReadS BatchGetDeploymentTargets
Prelude.Read, Int -> BatchGetDeploymentTargets -> ShowS
[BatchGetDeploymentTargets] -> ShowS
BatchGetDeploymentTargets -> String
(Int -> BatchGetDeploymentTargets -> ShowS)
-> (BatchGetDeploymentTargets -> String)
-> ([BatchGetDeploymentTargets] -> ShowS)
-> Show BatchGetDeploymentTargets
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetDeploymentTargets] -> ShowS
$cshowList :: [BatchGetDeploymentTargets] -> ShowS
show :: BatchGetDeploymentTargets -> String
$cshow :: BatchGetDeploymentTargets -> String
showsPrec :: Int -> BatchGetDeploymentTargets -> ShowS
$cshowsPrec :: Int -> BatchGetDeploymentTargets -> ShowS
Prelude.Show, (forall x.
 BatchGetDeploymentTargets -> Rep BatchGetDeploymentTargets x)
-> (forall x.
    Rep BatchGetDeploymentTargets x -> BatchGetDeploymentTargets)
-> Generic BatchGetDeploymentTargets
forall x.
Rep BatchGetDeploymentTargets x -> BatchGetDeploymentTargets
forall x.
BatchGetDeploymentTargets -> Rep BatchGetDeploymentTargets x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchGetDeploymentTargets x -> BatchGetDeploymentTargets
$cfrom :: forall x.
BatchGetDeploymentTargets -> Rep BatchGetDeploymentTargets x
Prelude.Generic)

-- |
-- Create a value of 'BatchGetDeploymentTargets' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'deploymentId', 'batchGetDeploymentTargets_deploymentId' - The unique ID of a deployment.
--
-- 'targetIds', 'batchGetDeploymentTargets_targetIds' - The unique IDs of the deployment targets. The compute platform of the
-- deployment determines the type of the targets and their formats. The
-- maximum number of deployment target IDs you can specify is 25.
--
-- -   For deployments that use the EC2\/On-premises compute platform, the
--     target IDs are EC2 or on-premises instances IDs, and their target
--     type is @instanceTarget@.
--
-- -   For deployments that use the AWS Lambda compute platform, the target
--     IDs are the names of Lambda functions, and their target type is
--     @instanceTarget@.
--
-- -   For deployments that use the Amazon ECS compute platform, the target
--     IDs are pairs of Amazon ECS clusters and services specified using
--     the format @\<clustername>:\<servicename>@. Their target type is
--     @ecsTarget@.
--
-- -   For deployments that are deployed with AWS CloudFormation, the
--     target IDs are CloudFormation stack IDs. Their target type is
--     @cloudFormationTarget@.
newBatchGetDeploymentTargets ::
  BatchGetDeploymentTargets
newBatchGetDeploymentTargets :: BatchGetDeploymentTargets
newBatchGetDeploymentTargets =
  BatchGetDeploymentTargets' :: Maybe Text -> Maybe [Text] -> BatchGetDeploymentTargets
BatchGetDeploymentTargets'
    { $sel:deploymentId:BatchGetDeploymentTargets' :: Maybe Text
deploymentId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:targetIds:BatchGetDeploymentTargets' :: Maybe [Text]
targetIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing
    }

-- | The unique ID of a deployment.
batchGetDeploymentTargets_deploymentId :: Lens.Lens' BatchGetDeploymentTargets (Prelude.Maybe Prelude.Text)
batchGetDeploymentTargets_deploymentId :: (Maybe Text -> f (Maybe Text))
-> BatchGetDeploymentTargets -> f BatchGetDeploymentTargets
batchGetDeploymentTargets_deploymentId = (BatchGetDeploymentTargets -> Maybe Text)
-> (BatchGetDeploymentTargets
    -> Maybe Text -> BatchGetDeploymentTargets)
-> Lens
     BatchGetDeploymentTargets
     BatchGetDeploymentTargets
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetDeploymentTargets' {Maybe Text
deploymentId :: Maybe Text
$sel:deploymentId:BatchGetDeploymentTargets' :: BatchGetDeploymentTargets -> Maybe Text
deploymentId} -> Maybe Text
deploymentId) (\s :: BatchGetDeploymentTargets
s@BatchGetDeploymentTargets' {} Maybe Text
a -> BatchGetDeploymentTargets
s {$sel:deploymentId:BatchGetDeploymentTargets' :: Maybe Text
deploymentId = Maybe Text
a} :: BatchGetDeploymentTargets)

-- | The unique IDs of the deployment targets. The compute platform of the
-- deployment determines the type of the targets and their formats. The
-- maximum number of deployment target IDs you can specify is 25.
--
-- -   For deployments that use the EC2\/On-premises compute platform, the
--     target IDs are EC2 or on-premises instances IDs, and their target
--     type is @instanceTarget@.
--
-- -   For deployments that use the AWS Lambda compute platform, the target
--     IDs are the names of Lambda functions, and their target type is
--     @instanceTarget@.
--
-- -   For deployments that use the Amazon ECS compute platform, the target
--     IDs are pairs of Amazon ECS clusters and services specified using
--     the format @\<clustername>:\<servicename>@. Their target type is
--     @ecsTarget@.
--
-- -   For deployments that are deployed with AWS CloudFormation, the
--     target IDs are CloudFormation stack IDs. Their target type is
--     @cloudFormationTarget@.
batchGetDeploymentTargets_targetIds :: Lens.Lens' BatchGetDeploymentTargets (Prelude.Maybe [Prelude.Text])
batchGetDeploymentTargets_targetIds :: (Maybe [Text] -> f (Maybe [Text]))
-> BatchGetDeploymentTargets -> f BatchGetDeploymentTargets
batchGetDeploymentTargets_targetIds = (BatchGetDeploymentTargets -> Maybe [Text])
-> (BatchGetDeploymentTargets
    -> Maybe [Text] -> BatchGetDeploymentTargets)
-> Lens
     BatchGetDeploymentTargets
     BatchGetDeploymentTargets
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetDeploymentTargets' {Maybe [Text]
targetIds :: Maybe [Text]
$sel:targetIds:BatchGetDeploymentTargets' :: BatchGetDeploymentTargets -> Maybe [Text]
targetIds} -> Maybe [Text]
targetIds) (\s :: BatchGetDeploymentTargets
s@BatchGetDeploymentTargets' {} Maybe [Text]
a -> BatchGetDeploymentTargets
s {$sel:targetIds:BatchGetDeploymentTargets' :: Maybe [Text]
targetIds = Maybe [Text]
a} :: BatchGetDeploymentTargets) ((Maybe [Text] -> f (Maybe [Text]))
 -> BatchGetDeploymentTargets -> f BatchGetDeploymentTargets)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> BatchGetDeploymentTargets
-> f BatchGetDeploymentTargets
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

instance Core.AWSRequest BatchGetDeploymentTargets where
  type
    AWSResponse BatchGetDeploymentTargets =
      BatchGetDeploymentTargetsResponse
  request :: BatchGetDeploymentTargets -> Request BatchGetDeploymentTargets
request = Service
-> BatchGetDeploymentTargets -> Request BatchGetDeploymentTargets
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy BatchGetDeploymentTargets
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse BatchGetDeploymentTargets)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse BatchGetDeploymentTargets))
-> Logger
-> Service
-> Proxy BatchGetDeploymentTargets
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse BatchGetDeploymentTargets)))
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 [DeploymentTarget]
-> Int -> BatchGetDeploymentTargetsResponse
BatchGetDeploymentTargetsResponse'
            (Maybe [DeploymentTarget]
 -> Int -> BatchGetDeploymentTargetsResponse)
-> Either String (Maybe [DeploymentTarget])
-> Either String (Int -> BatchGetDeploymentTargetsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Either String (Maybe (Maybe [DeploymentTarget]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"deploymentTargets"
                            Either String (Maybe (Maybe [DeploymentTarget]))
-> Maybe [DeploymentTarget]
-> Either String (Maybe [DeploymentTarget])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [DeploymentTarget]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> BatchGetDeploymentTargetsResponse)
-> Either String Int
-> Either String BatchGetDeploymentTargetsResponse
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 BatchGetDeploymentTargets

instance Prelude.NFData BatchGetDeploymentTargets

instance Core.ToHeaders BatchGetDeploymentTargets where
  toHeaders :: BatchGetDeploymentTargets -> ResponseHeaders
toHeaders =
    ResponseHeaders -> BatchGetDeploymentTargets -> 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.BatchGetDeploymentTargets" ::
                          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 BatchGetDeploymentTargets where
  toJSON :: BatchGetDeploymentTargets -> Value
toJSON BatchGetDeploymentTargets' {Maybe [Text]
Maybe Text
targetIds :: Maybe [Text]
deploymentId :: Maybe Text
$sel:targetIds:BatchGetDeploymentTargets' :: BatchGetDeploymentTargets -> Maybe [Text]
$sel:deploymentId:BatchGetDeploymentTargets' :: BatchGetDeploymentTargets -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"deploymentId" 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
deploymentId,
            (Text
"targetIds" 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]
targetIds
          ]
      )

instance Core.ToPath BatchGetDeploymentTargets where
  toPath :: BatchGetDeploymentTargets -> ByteString
toPath = ByteString -> BatchGetDeploymentTargets -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Core.ToQuery BatchGetDeploymentTargets where
  toQuery :: BatchGetDeploymentTargets -> QueryString
toQuery = QueryString -> BatchGetDeploymentTargets -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newBatchGetDeploymentTargetsResponse' smart constructor.
data BatchGetDeploymentTargetsResponse = BatchGetDeploymentTargetsResponse'
  { -- | A list of target objects for a deployment. Each target object contains
    -- details about the target, such as its status and lifecycle events. The
    -- type of the target objects depends on the deployment\' compute platform.
    --
    -- -   __EC2\/On-premises__: Each target object is an EC2 or on-premises
    --     instance.
    --
    -- -   __AWS Lambda__: The target object is a specific version of an AWS
    --     Lambda function.
    --
    -- -   __Amazon ECS__: The target object is an Amazon ECS service.
    --
    -- -   __CloudFormation__: The target object is an AWS CloudFormation
    --     blue\/green deployment.
    BatchGetDeploymentTargetsResponse -> Maybe [DeploymentTarget]
deploymentTargets :: Prelude.Maybe [DeploymentTarget],
    -- | The response's http status code.
    BatchGetDeploymentTargetsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (BatchGetDeploymentTargetsResponse
-> BatchGetDeploymentTargetsResponse -> Bool
(BatchGetDeploymentTargetsResponse
 -> BatchGetDeploymentTargetsResponse -> Bool)
-> (BatchGetDeploymentTargetsResponse
    -> BatchGetDeploymentTargetsResponse -> Bool)
-> Eq BatchGetDeploymentTargetsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetDeploymentTargetsResponse
-> BatchGetDeploymentTargetsResponse -> Bool
$c/= :: BatchGetDeploymentTargetsResponse
-> BatchGetDeploymentTargetsResponse -> Bool
== :: BatchGetDeploymentTargetsResponse
-> BatchGetDeploymentTargetsResponse -> Bool
$c== :: BatchGetDeploymentTargetsResponse
-> BatchGetDeploymentTargetsResponse -> Bool
Prelude.Eq, ReadPrec [BatchGetDeploymentTargetsResponse]
ReadPrec BatchGetDeploymentTargetsResponse
Int -> ReadS BatchGetDeploymentTargetsResponse
ReadS [BatchGetDeploymentTargetsResponse]
(Int -> ReadS BatchGetDeploymentTargetsResponse)
-> ReadS [BatchGetDeploymentTargetsResponse]
-> ReadPrec BatchGetDeploymentTargetsResponse
-> ReadPrec [BatchGetDeploymentTargetsResponse]
-> Read BatchGetDeploymentTargetsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchGetDeploymentTargetsResponse]
$creadListPrec :: ReadPrec [BatchGetDeploymentTargetsResponse]
readPrec :: ReadPrec BatchGetDeploymentTargetsResponse
$creadPrec :: ReadPrec BatchGetDeploymentTargetsResponse
readList :: ReadS [BatchGetDeploymentTargetsResponse]
$creadList :: ReadS [BatchGetDeploymentTargetsResponse]
readsPrec :: Int -> ReadS BatchGetDeploymentTargetsResponse
$creadsPrec :: Int -> ReadS BatchGetDeploymentTargetsResponse
Prelude.Read, Int -> BatchGetDeploymentTargetsResponse -> ShowS
[BatchGetDeploymentTargetsResponse] -> ShowS
BatchGetDeploymentTargetsResponse -> String
(Int -> BatchGetDeploymentTargetsResponse -> ShowS)
-> (BatchGetDeploymentTargetsResponse -> String)
-> ([BatchGetDeploymentTargetsResponse] -> ShowS)
-> Show BatchGetDeploymentTargetsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetDeploymentTargetsResponse] -> ShowS
$cshowList :: [BatchGetDeploymentTargetsResponse] -> ShowS
show :: BatchGetDeploymentTargetsResponse -> String
$cshow :: BatchGetDeploymentTargetsResponse -> String
showsPrec :: Int -> BatchGetDeploymentTargetsResponse -> ShowS
$cshowsPrec :: Int -> BatchGetDeploymentTargetsResponse -> ShowS
Prelude.Show, (forall x.
 BatchGetDeploymentTargetsResponse
 -> Rep BatchGetDeploymentTargetsResponse x)
-> (forall x.
    Rep BatchGetDeploymentTargetsResponse x
    -> BatchGetDeploymentTargetsResponse)
-> Generic BatchGetDeploymentTargetsResponse
forall x.
Rep BatchGetDeploymentTargetsResponse x
-> BatchGetDeploymentTargetsResponse
forall x.
BatchGetDeploymentTargetsResponse
-> Rep BatchGetDeploymentTargetsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchGetDeploymentTargetsResponse x
-> BatchGetDeploymentTargetsResponse
$cfrom :: forall x.
BatchGetDeploymentTargetsResponse
-> Rep BatchGetDeploymentTargetsResponse x
Prelude.Generic)

-- |
-- Create a value of 'BatchGetDeploymentTargetsResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'deploymentTargets', 'batchGetDeploymentTargetsResponse_deploymentTargets' - A list of target objects for a deployment. Each target object contains
-- details about the target, such as its status and lifecycle events. The
-- type of the target objects depends on the deployment\' compute platform.
--
-- -   __EC2\/On-premises__: Each target object is an EC2 or on-premises
--     instance.
--
-- -   __AWS Lambda__: The target object is a specific version of an AWS
--     Lambda function.
--
-- -   __Amazon ECS__: The target object is an Amazon ECS service.
--
-- -   __CloudFormation__: The target object is an AWS CloudFormation
--     blue\/green deployment.
--
-- 'httpStatus', 'batchGetDeploymentTargetsResponse_httpStatus' - The response's http status code.
newBatchGetDeploymentTargetsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  BatchGetDeploymentTargetsResponse
newBatchGetDeploymentTargetsResponse :: Int -> BatchGetDeploymentTargetsResponse
newBatchGetDeploymentTargetsResponse Int
pHttpStatus_ =
  BatchGetDeploymentTargetsResponse' :: Maybe [DeploymentTarget]
-> Int -> BatchGetDeploymentTargetsResponse
BatchGetDeploymentTargetsResponse'
    { $sel:deploymentTargets:BatchGetDeploymentTargetsResponse' :: Maybe [DeploymentTarget]
deploymentTargets =
        Maybe [DeploymentTarget]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:BatchGetDeploymentTargetsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of target objects for a deployment. Each target object contains
-- details about the target, such as its status and lifecycle events. The
-- type of the target objects depends on the deployment\' compute platform.
--
-- -   __EC2\/On-premises__: Each target object is an EC2 or on-premises
--     instance.
--
-- -   __AWS Lambda__: The target object is a specific version of an AWS
--     Lambda function.
--
-- -   __Amazon ECS__: The target object is an Amazon ECS service.
--
-- -   __CloudFormation__: The target object is an AWS CloudFormation
--     blue\/green deployment.
batchGetDeploymentTargetsResponse_deploymentTargets :: Lens.Lens' BatchGetDeploymentTargetsResponse (Prelude.Maybe [DeploymentTarget])
batchGetDeploymentTargetsResponse_deploymentTargets :: (Maybe [DeploymentTarget] -> f (Maybe [DeploymentTarget]))
-> BatchGetDeploymentTargetsResponse
-> f BatchGetDeploymentTargetsResponse
batchGetDeploymentTargetsResponse_deploymentTargets = (BatchGetDeploymentTargetsResponse -> Maybe [DeploymentTarget])
-> (BatchGetDeploymentTargetsResponse
    -> Maybe [DeploymentTarget] -> BatchGetDeploymentTargetsResponse)
-> Lens
     BatchGetDeploymentTargetsResponse
     BatchGetDeploymentTargetsResponse
     (Maybe [DeploymentTarget])
     (Maybe [DeploymentTarget])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetDeploymentTargetsResponse' {Maybe [DeploymentTarget]
deploymentTargets :: Maybe [DeploymentTarget]
$sel:deploymentTargets:BatchGetDeploymentTargetsResponse' :: BatchGetDeploymentTargetsResponse -> Maybe [DeploymentTarget]
deploymentTargets} -> Maybe [DeploymentTarget]
deploymentTargets) (\s :: BatchGetDeploymentTargetsResponse
s@BatchGetDeploymentTargetsResponse' {} Maybe [DeploymentTarget]
a -> BatchGetDeploymentTargetsResponse
s {$sel:deploymentTargets:BatchGetDeploymentTargetsResponse' :: Maybe [DeploymentTarget]
deploymentTargets = Maybe [DeploymentTarget]
a} :: BatchGetDeploymentTargetsResponse) ((Maybe [DeploymentTarget] -> f (Maybe [DeploymentTarget]))
 -> BatchGetDeploymentTargetsResponse
 -> f BatchGetDeploymentTargetsResponse)
-> ((Maybe [DeploymentTarget] -> f (Maybe [DeploymentTarget]))
    -> Maybe [DeploymentTarget] -> f (Maybe [DeploymentTarget]))
-> (Maybe [DeploymentTarget] -> f (Maybe [DeploymentTarget]))
-> BatchGetDeploymentTargetsResponse
-> f BatchGetDeploymentTargetsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [DeploymentTarget]
  [DeploymentTarget]
  [DeploymentTarget]
  [DeploymentTarget]
-> Iso
     (Maybe [DeploymentTarget])
     (Maybe [DeploymentTarget])
     (Maybe [DeploymentTarget])
     (Maybe [DeploymentTarget])
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
  [DeploymentTarget]
  [DeploymentTarget]
  [DeploymentTarget]
  [DeploymentTarget]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The response's http status code.
batchGetDeploymentTargetsResponse_httpStatus :: Lens.Lens' BatchGetDeploymentTargetsResponse Prelude.Int
batchGetDeploymentTargetsResponse_httpStatus :: (Int -> f Int)
-> BatchGetDeploymentTargetsResponse
-> f BatchGetDeploymentTargetsResponse
batchGetDeploymentTargetsResponse_httpStatus = (BatchGetDeploymentTargetsResponse -> Int)
-> (BatchGetDeploymentTargetsResponse
    -> Int -> BatchGetDeploymentTargetsResponse)
-> Lens
     BatchGetDeploymentTargetsResponse
     BatchGetDeploymentTargetsResponse
     Int
     Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetDeploymentTargetsResponse' {Int
httpStatus :: Int
$sel:httpStatus:BatchGetDeploymentTargetsResponse' :: BatchGetDeploymentTargetsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: BatchGetDeploymentTargetsResponse
s@BatchGetDeploymentTargetsResponse' {} Int
a -> BatchGetDeploymentTargetsResponse
s {$sel:httpStatus:BatchGetDeploymentTargetsResponse' :: Int
httpStatus = Int
a} :: BatchGetDeploymentTargetsResponse)

instance
  Prelude.NFData
    BatchGetDeploymentTargetsResponse