{-# 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.GeoMosaicConfigInput
-- 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.GeoMosaicConfigInput 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.AlgorithmNameGeoMosaic

-- | Input configuration information for the geomosaic.
--
-- /See:/ 'newGeoMosaicConfigInput' smart constructor.
data GeoMosaicConfigInput = GeoMosaicConfigInput'
  { -- | The name of the algorithm being used for geomosaic.
    GeoMosaicConfigInput -> Maybe AlgorithmNameGeoMosaic
algorithmName :: Prelude.Maybe AlgorithmNameGeoMosaic,
    -- | The target bands for geomosaic.
    GeoMosaicConfigInput -> Maybe (NonEmpty Text)
targetBands :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text)
  }
  deriving (GeoMosaicConfigInput -> GeoMosaicConfigInput -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GeoMosaicConfigInput -> GeoMosaicConfigInput -> Bool
$c/= :: GeoMosaicConfigInput -> GeoMosaicConfigInput -> Bool
== :: GeoMosaicConfigInput -> GeoMosaicConfigInput -> Bool
$c== :: GeoMosaicConfigInput -> GeoMosaicConfigInput -> Bool
Prelude.Eq, ReadPrec [GeoMosaicConfigInput]
ReadPrec GeoMosaicConfigInput
Int -> ReadS GeoMosaicConfigInput
ReadS [GeoMosaicConfigInput]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GeoMosaicConfigInput]
$creadListPrec :: ReadPrec [GeoMosaicConfigInput]
readPrec :: ReadPrec GeoMosaicConfigInput
$creadPrec :: ReadPrec GeoMosaicConfigInput
readList :: ReadS [GeoMosaicConfigInput]
$creadList :: ReadS [GeoMosaicConfigInput]
readsPrec :: Int -> ReadS GeoMosaicConfigInput
$creadsPrec :: Int -> ReadS GeoMosaicConfigInput
Prelude.Read, Int -> GeoMosaicConfigInput -> ShowS
[GeoMosaicConfigInput] -> ShowS
GeoMosaicConfigInput -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GeoMosaicConfigInput] -> ShowS
$cshowList :: [GeoMosaicConfigInput] -> ShowS
show :: GeoMosaicConfigInput -> String
$cshow :: GeoMosaicConfigInput -> String
showsPrec :: Int -> GeoMosaicConfigInput -> ShowS
$cshowsPrec :: Int -> GeoMosaicConfigInput -> ShowS
Prelude.Show, forall x. Rep GeoMosaicConfigInput x -> GeoMosaicConfigInput
forall x. GeoMosaicConfigInput -> Rep GeoMosaicConfigInput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GeoMosaicConfigInput x -> GeoMosaicConfigInput
$cfrom :: forall x. GeoMosaicConfigInput -> Rep GeoMosaicConfigInput x
Prelude.Generic)

-- |
-- Create a value of 'GeoMosaicConfigInput' 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:
--
-- 'algorithmName', 'geoMosaicConfigInput_algorithmName' - The name of the algorithm being used for geomosaic.
--
-- 'targetBands', 'geoMosaicConfigInput_targetBands' - The target bands for geomosaic.
newGeoMosaicConfigInput ::
  GeoMosaicConfigInput
newGeoMosaicConfigInput :: GeoMosaicConfigInput
newGeoMosaicConfigInput =
  GeoMosaicConfigInput'
    { $sel:algorithmName:GeoMosaicConfigInput' :: Maybe AlgorithmNameGeoMosaic
algorithmName =
        forall a. Maybe a
Prelude.Nothing,
      $sel:targetBands:GeoMosaicConfigInput' :: Maybe (NonEmpty Text)
targetBands = forall a. Maybe a
Prelude.Nothing
    }

