{-# 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.SageMaker.Types.ProvisioningParameter where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ProvisioningParameter = ProvisioningParameter'
{
ProvisioningParameter -> Maybe Text
value :: Prelude.Maybe Prelude.Text,
ProvisioningParameter -> Maybe Text
key :: Prelude.Maybe Prelude.Text
}
deriving (ProvisioningParameter -> ProvisioningParameter -> Bool
(ProvisioningParameter -> ProvisioningParameter -> Bool)
-> (ProvisioningParameter -> ProvisioningParameter -> Bool)
-> Eq ProvisioningParameter
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProvisioningParameter -> ProvisioningParameter -> Bool
$c/= :: ProvisioningParameter -> ProvisioningParameter -> Bool
== :: ProvisioningParameter -> ProvisioningParameter -> Bool
$c== :: ProvisioningParameter -> ProvisioningParameter -> Bool
Prelude.Eq, ReadPrec [ProvisioningParameter]
ReadPrec ProvisioningParameter
Int -> ReadS ProvisioningParameter
ReadS [ProvisioningParameter]
(Int -> ReadS ProvisioningParameter)
-> ReadS [ProvisioningParameter]
-> ReadPrec ProvisioningParameter
-> ReadPrec [ProvisioningParameter]
-> Read ProvisioningParameter
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProvisioningParameter]
$creadListPrec :: ReadPrec [ProvisioningParameter]
readPrec :: ReadPrec ProvisioningParameter
$creadPrec :: ReadPrec ProvisioningParameter
readList :: ReadS [ProvisioningParameter]
$creadList :: ReadS [ProvisioningParameter]
readsPrec :: Int -> ReadS ProvisioningParameter
$creadsPrec :: Int -> ReadS ProvisioningParameter
Prelude.Read, Int -> ProvisioningParameter -> ShowS
[ProvisioningParameter] -> ShowS
ProvisioningParameter -> String
(Int -> ProvisioningParameter -> ShowS)
-> (ProvisioningParameter -> String)
-> ([ProvisioningParameter] -> ShowS)
-> Show ProvisioningParameter
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProvisioningParameter] -> ShowS
$cshowList :: [ProvisioningParameter] -> ShowS
show :: ProvisioningParameter -> String
$cshow :: ProvisioningParameter -> String
showsPrec :: Int -> ProvisioningParameter -> ShowS
$cshowsPrec :: Int -> ProvisioningParameter -> ShowS
Prelude.Show, (forall x. ProvisioningParameter -> Rep ProvisioningParameter x)
-> (forall x. Rep ProvisioningParameter x -> ProvisioningParameter)
-> Generic ProvisioningParameter
forall x. Rep ProvisioningParameter x -> ProvisioningParameter
forall x. ProvisioningParameter -> Rep ProvisioningParameter x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ProvisioningParameter x -> ProvisioningParameter
$cfrom :: forall x. ProvisioningParameter -> Rep ProvisioningParameter x
Prelude.Generic)
newProvisioningParameter ::
ProvisioningParameter
newProvisioningParameter :: ProvisioningParameter
newProvisioningParameter =
ProvisioningParameter' :: Maybe Text -> Maybe Text -> ProvisioningParameter
ProvisioningParameter'
{ $sel:value:ProvisioningParameter' :: Maybe Text
value = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:key:ProvisioningParameter' :: Maybe Text
key = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
provisioningParameter_value :: Lens.Lens' ProvisioningParameter (Prelude.Maybe Prelude.Text)
provisioningParameter_value :: (Maybe Text -> f (Maybe Text))
-> ProvisioningParameter -> f ProvisioningParameter
provisioningParameter_value = (ProvisioningParameter -> Maybe Text)
-> (ProvisioningParameter -> Maybe Text -> ProvisioningParameter)
-> Lens
ProvisioningParameter
ProvisioningParameter
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisioningParameter' {Maybe Text
value :: Maybe Text
$sel:value:ProvisioningParameter' :: ProvisioningParameter -> Maybe Text
value} -> Maybe Text
value) (\s :: ProvisioningParameter
s@ProvisioningParameter' {} Maybe Text
a -> ProvisioningParameter
s {$sel:value:ProvisioningParameter' :: Maybe Text
value = Maybe Text
a} :: ProvisioningParameter)
provisioningParameter_key :: Lens.Lens' ProvisioningParameter (Prelude.Maybe Prelude.Text)
provisioningParameter_key :: (Maybe Text -> f (Maybe Text))
-> ProvisioningParameter -> f ProvisioningParameter
provisioningParameter_key = (ProvisioningParameter -> Maybe Text)
-> (ProvisioningParameter -> Maybe Text -> ProvisioningParameter)
-> Lens
ProvisioningParameter
ProvisioningParameter
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProvisioningParameter' {Maybe Text
key :: Maybe Text
$sel:key:ProvisioningParameter' :: ProvisioningParameter -> Maybe Text
key} -> Maybe Text
key) (\s :: ProvisioningParameter
s@ProvisioningParameter' {} Maybe Text
a -> ProvisioningParameter
s {$sel:key:ProvisioningParameter' :: Maybe Text
key = Maybe Text
a} :: ProvisioningParameter)
instance Core.FromJSON ProvisioningParameter where
parseJSON :: Value -> Parser ProvisioningParameter
parseJSON =
String
-> (Object -> Parser ProvisioningParameter)
-> Value
-> Parser ProvisioningParameter
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ProvisioningParameter"
( \Object
x ->
Maybe Text -> Maybe Text -> ProvisioningParameter
ProvisioningParameter'
(Maybe Text -> Maybe Text -> ProvisioningParameter)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> ProvisioningParameter)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Value") Parser (Maybe Text -> ProvisioningParameter)
-> Parser (Maybe Text) -> Parser ProvisioningParameter
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Key")
)
instance Prelude.Hashable ProvisioningParameter
instance Prelude.NFData ProvisioningParameter
instance Core.ToJSON ProvisioningParameter where
toJSON :: ProvisioningParameter -> Value
toJSON ProvisioningParameter' {Maybe Text
key :: Maybe Text
value :: Maybe Text
$sel:key:ProvisioningParameter' :: ProvisioningParameter -> Maybe Text
$sel:value:ProvisioningParameter' :: ProvisioningParameter -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Value" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
value,
(Text
"Key" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
key
]
)