{-# 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.RobOMaker.Types.ComputeResponse
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.RobOMaker.Types.ComputeResponse where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.RobOMaker.Types.ComputeType

-- | Compute information for the simulation job
--
-- /See:/ 'newComputeResponse' smart constructor.
data ComputeResponse = ComputeResponse'
  { -- | Compute type response information for the simulation job.
    ComputeResponse -> Maybe ComputeType
computeType :: Prelude.Maybe ComputeType,
    -- | Compute GPU unit limit for the simulation job. It is the same as the
    -- number of GPUs allocated to the SimulationJob.
    ComputeResponse -> Maybe Natural
gpuUnitLimit :: Prelude.Maybe Prelude.Natural,
    -- | The simulation unit limit. Your simulation is allocated CPU and memory
    -- proportional to the supplied simulation unit limit. A simulation unit is
    -- 1 vcpu and 2GB of memory. You are only billed for the SU utilization you
    -- consume up to the maximum value provided. The default is 15.
    ComputeResponse -> Maybe Natural
simulationUnitLimit :: Prelude.Maybe Prelude.Natural
  }
  deriving (ComputeResponse -> ComputeResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ComputeResponse -> ComputeResponse -> Bool
$c/= :: ComputeResponse -> ComputeResponse -> Bool
== :: ComputeResponse -> ComputeResponse -> Bool
$c== :: ComputeResponse -> ComputeResponse -> Bool
Prelude.Eq, ReadPrec [ComputeResponse]
ReadPrec ComputeResponse
Int -> ReadS ComputeResponse
ReadS [ComputeResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ComputeResponse]
$creadListPrec :: ReadPrec [ComputeResponse]
readPrec :: ReadPrec ComputeResponse
$creadPrec :: ReadPrec ComputeResponse
readList :: ReadS [ComputeResponse]
$creadList :: ReadS [ComputeResponse]
readsPrec :: Int -> ReadS ComputeResponse
$creadsPrec :: Int -> ReadS ComputeResponse
Prelude.Read, Int -> ComputeResponse -> ShowS
[ComputeResponse] -> ShowS
ComputeResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ComputeResponse] -> ShowS
$cshowList :: [ComputeResponse] -> ShowS
show :: ComputeResponse -> String
$cshow :: ComputeResponse -> String
showsPrec :: Int -> ComputeResponse -> ShowS
$cshowsPrec :: Int -> ComputeResponse -> ShowS
Prelude.Show, forall x. Rep ComputeResponse x -> ComputeResponse
forall x. ComputeResponse -> Rep ComputeResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ComputeResponse x -> ComputeResponse
$cfrom :: forall x. ComputeResponse -> Rep ComputeResponse x
Prelude.Generic)

-- |
-- Create a value of 'ComputeResponse' 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:
--
-- 'computeType', 'computeResponse_computeType' - Compute type response information for the simulation job.
--
-- 'gpuUnitLimit', 'computeResponse_gpuUnitLimit' - Compute GPU unit limit for the simulation job. It is the same as the
-- number of GPUs allocated to the SimulationJob.
--
-- 'simulationUnitLimit', 'computeResponse_simulationUnitLimit' - The simulation unit limit. Your simulation is allocated CPU and memory
-- proportional to the supplied simulation unit limit. A simulation unit is
-- 1 vcpu and 2GB of memory. You are only billed for the SU utilization you
-- consume up to the maximum value provided. The default is 15.
newComputeResponse ::
  ComputeResponse
newComputeResponse :: ComputeResponse
newComputeResponse =
  ComputeResponse'
    { $sel:computeType:ComputeResponse' :: Maybe ComputeType
computeType = forall a. Maybe a
Prelude.Nothing,
      $sel:gpuUnitLimit:ComputeResponse' :: Maybe Natural
gpuUnitLimit = forall a. Maybe a
Prelude.Nothing,
      $sel:simulationUnitLimit:ComputeResponse' :: Maybe Natural
simulationUnitLimit = forall a. Maybe a
Prelude.Nothing
    }

