{-# 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.ECS.DescribeContainerInstances
-- 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)
--
-- Describes one or more container instances. Returns metadata about each
-- container instance requested.
module Amazonka.ECS.DescribeContainerInstances
  ( -- * Creating a Request
    DescribeContainerInstances (..),
    newDescribeContainerInstances,

    -- * Request Lenses
    describeContainerInstances_include,
    describeContainerInstances_cluster,
    describeContainerInstances_containerInstances,

    -- * Destructuring the Response
    DescribeContainerInstancesResponse (..),
    newDescribeContainerInstancesResponse,

    -- * Response Lenses
    describeContainerInstancesResponse_failures,
    describeContainerInstancesResponse_containerInstances,
    describeContainerInstancesResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.ECS.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

-- | /See:/ 'newDescribeContainerInstances' smart constructor.
data DescribeContainerInstances = DescribeContainerInstances'
  { -- | Specifies whether you want to see the resource tags for the container
    -- instance. If @TAGS@ is specified, the tags are included in the response.
    -- If this field is omitted, tags are not included in the response.
    DescribeContainerInstances -> Maybe [ContainerInstanceField]
include :: Prelude.Maybe [ContainerInstanceField],
    -- | The short name or full Amazon Resource Name (ARN) of the cluster that
    -- hosts the container instances to describe. If you do not specify a
    -- cluster, the default cluster is assumed. This parameter is required if
    -- the container instance or container instances you are describing were
    -- launched in any cluster other than the default cluster.
    DescribeContainerInstances -> Maybe Text
cluster :: Prelude.Maybe Prelude.Text,
    -- | A list of up to 100 container instance IDs or full Amazon Resource Name
    -- (ARN) entries.
    DescribeContainerInstances -> [Text]
containerInstances :: [Prelude.Text]
  }
  deriving (DescribeContainerInstances -> DescribeContainerInstances -> Bool
(DescribeContainerInstances -> DescribeContainerInstances -> Bool)
-> (DescribeContainerInstances
    -> DescribeContainerInstances -> Bool)
-> Eq DescribeContainerInstances
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeContainerInstances -> DescribeContainerInstances -> Bool
$c/= :: DescribeContainerInstances -> DescribeContainerInstances -> Bool
== :: DescribeContainerInstances -> DescribeContainerInstances -> Bool
$c== :: DescribeContainerInstances -> DescribeContainerInstances -> Bool
Prelude.Eq, ReadPrec [DescribeContainerInstances]
ReadPrec DescribeContainerInstances
Int -> ReadS DescribeContainerInstances
ReadS [DescribeContainerInstances]
(Int -> ReadS DescribeContainerInstances)
-> ReadS [DescribeContainerInstances]
-> ReadPrec DescribeContainerInstances
-> ReadPrec [DescribeContainerInstances]
-> Read DescribeContainerInstances
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeContainerInstances]
$creadListPrec :: ReadPrec [DescribeContainerInstances]
readPrec :: ReadPrec DescribeContainerInstances
$creadPrec :: ReadPrec DescribeContainerInstances
readList :: ReadS [DescribeContainerInstances]
$creadList :: ReadS [DescribeContainerInstances]
readsPrec :: Int -> ReadS DescribeContainerInstances
$creadsPrec :: Int -> ReadS DescribeContainerInstances
Prelude.Read, Int -> DescribeContainerInstances -> ShowS
[DescribeContainerInstances] -> ShowS
DescribeContainerInstances -> String
(Int -> DescribeContainerInstances -> ShowS)
-> (DescribeContainerInstances -> String)
-> ([DescribeContainerInstances] -> ShowS)
-> Show DescribeContainerInstances
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeContainerInstances] -> ShowS
$cshowList :: [DescribeContainerInstances] -> ShowS
show :: DescribeContainerInstances -> String
$cshow :: DescribeContainerInstances -> String
showsPrec :: Int -> DescribeContainerInstances -> ShowS
$cshowsPrec :: Int -> DescribeContainerInstances -> ShowS
Prelude.Show, (forall x.
 DescribeContainerInstances -> Rep DescribeContainerInstances x)