-- | The name of the algorithm being used for geomosaic.
geoMosaicConfigInput_algorithmName :: Lens.Lens' GeoMosaicConfigInput (Prelude.Maybe AlgorithmNameGeoMosaic)
geoMosaicConfigInput_algorithmName :: Lens' GeoMosaicConfigInput (Maybe AlgorithmNameGeoMosaic)
geoMosaicConfigInput_algorithmName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GeoMosaicConfigInput' {Maybe AlgorithmNameGeoMosaic
algorithmName :: Maybe AlgorithmNameGeoMosaic
$sel:algorithmName:GeoMosaicConfigInput' :: GeoMosaicConfigInput -> Maybe AlgorithmNameGeoMosaic
algorithmName} -> Maybe AlgorithmNameGeoMosaic
algorithmName) (\s :: GeoMosaicConfigInput
s@GeoMosaicConfigInput' {} Maybe AlgorithmNameGeoMosaic
a -> GeoMosaicConfigInput
s {$sel:algorithmName:GeoMosaicConfigInput' :: Maybe AlgorithmNameGeoMosaic
algorithmName = Maybe AlgorithmNameGeoMosaic
a} :: GeoMosaicConfigInput)

-- | The target bands for geomosaic.
geoMosaicConfigInput_targetBands :: Lens.Lens' GeoMosaicConfigInput (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
geoMosaicConfigInput_targetBands :: Lens' GeoMosaicConfigInput (Maybe (NonEmpty Text))
geoMosaicConfigInput_targetBands = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GeoMosaicConfigInput' {Maybe (NonEmpty Text)
targetBands :: Maybe (NonEmpty Text)
$sel:targetBands:GeoMosaicConfigInput' :: GeoMosaicConfigInput -> Maybe (NonEmpty Text)
targetBands} -> Maybe (NonEmpty Text)
targetBands) (\s :: GeoMosaicConfigInput
s@GeoMosaicConfigInput' {} Maybe (NonEmpty Text)
a -> GeoMosaicConfigInput
s {$sel:targetBands:GeoMosaicConfigInput' :: Maybe (NonEmpty Text)
targetBands = Maybe (NonEmpty Text)
a} :: GeoMosaicConfigInput) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.Hashable GeoMosaicConfigInput where
  hashWithSalt :: Int -> GeoMosaicConfigInput -> Int
hashWithSalt Int
_salt GeoMosaicConfigInput' {Maybe (NonEmpty Text)
Maybe AlgorithmNameGeoMosaic
targetBands :: Maybe (NonEmpty Text)
algorithmName :: Maybe AlgorithmNameGeoMosaic
$sel:targetBands:GeoMosaicConfigInput' :: GeoMosaicConfigInput -> Maybe (NonEmpty Text)
$sel:algorithmName:GeoMosaicConfigInput' :: GeoMosaicConfigInput -> Maybe AlgorithmNameGeoMosaic
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AlgorithmNameGeoMosaic
algorithmName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
targetBands

instance Prelude.NFData GeoMosaicConfigInput where
  rnf :: GeoMosaicConfigInput -> ()
rnf GeoMosaicConfigInput' {Maybe (NonEmpty Text)
Maybe AlgorithmNameGeoMosaic
targetBands :: Maybe (NonEmpty Text)
algorithmName :: Maybe AlgorithmNameGeoMosaic
$sel:targetBands:GeoMosaicConfigInput' :: GeoMosaicConfigInput -> Maybe (NonEmpty Text)
$sel:algorithmName:GeoMosaicConfigInput' :: GeoMosaicConfigInput -> Maybe AlgorithmNameGeoMosaic
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe AlgorithmNameGeoMosaic
algorithmName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
targetBands

instance Data.ToJSON GeoMosaicConfigInput where
  toJSON :: GeoMosaicConfigInput -> Value
toJSON GeoMosaicConfigInput' {Maybe (NonEmpty Text)
Maybe AlgorithmNameGeoMosaic
targetBands :: Maybe (NonEmpty Text)
algorithmName :: Maybe AlgorithmNameGeoMosaic
$sel:targetBands:GeoMosaicConfigInput' :: GeoMosaicConfigInput -> Maybe (NonEmpty Text)
$sel:algorithmName:GeoMosaicConfigInput' :: GeoMosaicConfigInput -> Maybe AlgorithmNameGeoMosaic
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"AlgorithmName" 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 AlgorithmNameGeoMosaic
algorithmName,
            (Key
"TargetBands" 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 (NonEmpty Text)
targetBands
          ]
      )