-- | Compute type response information for the simulation job.
computeResponse_computeType :: Lens.Lens' ComputeResponse (Prelude.Maybe ComputeType)
computeResponse_computeType :: Lens' ComputeResponse (Maybe ComputeType)
computeResponse_computeType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputeResponse' {Maybe ComputeType
computeType :: Maybe ComputeType
$sel:computeType:ComputeResponse' :: ComputeResponse -> Maybe ComputeType
computeType} -> Maybe ComputeType
computeType) (\s :: ComputeResponse
s@ComputeResponse' {} Maybe ComputeType
a -> ComputeResponse
s {$sel:computeType:ComputeResponse' :: Maybe ComputeType
computeType = Maybe ComputeType
a} :: ComputeResponse)

-- | Compute GPU unit limit for the simulation job. It is the same as the
-- number of GPUs allocated to the SimulationJob.
computeResponse_gpuUnitLimit :: Lens.Lens' ComputeResponse (Prelude.Maybe Prelude.Natural)
computeResponse_gpuUnitLimit :: Lens' ComputeResponse (Maybe Natural)
computeResponse_gpuUnitLimit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputeResponse' {Maybe Natural
gpuUnitLimit :: Maybe Natural
$sel:gpuUnitLimit:ComputeResponse' :: ComputeResponse -> Maybe Natural
gpuUnitLimit} -> Maybe Natural
gpuUnitLimit) (\s :: ComputeResponse
s@ComputeResponse' {} Maybe Natural
a -> ComputeResponse
s {$sel:gpuUnitLimit:ComputeResponse' :: Maybe Natural
gpuUnitLimit = Maybe Natural
a} :: ComputeResponse)

-- | The simulation unit limit. Your simulation is allocated CPU and memory
-- proportional to the supplied simulation unit limit. A simulation unit is
-- 1 vcpu and 2GB of memory. You are only billed for the SU utilization you
-- consume up to the maximum value provided. The default is 15.
computeResponse_simulationUnitLimit :: Lens.Lens' ComputeResponse (Prelude.Maybe Prelude.Natural)
computeResponse_simulationUnitLimit :: Lens' ComputeResponse (Maybe Natural)
computeResponse_simulationUnitLimit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComputeResponse' {Maybe Natural
simulationUnitLimit :: Maybe Natural
$sel:simulationUnitLimit:ComputeResponse' :: ComputeResponse -> Maybe Natural
simulationUnitLimit} -> Maybe Natural
simulationUnitLimit) (\s :: ComputeResponse
s@ComputeResponse' {} Maybe Natural
a -> ComputeResponse
s {$sel:simulationUnitLimit:ComputeResponse' :: Maybe Natural
simulationUnitLimit = Maybe Natural
a} :: ComputeResponse)

instance Data.FromJSON ComputeResponse where
  parseJSON :: Value -> Parser ComputeResponse
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ComputeResponse"
      ( \Object
x ->
          Maybe ComputeType
-> Maybe Natural -> Maybe Natural -> ComputeResponse
ComputeResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"computeType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"gpuUnitLimit")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"simulationUnitLimit")
      )

instance Prelude.Hashable ComputeResponse where
  hashWithSalt :: Int -> ComputeResponse -> Int
hashWithSalt Int
_salt ComputeResponse' {Maybe Natural
Maybe ComputeType
simulationUnitLimit :: Maybe Natural
gpuUnitLimit :: Maybe Natural
computeType :: Maybe ComputeType
$sel:simulationUnitLimit:ComputeResponse' :: ComputeResponse -> Maybe Natural
$sel:gpuUnitLimit:ComputeResponse' :: ComputeResponse -> Maybe Natural
$sel:computeType:ComputeResponse' :: ComputeResponse -> Maybe ComputeType
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ComputeType
computeType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
gpuUnitLimit
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
simulationUnitLimit

instance Prelude.NFData ComputeResponse where
  rnf :: ComputeResponse -> ()
rnf ComputeResponse' {Maybe Natural
Maybe ComputeType
simulationUnitLimit :: Maybe Natural
gpuUnitLimit :: Maybe Natural
computeType :: Maybe ComputeType
$sel:simulationUnitLimit:ComputeResponse' :: ComputeResponse -> Maybe Natural
$sel:gpuUnitLimit:ComputeResponse' :: ComputeResponse -> Maybe Natural
$sel:computeType:ComputeResponse' :: ComputeResponse -> Maybe ComputeType
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ComputeType
computeType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
gpuUnitLimit
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
simulationUnitLimit