{-# 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.Braket.Types.ContainerImage
-- 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.Braket.Types.ContainerImage 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 container image used to create an Amazon Braket job.
--
-- /See:/ 'newContainerImage' smart constructor.
data ContainerImage = ContainerImage'
  { -- | The URI locating the container image.
    ContainerImage -> Text
uri :: Prelude.Text
  }
  deriving (ContainerImage -> ContainerImage -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ContainerImage -> ContainerImage -> Bool
$c/= :: ContainerImage -> ContainerImage -> Bool
== :: ContainerImage -> ContainerImage -> Bool
$c== :: ContainerImage -> ContainerImage -> Bool
Prelude.Eq, ReadPrec [ContainerImage]
ReadPrec ContainerImage
Int -> ReadS ContainerImage
ReadS [ContainerImage]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ContainerImage]
$creadListPrec :: ReadPrec [ContainerImage]
readPrec :: ReadPrec ContainerImage
$creadPrec :: ReadPrec ContainerImage
readList :: ReadS [ContainerImage]
$creadList :: ReadS [ContainerImage]
readsPrec :: Int -> ReadS ContainerImage
$creadsPrec :: Int -> ReadS ContainerImage
Prelude.Read, Int -> ContainerImage -> ShowS
[ContainerImage] -> ShowS
ContainerImage -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ContainerImage] -> ShowS
$cshowList :: [ContainerImage] -> ShowS
show :: ContainerImage -> String
$cshow :: ContainerImage -> String
showsPrec :: Int -> ContainerImage -> ShowS
$cshowsPrec :: Int -> ContainerImage -> ShowS
Prelude.Show, forall x. Rep ContainerImage x -> ContainerImage
forall x. ContainerImage -> Rep ContainerImage x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ContainerImage x -> ContainerImage
$cfrom :: forall x. ContainerImage -> Rep ContainerImage x
Prelude.Generic)

-- |
-- Create a value of 'ContainerImage' 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', 'containerImage_uri' - The URI locating the container image.
newContainerImage ::
  -- | 'uri'
  Prelude.Text ->
  ContainerImage
newContainerImage :: Text -> ContainerImage
newContainerImage Text
pUri_ =
  ContainerImage' {$sel:uri:ContainerImage' :: Text
uri = Text
pUri_}

-- | The URI locating the container image.
containerImage_uri :: Lens.Lens' ContainerImage Prelude.Text
containerImage_uri :: Lens' ContainerImage Text
containerImage_uri = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContainerImage' {Text
uri :: Text
$sel:uri:ContainerImage' :: ContainerImage -> Text
uri} -> Text
uri) (\s :: ContainerImage
s@ContainerImage' {} Text
a -> ContainerImage
s {$sel:uri:ContainerImage' :: Text
uri = Text
a} :: ContainerImage)

instance Data.FromJSON ContainerImage where
  parseJSON :: Value -> Parser ContainerImage
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ContainerImage"
      ( \Object
x ->
          Text -> ContainerImage
ContainerImage' forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"uri")
      )

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

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

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