-> (forall x.
    Rep DescribeContainerInstances x -> DescribeContainerInstances)
-> Generic DescribeContainerInstances
forall x.
Rep DescribeContainerInstances x -> DescribeContainerInstances
forall x.
DescribeContainerInstances -> Rep DescribeContainerInstances x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeContainerInstances x -> DescribeContainerInstances
$cfrom :: forall x.
DescribeContainerInstances -> Rep DescribeContainerInstances x
Prelude.Generic)

-- |
-- Create a value of 'DescribeContainerInstances' 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:
--
-- 'include', 'describeContainerInstances_include' - Specifies whether you want to see the resource tags for the container
-- instance. If @TAGS@ is specified, the tags are included in the response.
-- If this field is omitted, tags are not included in the response.
--
-- 'cluster', 'describeContainerInstances_cluster' - The short name or full Amazon Resource Name (ARN) of the cluster that
-- hosts the container instances to describe. If you do not specify a
-- cluster, the default cluster is assumed. This parameter is required if
-- the container instance or container instances you are describing were
-- launched in any cluster other than the default cluster.
--
-- 'containerInstances', 'describeContainerInstances_containerInstances' - A list of up to 100 container instance IDs or full Amazon Resource Name
-- (ARN) entries.
newDescribeContainerInstances ::
  DescribeContainerInstances
newDescribeContainerInstances :: DescribeContainerInstances
newDescribeContainerInstances =
  DescribeContainerInstances' :: Maybe [ContainerInstanceField]
-> Maybe Text -> [Text] -> DescribeContainerInstances
DescribeContainerInstances'
    { $sel:include:DescribeContainerInstances' :: Maybe [ContainerInstanceField]
include =
        Maybe [ContainerInstanceField]
forall a. Maybe a
Prelude.Nothing,
      $sel:cluster:DescribeContainerInstances' :: Maybe Text
cluster = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:containerInstances:DescribeContainerInstances' :: [Text]
containerInstances = [Text]
forall a. Monoid a => a
Prelude.mempty
    }

-- | Specifies whether you want to see the resource tags for the container
-- instance. If @TAGS@ is specified, the tags are included in the response.
-- If this field is omitted, tags are not included in the response.
describeContainerInstances_include :: Lens.Lens' DescribeContainerInstances (Prelude.Maybe [ContainerInstanceField])
describeContainerInstances_include :: (Maybe [ContainerInstanceField]
 -> f (Maybe [ContainerInstanceField]))
-> DescribeContainerInstances -> f DescribeContainerInstances
describeContainerInstances_include = (DescribeContainerInstances -> Maybe [ContainerInstanceField])
-> (DescribeContainerInstances
    -> Maybe [ContainerInstanceField] -> DescribeContainerInstances)
-> Lens
     DescribeContainerInstances
     DescribeContainerInstances
     (Maybe [ContainerInstanceField])
     (Maybe [ContainerInstanceField])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeContainerInstances' {Maybe [ContainerInstanceField]
include :: Maybe [ContainerInstanceField]
$sel:include:DescribeContainerInstances' :: DescribeContainerInstances -> Maybe [ContainerInstanceField]
include} -> Maybe [ContainerInstanceField]
include) (\s :: DescribeContainerInstances
s@DescribeContainerInstances' {} Maybe [ContainerInstanceField]
a -> DescribeContainerInstances
s {$sel:include:DescribeContainerInstances' :: Maybe [ContainerInstanceField]
include = Maybe [ContainerInstanceField]
a} :: DescribeContainerInstances) ((Maybe [ContainerInstanceField]
  -> f (Maybe [ContainerInstanceField]))
 -> DescribeContainerInstances -> f DescribeContainerInstances)
-> ((Maybe [ContainerInstanceField]
     -> f (Maybe [ContainerInstanceField]))
    -> Maybe [ContainerInstanceField]
    -> f (Maybe [ContainerInstanceField]))
