{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

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

-- |
-- Module      : Amazonka.Batch.Types.ComputeEnvironmentDetail
-- 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)
module Amazonka.Batch.Types.ComputeEnvironmentDetail where

import Amazonka.Batch.Types.CEState
import Amazonka.Batch.Types.CEStatus
import Amazonka.Batch.Types.CEType
import Amazonka.Batch.Types.ComputeResource
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | An object representing an Batch compute environment.
--
-- /See:/ 'newComputeEnvironmentDetail' smart constructor.
data ComputeEnvironmentDetail = ComputeEnvironmentDetail'
  { -- | The current status of the compute environment (for example, @CREATING@
    -- or @VALID@).
    ComputeEnvironmentDetail -> Maybe CEStatus
status :: Prelude.Maybe CEStatus,
    -- | The state of the compute environment. The valid values are @ENABLED@ or
    -- @DISABLED@.
    --
    -- If the state is @ENABLED@, then the Batch scheduler can attempt to place
    -- jobs from an associated job queue on the compute resources within the
    -- environment. If the compute environment is managed, then it can scale
    -- its instances out or in automatically, based on the job queue demand.
    --
    -- If the state is @DISABLED@, then the Batch scheduler doesn\'t attempt to
    -- place jobs within the environment. Jobs in a @STARTING@ or @RUNNING@
    -- state continue to progress normally. Managed compute environments in the
    -- @DISABLED@ state don\'t scale out. However, they scale in to @minvCpus@
    -- value after instances become idle.
    ComputeEnvironmentDetail -> Maybe CEState
state :: Prelude.Maybe CEState,
    -- | The compute resources defined for the compute environment. For more
    -- information, see
    -- <https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html Compute Environments>
    -- in the /Batch User Guide/.
    ComputeEnvironmentDetail -> Maybe ComputeResource
computeResources :: Prelude.Maybe ComputeResource,
    -- | A short, human-readable string to provide additional details about the
    -- current status of the compute environment.
    ComputeEnvironmentDetail -> Maybe Text
statusReason :: Prelude.Maybe Prelude.Text,
    -- | The type of the compute environment: @MANAGED@ or @UNMANAGED@. For more
    -- information, see
    -- <https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html Compute Environments>
    -- in the /Batch User Guide/.
    ComputeEnvironmentDetail -> Maybe CEType
type' :: Prelude.Maybe CEType,
    -- | The service role associated with the compute environment that allows
    -- Batch to make calls to Amazon Web Services API operations on your
    -- behalf. For more information, see
    -- <https://docs.aws.amazon.com/batch/latest/userguide/service_IAM_role.html Batch service IAM role>
    -- in the /Batch User Guide/.
    ComputeEnvironmentDetail -> Maybe Text
serviceRole :: Prelude.Maybe Prelude.Text,
    -- | The tags applied to the compute environment.
    ComputeEnvironmentDetail -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The name of the compute environment. Up to 128 letters (uppercase and
    -- lowercase), numbers, hyphens, and underscores are allowed.
    ComputeEnvironmentDetail -> Text
computeEnvironmentName :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the compute environment.
    ComputeEnvironmentDetail -> Text
computeEnvironmentArn :: Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the underlying Amazon ECS cluster used
    -- by the compute environment.
    ComputeEnvironmentDetail -> Text
ecsClusterArn :: Prelude.Text
  }
  deriving (ComputeEnvironmentDetail -> ComputeEnvironmentDetail -> Bool
(ComputeEnvironmentDetail -> ComputeEnvironmentDetail -> Bool)
-> (ComputeEnvironmentDetail -> ComputeEnvironmentDetail -> Bool)
-> Eq ComputeEnvironmentDetail
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ComputeEnvironmentDetail -> ComputeEnvironmentDetail -> Bool
$c/= :: ComputeEnvironmentDetail -> ComputeEnvironmentDetail -> Bool
== :: ComputeEnvironmentDetail -> ComputeEnvironmentDetail -> Bool
$c== :: ComputeEnvironmentDetail -> ComputeEnvironmentDetail -> Bool
Prelude.Eq, ReadPrec [ComputeEnvironmentDetail]
ReadPrec ComputeEnvironmentDetail
Int -> ReadS ComputeEnvironmentDetail
ReadS [ComputeEnvironmentDetail]
(Int -> ReadS ComputeEnvironmentDetail)
-> ReadS [ComputeEnvironmentDetail]
-> ReadPrec ComputeEnvironmentDetail
-> ReadPrec [ComputeEnvironmentDetail]
-> Read ComputeEnvironmentDetail
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ComputeEnvironmentDetail]
$creadListPrec :: ReadPrec [ComputeEnvironmentDetail]
readPrec :: ReadPrec ComputeEnvironmentDetail
$creadPrec :: ReadPrec ComputeEnvironmentDetail
readList :: ReadS [ComputeEnvironmentDetail]
$creadList :: ReadS [ComputeEnvironmentDetail]
readsPrec :: Int -> ReadS ComputeEnvironmentDetail
$creadsPrec :: Int -> ReadS ComputeEnvironmentDetail
Prelude.Read, Int -> ComputeEnvironmentDetail -> ShowS
[ComputeEnvironmentDetail] -> ShowS
ComputeEnvironmentDetail -> String
(Int -> ComputeEnvironmentDetail -> ShowS)
-> (ComputeEnvironmentDetail -> String)
-> ([ComputeEnvironmentDetail] -> ShowS)
-> Show ComputeEnvironmentDetail
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ComputeEnvironmentDetail] -> ShowS
$cshowList :: [ComputeEnvironmentDetail] -> ShowS
show :: ComputeEnvironmentDetail -> String
$cshow :: ComputeEnvironmentDetail -> String
showsPrec :: Int -> ComputeEnvironmentDetail -> ShowS
$cshowsPrec :: Int -> ComputeEnvironmentDetail -> ShowS
Prelude.Show, (forall x.
 ComputeEnvironmentDetail -> Rep ComputeEnvironmentDetail x)
