{-# 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.SageMakerGeoSpatial.Types.OutputBand
-- 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.SageMakerGeoSpatial.Types.OutputBand 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.SageMakerGeoSpatial.Types.OutputType

-- | A single EarthObservationJob output band.
--
-- /See:/ 'newOutputBand' smart constructor.
data OutputBand = OutputBand'
  { -- | The name of the band.
    OutputBand -> Text
bandName :: Prelude.Text,
    -- | The datatype of the output band.
    OutputBand -> OutputType
outputDataType :: OutputType
  }
  deriving (OutputBand -> OutputBand -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OutputBand -> OutputBand -> Bool
$c/= :: OutputBand -> OutputBand -> Bool
== :: OutputBand -> OutputBand -> Bool
$c== :: OutputBand -> OutputBand -> Bool
Prelude.Eq, ReadPrec [OutputBand]
ReadPrec OutputBand
Int -> ReadS OutputBand
ReadS [OutputBand]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OutputBand]
$creadListPrec :: ReadPrec [OutputBand]
readPrec :: ReadPrec OutputBand
$creadPrec :: ReadPrec OutputBand
readList :: ReadS [OutputBand]
$creadList :: ReadS [OutputBand]
readsPrec :: Int -> ReadS OutputBand
$creadsPrec :: Int -> ReadS OutputBand
Prelude.Read, Int -> OutputBand -> ShowS
[OutputBand] -> ShowS
OutputBand -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OutputBand] -> ShowS
$cshowList :: [OutputBand] -> ShowS
show :: OutputBand -> String
$cshow :: OutputBand -> String
showsPrec :: Int -> OutputBand -> ShowS
$cshowsPrec :: Int -> OutputBand -> ShowS
Prelude.Show, forall x. Rep OutputBand x -> OutputBand
forall x. OutputBand -> Rep OutputBand x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OutputBand x -> OutputBand
$cfrom :: forall x. OutputBand -> Rep OutputBand x
Prelude.Generic)

-- |
-- Create a value of 'OutputBand' 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:
--
-- 'bandName', 'outputBand_bandName' - The name of the band.
--
-- 'outputDataType', 'outputBand_outputDataType' - The datatype of the output band.
newOutputBand ::
  -- | 'bandName'
  Prelude.Text ->
  -- | 'outputDataType'
  OutputType ->
  OutputBand
newOutputBand :: Text -> OutputType -> OutputBand
newOutputBand Text
pBandName_ OutputType
pOutputDataType_ =
  OutputBand'
    { $sel:bandName:OutputBand' :: Text
bandName = Text
pBandName_,
      $sel:outputDataType:OutputBand' :: OutputType
outputDataType = OutputType
pOutputDataType_
    }

-- | The name of the band.
outputBand_bandName :: Lens.Lens' OutputBand Prelude.Text
outputBand_bandName :: Lens' OutputBand Text
outputBand_bandName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OutputBand' {Text
bandName :: Text
$sel:bandName:OutputBand' :: OutputBand -> Text
bandName} -> Text
bandName) (\s :: OutputBand
s@OutputBand' {} Text
a -> OutputBand
s {$sel:bandName:OutputBand' :: Text
bandName = Text
a} :: OutputBand)

-- | The datatype of the output band.
outputBand_outputDataType :: Lens.Lens' OutputBand OutputType
outputBand_outputDataType :: Lens' OutputBand OutputType
outputBand_outputDataType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OutputBand' {OutputType
outputDataType :: OutputType
$sel:outputDataType:OutputBand' :: OutputBand -> OutputType
outputDataType} -> OutputType
outputDataType) (\s :: OutputBand
s@OutputBand' {} OutputType
a -> OutputBand
s {$sel:outputDataType:OutputBand' :: OutputType
outputDataType = OutputType
a} :: OutputBand)

instance Data.FromJSON OutputBand where
  parseJSON :: Value -> Parser OutputBand
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"OutputBand"
      ( \Object
x ->
          Text -> OutputType -> OutputBand
OutputBand'
            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
"BandName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"OutputDataType")
      )

instance Prelude.Hashable OutputBand where
  hashWithSalt :: Int -> OutputBand -> Int
hashWithSalt Int
_salt OutputBand' {Text
OutputType
outputDataType :: OutputType
bandName :: Text
$sel:outputDataType:OutputBand' :: OutputBand -> OutputType
$sel:bandName:OutputBand' :: OutputBand -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
bandName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` OutputType
outputDataType

instance Prelude.NFData OutputBand where
  rnf :: OutputBand -> ()
rnf OutputBand' {Text
OutputType
outputDataType :: OutputType
bandName :: Text
$sel:outputDataType:OutputBand' :: OutputBand -> OutputType
$sel:bandName:OutputBand' :: OutputBand -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
bandName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf OutputType
outputDataType