-> (Maybe [ContainerInstanceField]
    -> f (Maybe [ContainerInstanceField]))
-> DescribeContainerInstances
-> f DescribeContainerInstances
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ContainerInstanceField]
  [ContainerInstanceField]
  [ContainerInstanceField]
  [ContainerInstanceField]
-> Iso
     (Maybe [ContainerInstanceField])
     (Maybe [ContainerInstanceField])
     (Maybe [ContainerInstanceField])
     (Maybe [ContainerInstanceField])
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
  [ContainerInstanceField]
  [ContainerInstanceField]
  [ContainerInstanceField]
  [ContainerInstanceField]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The short name or full Amazon Resource Name (ARN) of the cluster that
-- hosts the container instances to describe. If you do not specify a
-- cluster, the default cluster is assumed. This parameter is required if
-- the container instance or container instances you are describing were
-- launched in any cluster other than the default cluster.
describeContainerInstances_cluster :: Lens.Lens' DescribeContainerInstances (Prelude.Maybe Prelude.Text)
describeContainerInstances_cluster :: (Maybe Text -> f (Maybe Text))
-> DescribeContainerInstances -> f DescribeContainerInstances
describeContainerInstances_cluster = (DescribeContainerInstances -> Maybe Text)
-> (DescribeContainerInstances
    -> Maybe Text -> DescribeContainerInstances)
-> Lens
     DescribeContainerInstances
     DescribeContainerInstances
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeContainerInstances' {Maybe Text
cluster :: Maybe Text
$sel:cluster:DescribeContainerInstances' :: DescribeContainerInstances -> Maybe Text
cluster} -> Maybe Text
cluster) (\s :: DescribeContainerInstances
s@DescribeContainerInstances' {} Maybe Text
a -> DescribeContainerInstances
s {$sel:cluster:DescribeContainerInstances' :: Maybe Text
cluster = Maybe Text
a} :: DescribeContainerInstances)

-- | A list of up to 100 container instance IDs or full Amazon Resource Name
-- (ARN) entries.
describeContainerInstances_containerInstances :: Lens.Lens' DescribeContainerInstances [Prelude.Text]
describeContainerInstances_containerInstances :: ([Text] -> f [Text])
-> DescribeContainerInstances -> f DescribeContainerInstances
describeContainerInstances_containerInstances = (DescribeContainerInstances -> [Text])
-> (DescribeContainerInstances
    -> [Text] -> DescribeContainerInstances)
-> Lens
     DescribeContainerInstances DescribeContainerInstances [Text] [Text]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeContainerInstances' {[Text]
containerInstances :: [Text]
$sel:containerInstances:DescribeContainerInstances' :: DescribeContainerInstances -> [Text]
containerInstances} -> [Text]
containerInstances) (\s :: DescribeContainerInstances
s@DescribeContainerInstances' {} [Text]
a -> DescribeContainerInstances
s {$sel:containerInstances:DescribeContainerInstances' :: [Text]
containerInstances = [Text]
a} :: DescribeContainerInstances) (([Text] -> f [Text])
 -> DescribeContainerInstances -> f DescribeContainerInstances)
-> (([Text] -> f [Text]) -> [Text] -> f [Text])
-> ([Text] -> f [Text])
-> DescribeContainerInstances
-> f DescribeContainerInstances
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 DescribeContainerInstances where
  type
    AWSResponse DescribeContainerInstances =
      DescribeContainerInstancesResponse
  request :: DescribeContainerInstances -> Request DescribeContainerInstances
request = Service
-> DescribeContainerInstances -> Request DescribeContainerInstances
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeContainerInstances
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeContainerInstances)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeContainerInstances))
-> Logger
-> Service
-> Proxy DescribeContainerInstances
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeContainerInstances)))
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 [Failure]
-> Maybe [ContainerInstance]
-> Int
-> DescribeContainerInstancesResponse
DescribeContainerInstancesResponse'
            (Maybe [Failure]
 -> Maybe [ContainerInstance]
 -> Int
 -> DescribeContainerInstancesResponse)
