{-# 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.Environment
-- 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.Environment 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

-- | The object that contains the Docker image URI for either your robot or
-- simulation applications.
--
-- /See:/ 'newEnvironment' smart constructor.
data Environment = Environment'
  { -- | The Docker image URI for either your robot or simulation applications.
    Environment -> Maybe Text
uri :: Prelude.Maybe Prelude.Text
  }
  deriving (Environment -> Environment -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Environment -> Environment -> Bool
$c/= :: Environment -> Environment -> Bool
== :: Environment -> Environment -> Bool
$c== :: Environment -> Environment -> Bool
Prelude.Eq, ReadPrec [Environment]
ReadPrec Environment
Int -> ReadS Environment
ReadS [Environment]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Environment]
$creadListPrec :: ReadPrec [Environment]
readPrec :: ReadPrec Environment
$creadPrec :: ReadPrec Environment
readList :: ReadS [Environment]
$creadList :: ReadS [Environment]
readsPrec :: Int -> ReadS Environment
$creadsPrec :: Int -> ReadS Environment
Prelude.Read, Int -> Environment -> ShowS
[Environment] -> ShowS
Environment -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Environment] -> ShowS
$cshowList :: [Environment] -> ShowS
show :: Environment -> String
$cshow :: Environment -> String
showsPrec :: Int -> Environment -> ShowS
$cshowsPrec :: Int -> Environment -> ShowS
Prelude.Show, forall x. Rep Environment x -> Environment
forall x. Environment -> Rep Environment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Environment x -> Environment
$cfrom :: forall x. Environment -> Rep Environment x
Prelude.Generic)

-- |
-- Create a value of 'Environment' 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:
--
-- 'uri', 'environment_uri' - The Docker image URI for either your robot or simulation applications.
newEnvironment ::
  Environment
newEnvironment :: Environment
newEnvironment = Environment' {$sel:uri:Environment' :: Maybe Text
uri = forall a. Maybe a
Prelude.Nothing}

-- | The Docker image URI for either your robot or simulation applications.
environment_uri :: Lens.Lens' Environment (Prelude.Maybe Prelude.Text)
environment_uri :: Lens' Environment (Maybe Text)
environment_uri = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Environment' {Maybe Text
uri :: Maybe Text
$sel:uri:Environment' :: Environment -> Maybe Text
uri} -> Maybe Text
uri) (\s :: Environment
s@Environment' {} Maybe Text
a -> Environment
s {$sel:uri:Environment' :: Maybe Text
uri = Maybe Text
a} :: Environment)

instance Data.FromJSON Environment where
  parseJSON :: Value -> Parser Environment
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Environment"
      (\Object
x -> Maybe Text -> Environment
Environment' 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
"uri"))

instance Prelude.Hashable Environment where
  hashWithSalt :: Int -> Environment -> Int
hashWithSalt Int
_salt Environment' {Maybe Text
uri :: Maybe Text
$sel:uri:Environment' :: Environment -> Maybe Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
uri

instance Prelude.NFData Environment where
  rnf :: Environment -> ()
rnf Environment' {Maybe Text
uri :: Maybe Text
$sel:uri:Environment' :: Environment -> Maybe Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
uri

instance Data.ToJSON Environment where
  toJSON :: Environment -> Value
toJSON Environment' {Maybe Text
uri :: Maybe Text
$sel:uri:Environment' :: Environment -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      (forall a. [Maybe a] -> [a]
Prelude.catMaybes [(Key
"uri" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
uri])