-> (forall x.
    Rep ComputeEnvironmentDetail x -> ComputeEnvironmentDetail)
-> Generic ComputeEnvironmentDetail
forall x.
Rep ComputeEnvironmentDetail x -> ComputeEnvironmentDetail
forall x.
ComputeEnvironmentDetail -> Rep ComputeEnvironmentDetail x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ComputeEnvironmentDetail x -> ComputeEnvironmentDetail
$cfrom :: forall x.
ComputeEnvironmentDetail -> Rep ComputeEnvironmentDetail x
Prelude.Generic)

-- |
-- Create a value of 'ComputeEnvironmentDetail' 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:
--
-- 'status', 'computeEnvironmentDetail_status' - The current status of the compute environment (for example, @CREATING@
-- or @VALID@).
--
-- 'state', 'computeEnvironmentDetail_state' - The state of the compute environment. The valid values are @ENABLED@ or
-- @DISABLED@.
--
-- If the state is @ENABLED@, then the Batch scheduler can attempt to place
-- jobs from an associated job queue on the compute resources within the
-- environment. If the compute environment is managed, then it can scale
-- its instances out or in automatically, based on the job queue demand.
--
-- If the state is @DISABLED@, then the Batch scheduler doesn\'t attempt to
-- place jobs within the environment. Jobs in a @STARTING@ or @RUNNING@
-- state continue to progress normally. Managed compute environments in the
-- @DISABLED@ state don\'t scale out. However, they scale in to @minvCpus@
-- value after instances become idle.
--
-- 'computeResources', 'computeEnvironmentDetail_computeResources' - The compute resources defined for the compute environment. For more
-- information, see
-- <https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html Compute Environments>
-- in the /Batch User Guide/.
--
-- 'statusReason', 'computeEnvironmentDetail_statusReason' - A short, human-readable string to provide additional details about the
-- current status of the compute environment.
--
-- 'type'', 'computeEnvironmentDetail_type' - The type of the compute environment: @MANAGED@ or @UNMANAGED@. For more
-- information, see
-- <https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html Compute Environments>
-- in the /Batch User Guide/.
--
-- 'serviceRole', 'computeEnvironmentDetail_serviceRole' - The service role associated with the compute environment that allows
-- Batch to make calls to Amazon Web Services API operations on your
-- behalf. For more information, see
-- <https://docs.aws.amazon.com/batch/latest/userguide/service_IAM_role.html Batch service IAM role>
-- in the /Batch User Guide/.
--
-- 'tags', 'computeEnvironmentDetail_tags' - The tags applied to the compute environment.
--
-- 'computeEnvironmentName', 'computeEnvironmentDetail_computeEnvironmentName' - The name of the compute environment. Up to 128 letters (uppercase and
-- lowercase), numbers, hyphens, and underscores are allowed.
--
-- 'computeEnvironmentArn', 'computeEnvironmentDetail_computeEnvironmentArn' - The Amazon Resource Name (ARN) of the compute environment.
--
-- 'ecsClusterArn', 'computeEnvironmentDetail_ecsClusterArn' - The Amazon Resource Name (ARN) of the underlying Amazon ECS cluster used
-- by the compute environment.
newComputeEnvironmentDetail ::
  -- | 'computeEnvironmentName'
  Prelude.Text ->
  -- | 'computeEnvironmentArn'
  Prelude.Text ->
  -- | 'ecsClusterArn'
  Prelude.Text ->
  ComputeEnvironmentDetail
