{-# 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.Glue.Types.PartitionInput where
import qualified Amazonka.Core as Core
import Amazonka.Glue.Types.StorageDescriptor
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PartitionInput = PartitionInput'
{
PartitionInput -> Maybe [Text]
values :: Prelude.Maybe [Prelude.Text],
PartitionInput -> Maybe POSIX
lastAnalyzedTime :: Prelude.Maybe Core.POSIX,
PartitionInput -> Maybe StorageDescriptor
storageDescriptor :: Prelude.Maybe StorageDescriptor,
PartitionInput -> Maybe (HashMap Text Text)
parameters :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
PartitionInput -> Maybe POSIX
lastAccessTime :: Prelude.Maybe Core.POSIX
}
deriving (PartitionInput -> PartitionInput -> Bool
(PartitionInput -> PartitionInput -> Bool)
-> (PartitionInput -> PartitionInput -> Bool) -> Eq PartitionInput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PartitionInput -> PartitionInput -> Bool
$c/= :: PartitionInput -> PartitionInput -> Bool
== :: PartitionInput -> PartitionInput -> Bool
$c== :: PartitionInput -> PartitionInput -> Bool
Prelude.Eq, ReadPrec [PartitionInput]
ReadPrec PartitionInput
Int -> ReadS PartitionInput
ReadS [PartitionInput]
(Int -> ReadS PartitionInput)
-> ReadS [PartitionInput]
-> ReadPrec PartitionInput
-> ReadPrec [PartitionInput]
-> Read PartitionInput
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PartitionInput]
$creadListPrec :: ReadPrec [PartitionInput]
readPrec :: ReadPrec PartitionInput
$creadPrec :: ReadPrec PartitionInput
readList :: ReadS [PartitionInput]
$creadList :: ReadS [PartitionInput]
readsPrec :: Int -> ReadS PartitionInput
$creadsPrec :: Int -> ReadS PartitionInput
Prelude.Read, Int -> PartitionInput -> ShowS
[PartitionInput] -> ShowS
PartitionInput -> String
(Int -> PartitionInput -> ShowS)
-> (PartitionInput -> String)
-> ([PartitionInput] -> ShowS)
-> Show PartitionInput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PartitionInput] -> ShowS
$cshowList :: [PartitionInput] -> ShowS
show :: PartitionInput -> String
$cshow :: PartitionInput -> String
showsPrec :: Int -> PartitionInput -> ShowS
$cshowsPrec :: Int -> PartitionInput -> ShowS
Prelude.Show, (forall x. PartitionInput -> Rep PartitionInput x)
-> (forall x. Rep PartitionInput x -> PartitionInput)
-> Generic PartitionInput
forall x. Rep PartitionInput x -> PartitionInput
forall x. PartitionInput -> Rep PartitionInput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PartitionInput x -> PartitionInput
$cfrom :: forall x. PartitionInput -> Rep PartitionInput x
Prelude.Generic)
newPartitionInput ::
PartitionInput
newPartitionInput :: PartitionInput
newPartitionInput =
PartitionInput' :: Maybe [Text]
-> Maybe POSIX
-> Maybe StorageDescriptor
-> Maybe (HashMap Text Text)
-> Maybe POSIX
-> PartitionInput
PartitionInput'
{ $sel:values:PartitionInput' :: Maybe [Text]
values = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:lastAnalyzedTime:PartitionInput' :: Maybe POSIX
lastAnalyzedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:storageDescriptor:PartitionInput' :: Maybe StorageDescriptor
storageDescriptor = Maybe StorageDescriptor
forall a. Maybe a
Prelude.Nothing,
$sel:parameters:PartitionInput' :: Maybe (HashMap Text Text)
parameters = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:lastAccessTime:PartitionInput' :: Maybe POSIX
lastAccessTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
partitionInput_values :: Lens.Lens' PartitionInput (Prelude.Maybe [Prelude.Text])
partitionInput_values :: (Maybe [Text] -> f (Maybe [Text]))
-> PartitionInput -> f PartitionInput
partitionInput_values = (PartitionInput -> Maybe [Text])
-> (PartitionInput -> Maybe [Text] -> PartitionInput)
-> Lens PartitionInput PartitionInput (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PartitionInput' {Maybe [Text]
values :: Maybe [Text]
$sel:values:PartitionInput' :: PartitionInput -> Maybe [Text]
values} -> Maybe [Text]
values) (\s :: PartitionInput
s@PartitionInput' {} Maybe [Text]
a -> PartitionInput
s {$sel:values:PartitionInput' :: Maybe [Text]
values = Maybe [Text]
a} :: PartitionInput) ((Maybe [Text] -> f (Maybe [Text]))
-> PartitionInput -> f PartitionInput)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> PartitionInput
-> f PartitionInput
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
partitionInput_lastAnalyzedTime :: Lens.Lens' PartitionInput (Prelude.Maybe Prelude.UTCTime)
partitionInput_lastAnalyzedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> PartitionInput -> f PartitionInput
partitionInput_lastAnalyzedTime = (PartitionInput -> Maybe POSIX)
-> (PartitionInput -> Maybe POSIX -> PartitionInput)
-> Lens PartitionInput PartitionInput (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PartitionInput' {Maybe POSIX
lastAnalyzedTime :: Maybe POSIX
$sel:lastAnalyzedTime:PartitionInput' :: PartitionInput -> Maybe POSIX
lastAnalyzedTime} -> Maybe POSIX
lastAnalyzedTime) (\s :: PartitionInput
s@PartitionInput' {} Maybe POSIX
a -> PartitionInput
s {$sel:lastAnalyzedTime:PartitionInput' :: Maybe POSIX
lastAnalyzedTime = Maybe POSIX
a} :: PartitionInput) ((Maybe POSIX -> f (Maybe POSIX))
-> PartitionInput -> f PartitionInput)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> PartitionInput
-> f PartitionInput
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
partitionInput_storageDescriptor :: Lens.Lens' PartitionInput (Prelude.Maybe StorageDescriptor)
partitionInput_storageDescriptor :: (Maybe StorageDescriptor -> f (Maybe StorageDescriptor))
-> PartitionInput -> f PartitionInput
partitionInput_storageDescriptor = (PartitionInput -> Maybe StorageDescriptor)
-> (PartitionInput -> Maybe StorageDescriptor -> PartitionInput)
-> Lens
PartitionInput
PartitionInput
(Maybe StorageDescriptor)
(Maybe StorageDescriptor)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PartitionInput' {Maybe StorageDescriptor
storageDescriptor :: Maybe StorageDescriptor
$sel:storageDescriptor:PartitionInput' :: PartitionInput -> Maybe StorageDescriptor
storageDescriptor} -> Maybe StorageDescriptor
storageDescriptor) (\s :: PartitionInput
s@PartitionInput' {} Maybe StorageDescriptor
a -> PartitionInput
s {$sel:storageDescriptor:PartitionInput' :: Maybe StorageDescriptor
storageDescriptor = Maybe StorageDescriptor
a} :: PartitionInput)
partitionInput_parameters :: Lens.Lens' PartitionInput (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
partitionInput_parameters :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> PartitionInput -> f PartitionInput
partitionInput_parameters = (PartitionInput -> Maybe (HashMap Text Text))
-> (PartitionInput -> Maybe (HashMap Text Text) -> PartitionInput)
-> Lens
PartitionInput
PartitionInput
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PartitionInput' {Maybe (HashMap Text Text)
parameters :: Maybe (HashMap Text Text)
$sel:parameters:PartitionInput' :: PartitionInput -> Maybe (HashMap Text Text)
parameters} -> Maybe (HashMap Text Text)
parameters) (\s :: PartitionInput
s@PartitionInput' {} Maybe (HashMap Text Text)
a -> PartitionInput
s {$sel:parameters:PartitionInput' :: Maybe (HashMap Text Text)
parameters = Maybe (HashMap Text Text)
a} :: PartitionInput) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> PartitionInput -> f PartitionInput)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> PartitionInput
-> f PartitionInput
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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 AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
partitionInput_lastAccessTime :: Lens.Lens' PartitionInput (Prelude.Maybe Prelude.UTCTime)
partitionInput_lastAccessTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> PartitionInput -> f PartitionInput
partitionInput_lastAccessTime = (PartitionInput -> Maybe POSIX)
-> (PartitionInput -> Maybe POSIX -> PartitionInput)
-> Lens PartitionInput PartitionInput (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PartitionInput' {Maybe POSIX
lastAccessTime :: Maybe POSIX
$sel:lastAccessTime:PartitionInput' :: PartitionInput -> Maybe POSIX
lastAccessTime} -> Maybe POSIX
lastAccessTime) (\s :: PartitionInput
s@PartitionInput' {} Maybe POSIX
a -> PartitionInput
s {$sel:lastAccessTime:PartitionInput' :: Maybe POSIX
lastAccessTime = Maybe POSIX
a} :: PartitionInput) ((Maybe POSIX -> f (Maybe POSIX))
-> PartitionInput -> f PartitionInput)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> PartitionInput
-> f PartitionInput
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Prelude.Hashable PartitionInput
instance Prelude.NFData PartitionInput
instance Core.ToJSON PartitionInput where
toJSON :: PartitionInput -> Value
toJSON PartitionInput' {Maybe [Text]
Maybe (HashMap Text Text)
Maybe POSIX
Maybe StorageDescriptor
lastAccessTime :: Maybe POSIX
parameters :: Maybe (HashMap Text Text)
storageDescriptor :: Maybe StorageDescriptor
lastAnalyzedTime :: Maybe POSIX
values :: Maybe [Text]
$sel:lastAccessTime:PartitionInput' :: PartitionInput -> Maybe POSIX
$sel:parameters:PartitionInput' :: PartitionInput -> Maybe (HashMap Text Text)
$sel:storageDescriptor:PartitionInput' :: PartitionInput -> Maybe StorageDescriptor
$sel:lastAnalyzedTime:PartitionInput' :: PartitionInput -> Maybe POSIX
$sel:values:PartitionInput' :: PartitionInput -> Maybe [Text]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Values" 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]
values,
(Text
"LastAnalyzedTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
lastAnalyzedTime,
(Text
"StorageDescriptor" Text -> StorageDescriptor -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(StorageDescriptor -> Pair)
-> Maybe StorageDescriptor -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe StorageDescriptor
storageDescriptor,
(Text
"Parameters" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
parameters,
(Text
"LastAccessTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
lastAccessTime
]
)