-> Either String (Maybe [Failure])
-> Either
     String
     (Maybe [ContainerInstance]
      -> Int -> DescribeContainerInstancesResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [Failure]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"failures" Either String (Maybe (Maybe [Failure]))
-> Maybe [Failure] -> Either String (Maybe [Failure])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Failure]
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Maybe [ContainerInstance]
   -> Int -> DescribeContainerInstancesResponse)
-> Either String (Maybe [ContainerInstance])
-> Either String (Int -> DescribeContainerInstancesResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [ContainerInstance]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"containerInstances"
                            Either String (Maybe (Maybe [ContainerInstance]))
-> Maybe [ContainerInstance]
-> Either String (Maybe [ContainerInstance])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ContainerInstance]
forall a. Monoid a => a
Prelude.mempty
                        )
            Either String (Int -> DescribeContainerInstancesResponse)
-> Either String Int
-> Either String DescribeContainerInstancesResponse
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 DescribeContainerInstances

instance Prelude.NFData DescribeContainerInstances

instance Core.ToHeaders DescribeContainerInstances where
  toHeaders :: DescribeContainerInstances -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeContainerInstances -> 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
"AmazonEC2ContainerServiceV20141113.DescribeContainerInstances" ::
                          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 DescribeContainerInstances where
  toJSON :: DescribeContainerInstances -> Value
toJSON DescribeContainerInstances' {[Text]
Maybe [ContainerInstanceField]
Maybe Text
containerInstances :: [Text]
cluster :: Maybe Text
include :: Maybe [ContainerInstanceField]
$sel:containerInstances:DescribeContainerInstances' :: DescribeContainerInstances -> [Text]
$sel:cluster:DescribeContainerInstances' :: DescribeContainerInstances -> Maybe Text
$sel:include:DescribeContainerInstances' :: DescribeContainerInstances -> Maybe [ContainerInstanceField]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"include" Text -> [ContainerInstanceField] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([ContainerInstanceField] -> Pair)
-> Maybe [ContainerInstanceField] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ContainerInstanceField]
include,
            (Text
"cluster" 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
cluster,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"containerInstances" Text -> [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [Text]
containerInstances)
          ]
      )

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

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

