{-# 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.Segment where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Segment = Segment'
{
Segment -> Natural
segmentNumber :: Prelude.Natural,
Segment -> Natural
totalSegments :: Prelude.Natural
}
deriving (Segment -> Segment -> Bool
(Segment -> Segment -> Bool)
-> (Segment -> Segment -> Bool) -> Eq Segment
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Segment -> Segment -> Bool
$c/= :: Segment -> Segment -> Bool
== :: Segment -> Segment -> Bool
$c== :: Segment -> Segment -> Bool
Prelude.Eq, ReadPrec [Segment]
ReadPrec Segment
Int -> ReadS Segment
ReadS [Segment]
(Int -> ReadS Segment)
-> ReadS [Segment]
-> ReadPrec Segment
-> ReadPrec [Segment]
-> Read Segment
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Segment]
$creadListPrec :: ReadPrec [Segment]
readPrec :: ReadPrec Segment
$creadPrec :: ReadPrec Segment
readList :: ReadS [Segment]
$creadList :: ReadS [Segment]
readsPrec :: Int -> ReadS Segment
$creadsPrec :: Int -> ReadS Segment
Prelude.Read, Int -> Segment -> ShowS
[Segment] -> ShowS
Segment -> String
(Int -> Segment -> ShowS)
-> (Segment -> String) -> ([Segment] -> ShowS) -> Show Segment
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Segment] -> ShowS
$cshowList :: [Segment] -> ShowS
show :: Segment -> String
$cshow :: Segment -> String
showsPrec :: Int -> Segment -> ShowS
$cshowsPrec :: Int -> Segment -> ShowS
Prelude.Show, (forall x. Segment -> Rep Segment x)
-> (forall x. Rep Segment x -> Segment) -> Generic Segment
forall x. Rep Segment x -> Segment
forall x. Segment -> Rep Segment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Segment x -> Segment
$cfrom :: forall x. Segment -> Rep Segment x
Prelude.Generic)
newSegment ::
Prelude.Natural ->
Prelude.Natural ->
Segment
newSegment :: Natural -> Natural -> Segment
newSegment Natural
pSegmentNumber_ Natural
pTotalSegments_ =
Segment' :: Natural -> Natural -> Segment
Segment'
{ $sel:segmentNumber:Segment' :: Natural
segmentNumber = Natural
pSegmentNumber_,
$sel:totalSegments:Segment' :: Natural
totalSegments = Natural
pTotalSegments_
}
segment_segmentNumber :: Lens.Lens' Segment Prelude.Natural
segment_segmentNumber :: (Natural -> f Natural) -> Segment -> f Segment
segment_segmentNumber = (Segment -> Natural)
-> (Segment -> Natural -> Segment)
-> Lens Segment Segment Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Segment' {Natural
segmentNumber :: Natural
$sel:segmentNumber:Segment' :: Segment -> Natural
segmentNumber} -> Natural
segmentNumber) (\s :: Segment
s@Segment' {} Natural
a -> Segment
s {$sel:segmentNumber:Segment' :: Natural
segmentNumber = Natural
a} :: Segment)
segment_totalSegments :: Lens.Lens' Segment Prelude.Natural
segment_totalSegments :: (Natural -> f Natural) -> Segment -> f Segment
segment_totalSegments = (Segment -> Natural)
-> (Segment -> Natural -> Segment)
-> Lens Segment Segment Natural Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Segment' {Natural
totalSegments :: Natural
$sel:totalSegments:Segment' :: Segment -> Natural
totalSegments} -> Natural
totalSegments) (\s :: Segment
s@Segment' {} Natural
a -> Segment
s {$sel:totalSegments:Segment' :: Natural
totalSegments = Natural
a} :: Segment)
instance Prelude.Hashable Segment
instance Prelude.NFData Segment
instance Core.ToJSON Segment where
toJSON :: Segment -> Value
toJSON Segment' {Natural
totalSegments :: Natural
segmentNumber :: Natural
$sel:totalSegments:Segment' :: Segment -> Natural
$sel:segmentNumber:Segment' :: Segment -> Natural
..} =
[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
"SegmentNumber" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
segmentNumber),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"TotalSegments" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
totalSegments)
]
)