newComputeEnvironmentDetail :: Text -> Text -> Text -> ComputeEnvironmentDetail
newComputeEnvironmentDetail
  Text
pComputeEnvironmentName_
  Text
pComputeEnvironmentArn_
  Text
pEcsClusterArn_ =
    ComputeEnvironmentDetail' :: Maybe CEStatus
-> Maybe CEState
-> Maybe ComputeResource
-> Maybe Text
-> Maybe CEType
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> ComputeEnvironmentDetail
ComputeEnvironmentDetail'
      { $sel:status:ComputeEnvironmentDetail' :: Maybe CEStatus
status = Maybe CEStatus
forall a. Maybe a
Prelude.Nothing,
        $sel:state:ComputeEnvironmentDetail' :: Maybe CEState
state = Maybe CEState
forall a. Maybe a
Prelude.Nothing,
        $sel:computeResources:ComputeEnvironmentDetail' :: Maybe ComputeResource
computeResources = Maybe ComputeResource
forall a. Maybe a
Prelude.Nothing,
        $sel:statusReason:ComputeEnvironmentDetail' :: Maybe Text
statusReason = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:type':ComputeEnvironmentDetail' :: Maybe CEType
type' = Maybe CEType
forall a. Maybe a
Prelude.Nothing,
        $sel:serviceRole:ComputeEnvironmentDetail' :: Maybe Text
serviceRole = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:ComputeEnvironmentDetail' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:computeEnvironmentName:ComputeEnvironmentDetail' :: Text
computeEnvironmentName = Text
pComputeEnvironmentName_,
        $sel:computeEnvironmentArn:ComputeEnvironmentDetail' :: Text
computeEnvironmentArn = Text
pComputeEnvironmentArn_,
        $sel:ecsClusterArn:ComputeEnvironmentDetail' :: Text
ecsClusterArn = Text
pEcsClusterArn_
      }

-- | The current status of the compute environment (for example, @CREATING@
-- or @VALID@).
computeEnvironmentDetail_status :: Lens.Lens' ComputeEnvironmentDetail (Prelude.Maybe CEStatus)
computeEnvironmentDetail_status :: (Maybe CEStatus -> f (Maybe CEStatus))
-> ComputeEnvironmentDetail -> f ComputeEnvironmentDetail
computeEnvironmentDetail_status = (ComputeEnvironmentDetail -> Maybe CEStatus)
-> (ComputeEnvironmentDetail
    -> Maybe CEStatus -> ComputeEnvironmentDetail)