-- | /See:/ 'newDescribeContainerInstancesResponse' smart constructor.
data DescribeContainerInstancesResponse = DescribeContainerInstancesResponse'
  { -- | Any failures associated with the call.
    DescribeContainerInstancesResponse -> Maybe [Failure]
failures :: Prelude.Maybe [Failure],
    -- | The list of container instances.
    DescribeContainerInstancesResponse -> Maybe [ContainerInstance]
containerInstances :: Prelude.Maybe [ContainerInstance],
    -- | The response's http status code.
    DescribeContainerInstancesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeContainerInstancesResponse
-> DescribeContainerInstancesResponse -> Bool
(DescribeContainerInstancesResponse
 -> DescribeContainerInstancesResponse -> Bool)
-> (DescribeContainerInstancesResponse
    -> DescribeContainerInstancesResponse -> Bool)
-> Eq DescribeContainerInstancesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeContainerInstancesResponse
-> DescribeContainerInstancesResponse -> Bool
$c/= :: DescribeContainerInstancesResponse
-> DescribeContainerInstancesResponse -> Bool
== :: DescribeContainerInstancesResponse
-> DescribeContainerInstancesResponse -> Bool
$c== :: DescribeContainerInstancesResponse
-> DescribeContainerInstancesResponse -> Bool
Prelude.Eq, ReadPrec [DescribeContainerInstancesResponse]
ReadPrec DescribeContainerInstancesResponse
Int -> ReadS DescribeContainerInstancesResponse
ReadS [DescribeContainerInstancesResponse]
(Int -> ReadS DescribeContainerInstancesResponse)
-> ReadS [DescribeContainerInstancesResponse]
-> ReadPrec DescribeContainerInstancesResponse
-> ReadPrec [DescribeContainerInstancesResponse]
-> Read DescribeContainerInstancesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeContainerInstancesResponse]
$creadListPrec :: ReadPrec [DescribeContainerInstancesResponse]
readPrec :: ReadPrec DescribeContainerInstancesResponse
$creadPrec :: ReadPrec DescribeContainerInstancesResponse
readList :: ReadS [DescribeContainerInstancesResponse]
$creadList :: ReadS [DescribeContainerInstancesResponse]
readsPrec :: Int -> ReadS DescribeContainerInstancesResponse
$creadsPrec :: Int -> ReadS DescribeContainerInstancesResponse
Prelude.Read, Int -> DescribeContainerInstancesResponse -> ShowS
[DescribeContainerInstancesResponse] -> ShowS
DescribeContainerInstancesResponse -> String
(Int -> DescribeContainerInstancesResponse -> ShowS)
-> (DescribeContainerInstancesResponse -> String)
-> ([DescribeContainerInstancesResponse] -> ShowS)
-> Show DescribeContainerInstancesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeContainerInstancesResponse] -> ShowS
$cshowList :: [DescribeContainerInstancesResponse] -> ShowS
show :: DescribeContainerInstancesResponse -> String
$cshow :: DescribeContainerInstancesResponse -> String
showsPrec :: Int -> DescribeContainerInstancesResponse -> ShowS
$cshowsPrec :: Int -> DescribeContainerInstancesResponse -> ShowS
Prelude.Show, (forall x.
 DescribeContainerInstancesResponse
 -> Rep DescribeContainerInstancesResponse x)
-> (forall x.
    Rep DescribeContainerInstancesResponse x
    -> DescribeContainerInstancesResponse)
-> Generic DescribeContainerInstancesResponse
forall x.
Rep DescribeContainerInstancesResponse x
-> DescribeContainerInstancesResponse
forall x.
DescribeContainerInstancesResponse
-> Rep DescribeContainerInstancesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeContainerInstancesResponse x
-> DescribeContainerInstancesResponse
$cfrom :: forall x.
DescribeContainerInstancesResponse
-> Rep DescribeContainerInstancesResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeContainerInstancesResponse' 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:
--
-- 'failures', 'describeContainerInstancesResponse_failures' - Any failures associated with the call.
--
-- 'containerInstances', 'describeContainerInstancesResponse_containerInstances' - The list of container instances.
--
-- 'httpStatus', 'describeContainerInstancesResponse_httpStatus' - The response's http status code.
newDescribeContainerInstancesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeContainerInstancesResponse
newDescribeContainerInstancesResponse :: Int -> DescribeContainerInstancesResponse
newDescribeContainerInstancesResponse Int
pHttpStatus_ =
  DescribeContainerInstancesResponse' :: Maybe [Failure]
-> Maybe [ContainerInstance]
-> Int
-> DescribeContainerInstancesResponse
DescribeContainerInstancesResponse'
    { $sel:failures:DescribeContainerInstancesResponse' :: Maybe [Failure]
failures =
        Maybe [Failure]
forall a. Maybe a
Prelude.Nothing,
      $sel:containerInstances:DescribeContainerInstancesResponse' :: Maybe [ContainerInstance]
containerInstances = Maybe [ContainerInstance]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeContainerInstancesResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Any failures associated with the call.
describeContainerInstancesResponse_failures :: Lens.Lens' DescribeContainerInstancesResponse (Prelude.Maybe [Failure])
describeContainerInstancesResponse_failures :: (Maybe [Failure] -> f (Maybe [Failure]))
-> DescribeContainerInstancesResponse
-> f DescribeContainerInstancesResponse
describeContainerInstancesResponse_failures = (DescribeContainerInstancesResponse -> Maybe [Failure])
-> (DescribeContainerInstancesResponse
    -> Maybe [Failure] -> DescribeContainerInstancesResponse)
-> Lens
     DescribeContainerInstancesResponse
     DescribeContainerInstancesResponse
     (Maybe [Failure])
     (Maybe [Failure])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeContainerInstancesResponse' {Maybe [Failure]
failures :: Maybe [Failure]
$sel:failures:DescribeContainerInstancesResponse' :: DescribeContainerInstancesResponse -> Maybe [Failure]
failures} -> Maybe [Failure]
failures) (\s :: DescribeContainerInstancesResponse
s@DescribeContainerInstancesResponse' {} Maybe [Failure]
a -> DescribeContainerInstancesResponse
s {$sel:failures:DescribeContainerInstancesResponse' :: Maybe [Failure]
failures = Maybe [Failure]
a} :: DescribeContainerInstancesResponse) ((Maybe [Failure] -> f (Maybe [Failure]))
 -> DescribeContainerInstancesResponse
 -> f DescribeContainerInstancesResponse)
