{-# 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.StackConfigInput
-- 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.StackConfigInput 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.OutputResolutionStackInput

-- |
--
-- /See:/ 'newStackConfigInput' smart constructor.
data StackConfigInput = StackConfigInput'
  { StackConfigInput -> Maybe OutputResolutionStackInput
outputResolution :: Prelude.Maybe OutputResolutionStackInput,
    StackConfigInput -> Maybe (NonEmpty Text)
targetBands :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text)
  }
  deriving (StackConfigInput -> StackConfigInput -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StackConfigInput -> StackConfigInput -> Bool
$c/= :: StackConfigInput -> StackConfigInput -> Bool
== :: StackConfigInput -> StackConfigInput -> Bool
$c== :: StackConfigInput -> StackConfigInput -> Bool
Prelude.Eq, ReadPrec [StackConfigInput]
ReadPrec StackConfigInput
Int -> ReadS StackConfigInput
ReadS [StackConfigInput]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StackConfigInput]
$creadListPrec :: ReadPrec [StackConfigInput]
readPrec :: ReadPrec StackConfigInput
$creadPrec :: ReadPrec StackConfigInput
readList :: ReadS [StackConfigInput]
$creadList :: ReadS [StackConfigInput]
readsPrec :: Int -> ReadS StackConfigInput
$creadsPrec :: Int -> ReadS StackConfigInput
Prelude.Read, Int -> StackConfigInput -> ShowS
[StackConfigInput] -> ShowS
StackConfigInput -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StackConfigInput] -> ShowS
$cshowList :: [StackConfigInput] -> ShowS
show :: StackConfigInput -> String
$cshow :: StackConfigInput -> String
showsPrec :: Int -> StackConfigInput -> ShowS
$cshowsPrec :: Int -> StackConfigInput -> ShowS
Prelude.Show, forall x. Rep StackConfigInput x -> StackConfigInput
forall x. StackConfigInput -> Rep StackConfigInput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StackConfigInput x -> StackConfigInput
$cfrom :: forall x. StackConfigInput -> Rep StackConfigInput x
Prelude.Generic)

-- |
-- Create a value of 'StackConfigInput' 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:
--
-- 'outputResolution', 'stackConfigInput_outputResolution' -
--
-- 'targetBands', 'stackConfigInput_targetBands' -
newStackConfigInput ::
  StackConfigInput
newStackConfigInput :: StackConfigInput
newStackConfigInput =
  StackConfigInput'
    { $sel:outputResolution:StackConfigInput' :: Maybe OutputResolutionStackInput
outputResolution =
        forall a. Maybe a
Prelude.Nothing,
      $sel:targetBands:StackConfigInput' :: Maybe (NonEmpty Text)
targetBands = forall a. Maybe a
Prelude.Nothing
    }

stackConfigInput_outputResolution :: Lens.Lens' StackConfigInput (Prelude.Maybe OutputResolutionStackInput)
stackConfigInput_outputResolution :: Lens' StackConfigInput (Maybe OutputResolutionStackInput)
stackConfigInput_outputResolution = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackConfigInput' {Maybe OutputResolutionStackInput
outputResolution :: Maybe OutputResolutionStackInput
$sel:outputResolution:StackConfigInput' :: StackConfigInput -> Maybe OutputResolutionStackInput
outputResolution} -> Maybe OutputResolutionStackInput
outputResolution) (\s :: StackConfigInput
s@StackConfigInput' {} Maybe OutputResolutionStackInput
a -> StackConfigInput
s {$sel:outputResolution:StackConfigInput' :: Maybe OutputResolutionStackInput
outputResolution = Maybe OutputResolutionStackInput
a} :: StackConfigInput)

stackConfigInput_targetBands :: Lens.Lens' StackConfigInput (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
stackConfigInput_targetBands :: Lens' StackConfigInput (Maybe (NonEmpty Text))
stackConfigInput_targetBands = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StackConfigInput' {Maybe (NonEmpty Text)
targetBands :: Maybe (NonEmpty Text)
$sel:targetBands:StackConfigInput' :: StackConfigInput -> Maybe (NonEmpty Text)
targetBands} -> Maybe (NonEmpty Text)
targetBands) (\s :: StackConfigInput
s@StackConfigInput' {} Maybe (NonEmpty Text)
a -> StackConfigInput
s {$sel:targetBands:StackConfigInput' :: Maybe (NonEmpty Text)
targetBands = Maybe (NonEmpty Text)
a} :: StackConfigInput) 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 StackConfigInput where
  parseJSON :: Value -> Parser StackConfigInput
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"StackConfigInput"
      ( \Object
x ->
          Maybe OutputResolutionStackInput
-> Maybe (NonEmpty Text) -> StackConfigInput
StackConfigInput'
            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
"OutputResolution")
            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 StackConfigInput where
  hashWithSalt :: Int -> StackConfigInput -> Int
hashWithSalt Int
_salt StackConfigInput' {Maybe (NonEmpty Text)
Maybe OutputResolutionStackInput
targetBands :: Maybe (NonEmpty Text)
outputResolution :: Maybe OutputResolutionStackInput
$sel:targetBands:StackConfigInput' :: StackConfigInput -> Maybe (NonEmpty Text)
$sel:outputResolution:StackConfigInput' :: StackConfigInput -> Maybe OutputResolutionStackInput
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe OutputResolutionStackInput
outputResolution
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
targetBands

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

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