-> Lens
     ComputeEnvironmentDetail
     ComputeEnvironmentDetail
     (Maybe CEStatus)
     (Maybe CEStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputeEnvironmentDetail' {Maybe CEStatus
status :: Maybe CEStatus
$sel:status:ComputeEnvironmentDetail' :: ComputeEnvironmentDetail -> Maybe CEStatus
status} -> Maybe CEStatus
status) (\s :: ComputeEnvironmentDetail
s@ComputeEnvironmentDetail' {} Maybe CEStatus
a -> ComputeEnvironmentDetail
s {$sel:status:ComputeEnvironmentDetail' :: Maybe CEStatus
status = Maybe CEStatus
a} :: ComputeEnvironmentDetail)

-- | The state of the compute environment. The valid values are @ENABLED@ or
-- @DISABLED@.
--
-- If the state is @ENABLED@, then the Batch scheduler can attempt to place
-- jobs from an associated job queue on the compute resources within the
-- environment. If the compute environment is managed, then it can scale
-- its instances out or in automatically, based on the job queue demand.
--
-- If the state is @DISABLED@, then the Batch scheduler doesn\'t attempt to
-- place jobs within the environment. Jobs in a @STARTING@ or @RUNNING@
-- state continue to progress normally. Managed compute environments in the
-- @DISABLED@ state don\'t scale out. However, they scale in to @minvCpus@
-- value after instances become idle.
computeEnvironmentDetail_state :: Lens.Lens' ComputeEnvironmentDetail (Prelude.Maybe CEState)
computeEnvironmentDetail_state :: (Maybe CEState -> f (Maybe CEState))
-> ComputeEnvironmentDetail -> f ComputeEnvironmentDetail
computeEnvironmentDetail_state = (ComputeEnvironmentDetail -> Maybe CEState)
-> (ComputeEnvironmentDetail
    -> Maybe CEState -> ComputeEnvironmentDetail)
-> Lens
     ComputeEnvironmentDetail
     ComputeEnvironmentDetail
     (Maybe CEState)
     (Maybe CEState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputeEnvironmentDetail' {Maybe CEState
state :: Maybe CEState
$sel:state:ComputeEnvironmentDetail' :: ComputeEnvironmentDetail -> Maybe CEState
state} -> Maybe CEState
state) (\s :: ComputeEnvironmentDetail
s@ComputeEnvironmentDetail' {} Maybe CEState
a -> ComputeEnvironmentDetail
s {$sel:state:ComputeEnvironmentDetail' :: Maybe CEState
state = Maybe CEState
a} :: ComputeEnvironmentDetail)

-- | The compute resources defined for the compute environment. For more
-- information, see
-- <https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html Compute Environments>
-- in the /Batch User Guide/.
computeEnvironmentDetail_computeResources :: Lens.Lens' ComputeEnvironmentDetail (Prelude.Maybe ComputeResource)
computeEnvironmentDetail_computeResources :: (Maybe ComputeResource -> f (Maybe ComputeResource))
-> ComputeEnvironmentDetail -> f ComputeEnvironmentDetail
computeEnvironmentDetail_computeResources = (ComputeEnvironmentDetail -> Maybe ComputeResource)
-> (ComputeEnvironmentDetail
    -> Maybe ComputeResource -> ComputeEnvironmentDetail)
-> Lens
     ComputeEnvironmentDetail
     ComputeEnvironmentDetail
     (Maybe ComputeResource)
     (Maybe ComputeResource)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputeEnvironmentDetail' {Maybe ComputeResource
computeResources :: Maybe ComputeResource
$sel:computeResources:ComputeEnvironmentDetail' :: ComputeEnvironmentDetail -> Maybe ComputeResource
computeResources} -> Maybe ComputeResource
computeResources) (\s :: ComputeEnvironmentDetail
s@ComputeEnvironmentDetail' {} Maybe ComputeResource
a -> ComputeEnvironmentDetail
s {$sel:computeResources:ComputeEnvironmentDetail' :: Maybe ComputeResource
computeResources = Maybe ComputeResource
a} :: ComputeEnvironmentDetail)

