{-# 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 #-}
module Amazonka.SageMakerGeoSpatial.Types.ResamplingConfigInput 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.AlgorithmNameResampling
import Amazonka.SageMakerGeoSpatial.Types.OutputResolutionResamplingInput
data ResamplingConfigInput = ResamplingConfigInput'
{
ResamplingConfigInput -> Maybe AlgorithmNameResampling
algorithmName :: Prelude.Maybe AlgorithmNameResampling,
ResamplingConfigInput -> Maybe (NonEmpty Text)
targetBands :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
ResamplingConfigInput -> OutputResolutionResamplingInput
outputResolution :: OutputResolutionResamplingInput
}
deriving (ResamplingConfigInput -> ResamplingConfigInput -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResamplingConfigInput -> ResamplingConfigInput -> Bool
$c/= :: ResamplingConfigInput -> ResamplingConfigInput -> Bool
== :: ResamplingConfigInput -> ResamplingConfigInput -> Bool
$c== :: ResamplingConfigInput -> ResamplingConfigInput -> Bool
Prelude.Eq, ReadPrec [ResamplingConfigInput]
ReadPrec ResamplingConfigInput
Int -> ReadS ResamplingConfigInput
ReadS [ResamplingConfigInput]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResamplingConfigInput]
$creadListPrec :: ReadPrec [ResamplingConfigInput]
readPrec :: ReadPrec ResamplingConfigInput
$creadPrec :: ReadPrec ResamplingConfigInput
readList :: ReadS [ResamplingConfigInput]
$creadList :: ReadS [ResamplingConfigInput]
readsPrec :: Int -> ReadS ResamplingConfigInput
$creadsPrec :: Int -> ReadS ResamplingConfigInput
Prelude.Read, Int -> ResamplingConfigInput -> ShowS
[ResamplingConfigInput] -> ShowS
ResamplingConfigInput -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResamplingConfigInput] -> ShowS
$cshowList :: [ResamplingConfigInput] -> ShowS
show :: ResamplingConfigInput -> String
$cshow :: ResamplingConfigInput -> String
showsPrec :: Int -> ResamplingConfigInput -> ShowS
$cshowsPrec :: Int -> ResamplingConfigInput -> ShowS
Prelude.Show, forall x. Rep ResamplingConfigInput x -> ResamplingConfigInput
forall x. ResamplingConfigInput -> Rep ResamplingConfigInput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResamplingConfigInput x -> ResamplingConfigInput
$cfrom :: forall x. ResamplingConfigInput -> Rep ResamplingConfigInput x
Prelude.Generic)
newResamplingConfigInput ::
OutputResolutionResamplingInput ->
ResamplingConfigInput
newResamplingConfigInput :: OutputResolutionResamplingInput -> ResamplingConfigInput
newResamplingConfigInput OutputResolutionResamplingInput
pOutputResolution_ =
ResamplingConfigInput'
{ $sel:algorithmName:ResamplingConfigInput' :: Maybe AlgorithmNameResampling
algorithmName =
forall a. Maybe a
Prelude.Nothing,
$sel:targetBands:ResamplingConfigInput' :: Maybe (NonEmpty Text)
targetBands = forall a. Maybe a
Prelude.Nothing,
$sel:outputResolution:ResamplingConfigInput' :: OutputResolutionResamplingInput
outputResolution = OutputResolutionResamplingInput
pOutputResolution_
}
resamplingConfigInput_algorithmName :: Lens.Lens' ResamplingConfigInput (Prelude.Maybe AlgorithmNameResampling)
resamplingConfigInput_algorithmName :: Lens' ResamplingConfigInput (Maybe AlgorithmNameResampling)
resamplingConfigInput_algorithmName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResamplingConfigInput' {Maybe AlgorithmNameResampling
algorithmName :: Maybe AlgorithmNameResampling
$sel:algorithmName:ResamplingConfigInput' :: ResamplingConfigInput -> Maybe AlgorithmNameResampling
algorithmName} -> Maybe AlgorithmNameResampling
algorithmName) (\s :: ResamplingConfigInput
s@ResamplingConfigInput' {} Maybe AlgorithmNameResampling
a -> ResamplingConfigInput
s {$sel:algorithmName:ResamplingConfigInput' :: Maybe AlgorithmNameResampling
algorithmName = Maybe AlgorithmNameResampling
a} :: ResamplingConfigInput)
resamplingConfigInput_targetBands :: Lens.Lens' ResamplingConfigInput (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
resamplingConfigInput_targetBands :: Lens' ResamplingConfigInput (Maybe (NonEmpty Text))
resamplingConfigInput_targetBands = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResamplingConfigInput' {Maybe (NonEmpty Text)
targetBands :: Maybe (NonEmpty Text)
$sel:targetBands:ResamplingConfigInput' :: ResamplingConfigInput -> Maybe (NonEmpty Text)
targetBands} -> Maybe (NonEmpty Text)
targetBands) (\s :: ResamplingConfigInput
s@ResamplingConfigInput' {} Maybe (NonEmpty Text)
a -> ResamplingConfigInput
s {$sel:targetBands:ResamplingConfigInput' :: Maybe (NonEmpty Text)
targetBands = Maybe (NonEmpty Text)
a} :: ResamplingConfigInput) 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
resamplingConfigInput_outputResolution :: Lens.Lens' ResamplingConfigInput OutputResolutionResamplingInput
resamplingConfigInput_outputResolution :: Lens' ResamplingConfigInput OutputResolutionResamplingInput
resamplingConfigInput_outputResolution = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResamplingConfigInput' {OutputResolutionResamplingInput
outputResolution :: OutputResolutionResamplingInput
$sel:outputResolution:ResamplingConfigInput' :: ResamplingConfigInput -> OutputResolutionResamplingInput
outputResolution} -> OutputResolutionResamplingInput
outputResolution) (\s :: ResamplingConfigInput
s@ResamplingConfigInput' {} OutputResolutionResamplingInput
a -> ResamplingConfigInput
s {$sel:outputResolution:ResamplingConfigInput' :: OutputResolutionResamplingInput
outputResolution = OutputResolutionResamplingInput
a} :: ResamplingConfigInput)
instance Data.FromJSON ResamplingConfigInput where
parseJSON :: Value -> Parser ResamplingConfigInput
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ResamplingConfigInput"
( \Object
x ->
Maybe AlgorithmNameResampling
-> Maybe (NonEmpty Text)
-> OutputResolutionResamplingInput
-> ResamplingConfigInput
ResamplingConfigInput'
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")
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
"OutputResolution")
)
instance Prelude.Hashable ResamplingConfigInput where
hashWithSalt :: Int -> ResamplingConfigInput -> Int
hashWithSalt Int
_salt ResamplingConfigInput' {Maybe (NonEmpty Text)
Maybe AlgorithmNameResampling
OutputResolutionResamplingInput
outputResolution :: OutputResolutionResamplingInput
targetBands :: Maybe (NonEmpty Text)
algorithmName :: Maybe AlgorithmNameResampling
$sel:outputResolution:ResamplingConfigInput' :: ResamplingConfigInput -> OutputResolutionResamplingInput
$sel:targetBands:ResamplingConfigInput' :: ResamplingConfigInput -> Maybe (NonEmpty Text)
$sel:algorithmName:ResamplingConfigInput' :: ResamplingConfigInput -> Maybe AlgorithmNameResampling
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AlgorithmNameResampling
algorithmName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
targetBands
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` OutputResolutionResamplingInput
outputResolution
instance Prelude.NFData ResamplingConfigInput where
rnf :: ResamplingConfigInput -> ()
rnf ResamplingConfigInput' {Maybe (NonEmpty Text)
Maybe AlgorithmNameResampling
OutputResolutionResamplingInput
outputResolution :: OutputResolutionResamplingInput
targetBands :: Maybe (NonEmpty Text)
algorithmName :: Maybe AlgorithmNameResampling
$sel:outputResolution:ResamplingConfigInput' :: ResamplingConfigInput -> OutputResolutionResamplingInput
$sel:targetBands:ResamplingConfigInput' :: ResamplingConfigInput -> Maybe (NonEmpty Text)
$sel:algorithmName:ResamplingConfigInput' :: ResamplingConfigInput -> Maybe AlgorithmNameResampling
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe AlgorithmNameResampling
algorithmName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
targetBands
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf OutputResolutionResamplingInput
outputResolution
instance Data.ToJSON ResamplingConfigInput where
toJSON :: ResamplingConfigInput -> Value
toJSON ResamplingConfigInput' {Maybe (NonEmpty Text)
Maybe AlgorithmNameResampling
OutputResolutionResamplingInput
outputResolution :: OutputResolutionResamplingInput
targetBands :: Maybe (NonEmpty Text)
algorithmName :: Maybe AlgorithmNameResampling
$sel:outputResolution:ResamplingConfigInput' :: ResamplingConfigInput -> OutputResolutionResamplingInput
$sel:targetBands:ResamplingConfigInput' :: ResamplingConfigInput -> Maybe (NonEmpty Text)
$sel:algorithmName:ResamplingConfigInput' :: ResamplingConfigInput -> Maybe AlgorithmNameResampling
..} =
[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 AlgorithmNameResampling
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,
forall a. a -> Maybe a
Prelude.Just
(Key
"OutputResolution" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= OutputResolutionResamplingInput
outputResolution)
]
)