{-# 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.DataSource 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.RobOMaker.Types.DataSourceType
import Amazonka.RobOMaker.Types.S3KeyOutput
data DataSource = DataSource'
{
DataSource -> Maybe Text
destination :: Prelude.Maybe Prelude.Text,
DataSource -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
DataSource -> Maybe Text
s3Bucket :: Prelude.Maybe Prelude.Text,
DataSource -> Maybe [S3KeyOutput]
s3Keys :: Prelude.Maybe [S3KeyOutput],
DataSource -> Maybe DataSourceType
type' :: Prelude.Maybe DataSourceType
}
deriving (DataSource -> DataSource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DataSource -> DataSource -> Bool
$c/= :: DataSource -> DataSource -> Bool
== :: DataSource -> DataSource -> Bool
$c== :: DataSource -> DataSource -> Bool
Prelude.Eq, ReadPrec [DataSource]
ReadPrec DataSource
Int -> ReadS DataSource
ReadS [DataSource]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DataSource]
$creadListPrec :: ReadPrec [DataSource]
readPrec :: ReadPrec DataSource
$creadPrec :: ReadPrec DataSource
readList :: ReadS [DataSource]
$creadList :: ReadS [DataSource]
readsPrec :: Int -> ReadS DataSource
$creadsPrec :: Int -> ReadS DataSource
Prelude.Read, Int -> DataSource -> ShowS
[DataSource] -> ShowS
DataSource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DataSource] -> ShowS
$cshowList :: [DataSource] -> ShowS
show :: DataSource -> String
$cshow :: DataSource -> String
showsPrec :: Int -> DataSource -> ShowS
$cshowsPrec :: Int -> DataSource -> ShowS
Prelude.Show, forall x. Rep DataSource x -> DataSource
forall x. DataSource -> Rep DataSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DataSource x -> DataSource
$cfrom :: forall x. DataSource -> Rep DataSource x
Prelude.Generic)
newDataSource ::
DataSource
newDataSource :: DataSource
newDataSource =
DataSource'
{ $sel:destination:DataSource' :: Maybe Text
destination = forall a. Maybe a
Prelude.Nothing,
$sel:name:DataSource' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:s3Bucket:DataSource' :: Maybe Text
s3Bucket = forall a. Maybe a
Prelude.Nothing,
$sel:s3Keys:DataSource' :: Maybe [S3KeyOutput]
s3Keys = forall a. Maybe a
Prelude.Nothing,
$sel:type':DataSource' :: Maybe DataSourceType
type' = forall a. Maybe a
Prelude.Nothing
}
dataSource_destination :: Lens.Lens' DataSource (Prelude.Maybe Prelude.Text)
dataSource_destination :: Lens' DataSource (Maybe Text)
dataSource_destination = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataSource' {Maybe Text
destination :: Maybe Text
$sel:destination:DataSource' :: DataSource -> Maybe Text
destination} -> Maybe Text
destination) (\s :: DataSource
s@DataSource' {} Maybe Text
a -> DataSource
s {$sel:destination:DataSource' :: Maybe Text
destination = Maybe Text
a} :: DataSource)
dataSource_name :: Lens.Lens' DataSource (Prelude.Maybe Prelude.Text)
dataSource_name :: Lens' DataSource (Maybe Text)
dataSource_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataSource' {Maybe Text
name :: Maybe Text
$sel:name:DataSource' :: DataSource -> Maybe Text
name} -> Maybe Text
name) (\s :: DataSource
s@DataSource' {} Maybe Text
a -> DataSource
s {$sel:name:DataSource' :: Maybe Text
name = Maybe Text
a} :: DataSource)
dataSource_s3Bucket :: Lens.Lens' DataSource (Prelude.Maybe Prelude.Text)
dataSource_s3Bucket :: Lens' DataSource (Maybe Text)
dataSource_s3Bucket = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataSource' {Maybe Text
s3Bucket :: Maybe Text
$sel:s3Bucket:DataSource' :: DataSource -> Maybe Text
s3Bucket} -> Maybe Text
s3Bucket) (\s :: DataSource
s@DataSource' {} Maybe Text
a -> DataSource
s {$sel:s3Bucket:DataSource' :: Maybe Text
s3Bucket = Maybe Text
a} :: DataSource)
dataSource_s3Keys :: Lens.Lens' DataSource (Prelude.Maybe [S3KeyOutput])
dataSource_s3Keys :: Lens' DataSource (Maybe [S3KeyOutput])
dataSource_s3Keys = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataSource' {Maybe [S3KeyOutput]
s3Keys :: Maybe [S3KeyOutput]
$sel:s3Keys:DataSource' :: DataSource -> Maybe [S3KeyOutput]
s3Keys} -> Maybe [S3KeyOutput]
s3Keys) (\s :: DataSource
s@DataSource' {} Maybe [S3KeyOutput]
a -> DataSource
s {$sel:s3Keys:DataSource' :: Maybe [S3KeyOutput]
s3Keys = Maybe [S3KeyOutput]
a} :: DataSource) 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
dataSource_type :: Lens.Lens' DataSource (Prelude.Maybe DataSourceType)
dataSource_type :: Lens' DataSource (Maybe DataSourceType)
dataSource_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataSource' {Maybe DataSourceType
type' :: Maybe DataSourceType
$sel:type':DataSource' :: DataSource -> Maybe DataSourceType
type'} -> Maybe DataSourceType
type') (\s :: DataSource
s@DataSource' {} Maybe DataSourceType
a -> DataSource
s {$sel:type':DataSource' :: Maybe DataSourceType
type' = Maybe DataSourceType
a} :: DataSource)
instance Data.FromJSON DataSource where
parseJSON :: Value -> Parser DataSource
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"DataSource"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [S3KeyOutput]
-> Maybe DataSourceType
-> DataSource
DataSource'
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
"destination")
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
"name")
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
"s3Bucket")
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
"s3Keys" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
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
"type")
)
instance Prelude.Hashable DataSource where
hashWithSalt :: Int -> DataSource -> Int
hashWithSalt Int
_salt DataSource' {Maybe [S3KeyOutput]
Maybe Text
Maybe DataSourceType
type' :: Maybe DataSourceType
s3Keys :: Maybe [S3KeyOutput]
s3Bucket :: Maybe Text
name :: Maybe Text
destination :: Maybe Text
$sel:type':DataSource' :: DataSource -> Maybe DataSourceType
$sel:s3Keys:DataSource' :: DataSource -> Maybe [S3KeyOutput]
$sel:s3Bucket:DataSource' :: DataSource -> Maybe Text
$sel:name:DataSource' :: DataSource -> Maybe Text
$sel:destination:DataSource' :: DataSource -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
destination
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
s3Bucket
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [S3KeyOutput]
s3Keys
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe DataSourceType
type'
instance Prelude.NFData DataSource where
rnf :: DataSource -> ()
rnf DataSource' {Maybe [S3KeyOutput]
Maybe Text
Maybe DataSourceType
type' :: Maybe DataSourceType
s3Keys :: Maybe [S3KeyOutput]
s3Bucket :: Maybe Text
name :: Maybe Text
destination :: Maybe Text
$sel:type':DataSource' :: DataSource -> Maybe DataSourceType
$sel:s3Keys:DataSource' :: DataSource -> Maybe [S3KeyOutput]
$sel:s3Bucket:DataSource' :: DataSource -> Maybe Text
$sel:name:DataSource' :: DataSource -> Maybe Text
$sel:destination:DataSource' :: DataSource -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
destination
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
s3Bucket
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [S3KeyOutput]
s3Keys
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe DataSourceType
type'