-- | A short, human-readable string to provide additional details about the
-- current status of the compute environment.
computeEnvironmentDetail_statusReason :: Lens.Lens' ComputeEnvironmentDetail (Prelude.Maybe Prelude.Text)
computeEnvironmentDetail_statusReason :: (Maybe Text -> f (Maybe Text))
-> ComputeEnvironmentDetail -> f ComputeEnvironmentDetail
computeEnvironmentDetail_statusReason = (ComputeEnvironmentDetail -> Maybe Text)
-> (ComputeEnvironmentDetail
    -> Maybe Text -> ComputeEnvironmentDetail)
-> Lens
     ComputeEnvironmentDetail
     ComputeEnvironmentDetail
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputeEnvironmentDetail' {Maybe Text
statusReason :: Maybe Text
$sel:statusReason:ComputeEnvironmentDetail' :: ComputeEnvironmentDetail -> Maybe Text
statusReason} -> Maybe Text
statusReason) (\s :: ComputeEnvironmentDetail
s@ComputeEnvironmentDetail' {} Maybe Text
a -> ComputeEnvironmentDetail
s {$sel:statusReason:ComputeEnvironmentDetail' :: Maybe Text
statusReason = Maybe Text
a} :: ComputeEnvironmentDetail)

-- | The type of the compute environment: @MANAGED@ or @UNMANAGED@. For more
-- information, see
-- <https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html Compute Environments>
-- in the /Batch User Guide/.
computeEnvironmentDetail_type :: Lens.Lens' ComputeEnvironmentDetail (Prelude.Maybe CEType)
computeEnvironmentDetail_type :: (Maybe CEType -> f (Maybe CEType))
-> ComputeEnvironmentDetail -> f ComputeEnvironmentDetail
computeEnvironmentDetail_type = (ComputeEnvironmentDetail -> Maybe CEType)
-> (ComputeEnvironmentDetail
    -> Maybe CEType -> ComputeEnvironmentDetail)
-> Lens
     ComputeEnvironmentDetail
     ComputeEnvironmentDetail
     (Maybe CEType)
     (Maybe CEType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputeEnvironmentDetail' {Maybe CEType
type' :: Maybe CEType
$sel:type':ComputeEnvironmentDetail' :: ComputeEnvironmentDetail -> Maybe CEType
type'} -> Maybe CEType
type') (\s :: ComputeEnvironmentDetail
s@ComputeEnvironmentDetail' {} Maybe CEType
a -> ComputeEnvironmentDetail
s {$sel:type':ComputeEnvironmentDetail' :: Maybe CEType
type' = Maybe CEType
a} :: ComputeEnvironmentDetail)

-- | The service role associated with the compute environment that allows
-- Batch to make calls to Amazon Web Services API operations on your
-- behalf. For more information, see
-- <https://docs.aws.amazon.com/batch/latest/userguide/service_IAM_role.html Batch service IAM role>
-- in the /Batch User Guide/.
computeEnvironmentDetail_serviceRole :: Lens.Lens' ComputeEnvironmentDetail (Prelude.Maybe Prelude.Text)
computeEnvironmentDetail_serviceRole :: (Maybe Text -> f (Maybe Text))
-> ComputeEnvironmentDetail -> f ComputeEnvironmentDetail
computeEnvironmentDetail_serviceRole = (ComputeEnvironmentDetail -> Maybe Text)
-> (ComputeEnvironmentDetail
    -> Maybe Text -> ComputeEnvironmentDetail)
-> Lens
     ComputeEnvironmentDetail
     ComputeEnvironmentDetail
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputeEnvironmentDetail' {Maybe Text
serviceRole :: Maybe Text
$sel:serviceRole:ComputeEnvironmentDetail' :: ComputeEnvironmentDetail -> Maybe Text
serviceRole} -> Maybe Text
serviceRole) (\s :: ComputeEnvironmentDetail
s@ComputeEnvironmentDetail' {} Maybe Text
a -> ComputeEnvironmentDetail
s {$sel:serviceRole:ComputeEnvironmentDetail' :: Maybe Text
serviceRole = Maybe Text
a} :: ComputeEnvironmentDetail)