-> ((Maybe [Failure] -> f (Maybe [Failure]))
    -> Maybe [Failure] -> f (Maybe [Failure]))
-> (Maybe [Failure] -> f (Maybe [Failure]))
-> DescribeContainerInstancesResponse
-> f DescribeContainerInstancesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Failure] [Failure] [Failure] [Failure]
-> Iso
     (Maybe [Failure])
     (Maybe [Failure])
     (Maybe [Failure])
     (Maybe [Failure])
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 [Failure] [Failure] [Failure] [Failure]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The list of container instances.
describeContainerInstancesResponse_containerInstances :: Lens.Lens' DescribeContainerInstancesResponse (Prelude.Maybe [ContainerInstance])
describeContainerInstancesResponse_containerInstances :: (Maybe [ContainerInstance] -> f (Maybe [ContainerInstance]))
-> DescribeContainerInstancesResponse
-> f DescribeContainerInstancesResponse
describeContainerInstancesResponse_containerInstances = (DescribeContainerInstancesResponse -> Maybe [ContainerInstance])
-> (DescribeContainerInstancesResponse
    -> Maybe [ContainerInstance] -> DescribeContainerInstancesResponse)
-> Lens
     DescribeContainerInstancesResponse
     DescribeContainerInstancesResponse
     (Maybe [ContainerInstance])
     (Maybe [ContainerInstance])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeContainerInstancesResponse' {Maybe [ContainerInstance]
containerInstances :: Maybe [ContainerInstance]
$sel:containerInstances:DescribeContainerInstancesResponse' :: DescribeContainerInstancesResponse -> Maybe [ContainerInstance]
containerInstances} -> Maybe [ContainerInstance]
containerInstances) (\s :: DescribeContainerInstancesResponse
s@DescribeContainerInstancesResponse' {} Maybe [ContainerInstance]
a -> DescribeContainerInstancesResponse
s {$sel:containerInstances:DescribeContainerInstancesResponse' :: Maybe [ContainerInstance]
containerInstances = Maybe [ContainerInstance]
a} :: DescribeContainerInstancesResponse) ((Maybe [ContainerInstance] -> f (Maybe [ContainerInstance]))
 -> DescribeContainerInstancesResponse
 -> f DescribeContainerInstancesResponse)
-> ((Maybe [ContainerInstance] -> f (Maybe [ContainerInstance]))
    -> Maybe [ContainerInstance] -> f (Maybe [ContainerInstance]))
-> (Maybe [ContainerInstance] -> f (Maybe [ContainerInstance]))
-> DescribeContainerInstancesResponse
-> f DescribeContainerInstancesResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ContainerInstance]
  [ContainerInstance]
  [ContainerInstance]
  [ContainerInstance]
-> Iso
     (Maybe [ContainerInstance])
     (Maybe [ContainerInstance])
     (Maybe [ContainerInstance])
     (Maybe [ContainerInstance])
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
  [ContainerInstance]
  [ContainerInstance]
  [ContainerInstance]
  [ContainerInstance]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    DescribeContainerInstancesResponse