{-# 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.RobOMaker.Types.UploadConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RobOMaker.Types.UploadBehavior
data UploadConfiguration = UploadConfiguration'
{
UploadConfiguration -> Text
name :: Prelude.Text,
UploadConfiguration -> Text
path :: Prelude.Text,
UploadConfiguration -> UploadBehavior
uploadBehavior :: UploadBehavior
}
deriving (UploadConfiguration -> UploadConfiguration -> Bool
(UploadConfiguration -> UploadConfiguration -> Bool)
-> (UploadConfiguration -> UploadConfiguration -> Bool)
-> Eq UploadConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UploadConfiguration -> UploadConfiguration -> Bool
$c/= :: UploadConfiguration -> UploadConfiguration -> Bool
== :: UploadConfiguration -> UploadConfiguration -> Bool
$c== :: UploadConfiguration -> UploadConfiguration -> Bool
Prelude.Eq, ReadPrec [UploadConfiguration]
ReadPrec UploadConfiguration
Int -> ReadS UploadConfiguration
ReadS [UploadConfiguration]
(Int -> ReadS UploadConfiguration)
-> ReadS [UploadConfiguration]
-> ReadPrec UploadConfiguration
-> ReadPrec [UploadConfiguration]
-> Read UploadConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UploadConfiguration]
$creadListPrec :: ReadPrec [UploadConfiguration]
readPrec :: ReadPrec UploadConfiguration
$creadPrec :: ReadPrec UploadConfiguration
readList :: ReadS [UploadConfiguration]
$creadList :: ReadS [UploadConfiguration]
readsPrec :: Int -> ReadS UploadConfiguration
$creadsPrec :: Int -> ReadS UploadConfiguration
Prelude.Read, Int -> UploadConfiguration -> ShowS
[UploadConfiguration] -> ShowS
UploadConfiguration -> String
(Int -> UploadConfiguration -> ShowS)
-> (UploadConfiguration -> String)
-> ([UploadConfiguration] -> ShowS)
-> Show UploadConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UploadConfiguration] -> ShowS
$cshowList :: [UploadConfiguration] -> ShowS
show :: UploadConfiguration -> String
$cshow :: UploadConfiguration -> String
showsPrec :: Int -> UploadConfiguration -> ShowS
$cshowsPrec :: Int -> UploadConfiguration -> ShowS
Prelude.Show, (forall x. UploadConfiguration -> Rep UploadConfiguration x)
-> (forall x. Rep UploadConfiguration x -> UploadConfiguration)
-> Generic UploadConfiguration
forall x. Rep UploadConfiguration x -> UploadConfiguration
forall x. UploadConfiguration -> Rep UploadConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UploadConfiguration x -> UploadConfiguration
$cfrom :: forall x. UploadConfiguration -> Rep UploadConfiguration x
Prelude.Generic)
newUploadConfiguration ::
Prelude.Text ->
Prelude.Text ->
UploadBehavior ->
UploadConfiguration
newUploadConfiguration :: Text -> Text -> UploadBehavior -> UploadConfiguration
newUploadConfiguration Text
pName_ Text
pPath_ UploadBehavior
pUploadBehavior_ =
UploadConfiguration' :: Text -> Text -> UploadBehavior -> UploadConfiguration
UploadConfiguration'
{ $sel:name:UploadConfiguration' :: Text
name = Text
pName_,
$sel:path:UploadConfiguration' :: Text
path = Text
pPath_,
$sel:uploadBehavior:UploadConfiguration' :: UploadBehavior
uploadBehavior = UploadBehavior
pUploadBehavior_
}
uploadConfiguration_name :: Lens.Lens' UploadConfiguration Prelude.Text
uploadConfiguration_name :: (Text -> f Text) -> UploadConfiguration -> f UploadConfiguration
uploadConfiguration_name = (UploadConfiguration -> Text)
-> (UploadConfiguration -> Text -> UploadConfiguration)
-> Lens UploadConfiguration UploadConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadConfiguration' {Text
name :: Text
$sel:name:UploadConfiguration' :: UploadConfiguration -> Text
name} -> Text
name) (\s :: UploadConfiguration
s@UploadConfiguration' {} Text
a -> UploadConfiguration
s {$sel:name:UploadConfiguration' :: Text
name = Text
a} :: UploadConfiguration)
uploadConfiguration_path :: Lens.Lens' UploadConfiguration Prelude.Text
uploadConfiguration_path :: (Text -> f Text) -> UploadConfiguration -> f UploadConfiguration
uploadConfiguration_path = (UploadConfiguration -> Text)
-> (UploadConfiguration -> Text -> UploadConfiguration)
-> Lens UploadConfiguration UploadConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadConfiguration' {Text
path :: Text
$sel:path:UploadConfiguration' :: UploadConfiguration -> Text
path} -> Text
path) (\s :: UploadConfiguration
s@UploadConfiguration' {} Text
a -> UploadConfiguration
s {$sel:path:UploadConfiguration' :: Text
path = Text
a} :: UploadConfiguration)
uploadConfiguration_uploadBehavior :: Lens.Lens' UploadConfiguration UploadBehavior
uploadConfiguration_uploadBehavior :: (UploadBehavior -> f UploadBehavior)
-> UploadConfiguration -> f UploadConfiguration
uploadConfiguration_uploadBehavior = (UploadConfiguration -> UploadBehavior)
-> (UploadConfiguration -> UploadBehavior -> UploadConfiguration)
-> Lens
UploadConfiguration
UploadConfiguration
UploadBehavior
UploadBehavior
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UploadConfiguration' {UploadBehavior
uploadBehavior :: UploadBehavior
$sel:uploadBehavior:UploadConfiguration' :: UploadConfiguration -> UploadBehavior
uploadBehavior} -> UploadBehavior
uploadBehavior) (\s :: UploadConfiguration
s@UploadConfiguration' {} UploadBehavior
a -> UploadConfiguration
s {$sel:uploadBehavior:UploadConfiguration' :: UploadBehavior
uploadBehavior = UploadBehavior
a} :: UploadConfiguration)
instance Core.FromJSON UploadConfiguration where
parseJSON :: Value -> Parser UploadConfiguration
parseJSON =
String
-> (Object -> Parser UploadConfiguration)
-> Value
-> Parser UploadConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"UploadConfiguration"
( \Object
x ->
Text -> Text -> UploadBehavior -> UploadConfiguration
UploadConfiguration'
(Text -> Text -> UploadBehavior -> UploadConfiguration)
-> Parser Text
-> Parser (Text -> UploadBehavior -> UploadConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"name")
Parser (Text -> UploadBehavior -> UploadConfiguration)
-> Parser Text -> Parser (UploadBehavior -> UploadConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"path")
Parser (UploadBehavior -> UploadConfiguration)
-> Parser UploadBehavior -> Parser UploadConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser UploadBehavior
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"uploadBehavior")
)
instance Prelude.Hashable UploadConfiguration
instance Prelude.NFData UploadConfiguration
instance Core.ToJSON UploadConfiguration where
toJSON :: UploadConfiguration -> Value
toJSON UploadConfiguration' {Text
UploadBehavior
uploadBehavior :: UploadBehavior
path :: Text
name :: Text
$sel:uploadBehavior:UploadConfiguration' :: UploadConfiguration -> UploadBehavior
$sel:path:UploadConfiguration' :: UploadConfiguration -> Text
$sel:name:UploadConfiguration' :: UploadConfiguration -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
name),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"path" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
path),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"uploadBehavior" Text -> UploadBehavior -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= UploadBehavior
uploadBehavior)
]
)