-- | The tags applied to the compute environment.
computeEnvironmentDetail_tags :: Lens.Lens' ComputeEnvironmentDetail (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
computeEnvironmentDetail_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ComputeEnvironmentDetail -> f ComputeEnvironmentDetail
computeEnvironmentDetail_tags = (ComputeEnvironmentDetail -> Maybe (HashMap Text Text))
-> (ComputeEnvironmentDetail
    -> Maybe (HashMap Text Text) -> ComputeEnvironmentDetail)
-> Lens
     ComputeEnvironmentDetail
     ComputeEnvironmentDetail
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputeEnvironmentDetail' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:ComputeEnvironmentDetail' :: ComputeEnvironmentDetail -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: ComputeEnvironmentDetail
s@ComputeEnvironmentDetail' {} Maybe (HashMap Text Text)
a -> ComputeEnvironmentDetail
s {$sel:tags:ComputeEnvironmentDetail' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: ComputeEnvironmentDetail) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> ComputeEnvironmentDetail -> f ComputeEnvironmentDetail)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> ComputeEnvironmentDetail
-> f ComputeEnvironmentDetail
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the compute environment. Up to 128 letters (uppercase and
-- lowercase), numbers, hyphens, and underscores are allowed.
computeEnvironmentDetail_computeEnvironmentName :: Lens.Lens' ComputeEnvironmentDetail Prelude.Text
computeEnvironmentDetail_computeEnvironmentName :: (Text -> f Text)
-> ComputeEnvironmentDetail -> f ComputeEnvironmentDetail
computeEnvironmentDetail_computeEnvironmentName = (ComputeEnvironmentDetail -> Text)
-> (ComputeEnvironmentDetail -> Text -> ComputeEnvironmentDetail)
-> Lens ComputeEnvironmentDetail ComputeEnvironmentDetail Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputeEnvironmentDetail' {Text
computeEnvironmentName :: Text
$sel:computeEnvironmentName:ComputeEnvironmentDetail' :: ComputeEnvironmentDetail -> Text
computeEnvironmentName} -> Text
computeEnvironmentName) (\s :: ComputeEnvironmentDetail
s@ComputeEnvironmentDetail' {} Text
a -> ComputeEnvironmentDetail
s {$sel:computeEnvironmentName:ComputeEnvironmentDetail' :: Text
computeEnvironmentName = Text
a} :: ComputeEnvironmentDetail)

-- | The Amazon Resource Name (ARN) of the compute environment.
computeEnvironmentDetail_computeEnvironmentArn :: Lens.Lens' ComputeEnvironmentDetail Prelude.Text
computeEnvironmentDetail_computeEnvironmentArn :: (Text -> f Text)
-> ComputeEnvironmentDetail -> f ComputeEnvironmentDetail
computeEnvironmentDetail_computeEnvironmentArn = (ComputeEnvironmentDetail -> Text)
-> (ComputeEnvironmentDetail -> Text -> ComputeEnvironmentDetail)
-> Lens ComputeEnvironmentDetail ComputeEnvironmentDetail Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputeEnvironmentDetail' {Text
computeEnvironmentArn :: Text
$sel:computeEnvironmentArn:ComputeEnvironmentDetail' :: ComputeEnvironmentDetail -> Text
computeEnvironmentArn} -> Text
computeEnvironmentArn) (\s :: ComputeEnvironmentDetail
s@ComputeEnvironmentDetail' {} Text
a -> ComputeEnvironmentDetail
s {$sel:computeEnvironmentArn:ComputeEnvironmentDetail' :: Text
computeEnvironmentArn = Text
a} :: ComputeEnvironmentDetail)

-- | The Amazon Resource Name (ARN) of the underlying Amazon ECS cluster used
-- by the compute environment.
computeEnvironmentDetail_ecsClusterArn :: Lens.Lens' ComputeEnvironmentDetail Prelude.Text
computeEnvironmentDetail_ecsClusterArn :: (Text -> f Text)
-> ComputeEnvironmentDetail -> f ComputeEnvironmentDetail
computeEnvironmentDetail_ecsClusterArn = (ComputeEnvironmentDetail -> Text)
-> (ComputeEnvironmentDetail -> Text -> ComputeEnvironmentDetail)
-> Lens ComputeEnvironmentDetail ComputeEnvironmentDetail Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputeEnvironmentDetail' {Text
ecsClusterArn :: Text
$sel:ecsClusterArn:ComputeEnvironmentDetail' :: ComputeEnvironmentDetail -> Text
ecsClusterArn} -> Text
ecsClusterArn) (\s :: ComputeEnvironmentDetail
s@ComputeEnvironmentDetail' {} Text
a -> ComputeEnvironmentDetail
s {$sel:ecsClusterArn:ComputeEnvironmentDetail' :: Text
ecsClusterArn = Text
a} :: ComputeEnvironmentDetail)

instance Core.FromJSON ComputeEnvironmentDetail where
  parseJSON :: Value -> Parser ComputeEnvironmentDetail
parseJSON =
    String
-> (Object -> Parser ComputeEnvironmentDetail)
-> Value
-> Parser ComputeEnvironmentDetail
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ComputeEnvironmentDetail"
      ( \Object
x ->
          Maybe CEStatus
-> Maybe CEState
-> Maybe ComputeResource
-> Maybe Text
-> Maybe CEType
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> Text
-> ComputeEnvironmentDetail
ComputeEnvironmentDetail'
            (Maybe CEStatus
 -> Maybe CEState
 -> Maybe ComputeResource
 -> Maybe Text
 -> Maybe CEType
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Text
 -> Text
 -> Text
 -> ComputeEnvironmentDetail)
-> Parser (Maybe CEStatus)
-> Parser
     (Maybe CEState
      -> Maybe ComputeResource
      -> Maybe Text
      -> Maybe CEType
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> ComputeEnvironmentDetail)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe CEStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
            Parser
  (Maybe CEState
   -> Maybe ComputeResource
   -> Maybe Text
   -> Maybe CEType
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> ComputeEnvironmentDetail)
-> Parser (Maybe CEState)
-> Parser
     (Maybe ComputeResource
      -> Maybe Text
      -> Maybe CEType
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> ComputeEnvironmentDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CEState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"state")
            Parser
  (Maybe ComputeResource
   -> Maybe Text
   -> Maybe CEType
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> ComputeEnvironmentDetail)
-> Parser (Maybe ComputeResource)
-> Parser
     (Maybe Text
      -> Maybe CEType
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> ComputeEnvironmentDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ComputeResource)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"computeResources")
            Parser
  (Maybe Text
   -> Maybe CEType
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> ComputeEnvironmentDetail)
-> Parser (Maybe Text)
-> Parser
     (Maybe CEType
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> ComputeEnvironmentDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"statusReason")
            Parser
  (Maybe CEType
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> ComputeEnvironmentDetail)
-> Parser (Maybe CEType)
-> Parser
     (Maybe Text
      -> Maybe (HashMap Text Text)
      -> Text
      -> Text
      -> Text
      -> ComputeEnvironmentDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CEType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"type")
            Parser
  (Maybe Text
   -> Maybe (HashMap Text Text)
   -> Text
   -> Text
   -> Text
   -> ComputeEnvironmentDetail)
-> Parser (Maybe Text)
-> Parser
     (Maybe (HashMap Text Text)
      -> Text -> Text -> Text -> ComputeEnvironmentDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"serviceRole")
            Parser
  (Maybe (HashMap Text Text)
   -> Text -> Text -> Text -> ComputeEnvironmentDetail)
-> Parser (Maybe (HashMap Text Text))
-> Parser (Text -> Text -> Text -> ComputeEnvironmentDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Parser (Text -> Text -> Text -> ComputeEnvironmentDetail)
-> Parser Text -> Parser (Text -> Text -> ComputeEnvironmentDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"computeEnvironmentName")
            Parser (Text -> Text -> ComputeEnvironmentDetail)
-> Parser Text -> Parser (Text -> ComputeEnvironmentDetail)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"computeEnvironmentArn")
            Parser (Text -> ComputeEnvironmentDetail)
-> Parser Text -> Parser ComputeEnvironmentDetail
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ecsClusterArn")
      )

instance Prelude.Hashable ComputeEnvironmentDetail

instance Prelude.NFData ComputeEnvironmentDetail