{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data Segment = Segment'
{
Segment -> Natural
segmentNumber :: Prelude.Natural,
Segment -> Natural
totalSegments :: Prelude.Natural
}
deriving (Segment -> Segment -> Bool
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]
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
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. 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'
{ $sel:segmentNumber:Segment' :: Natural
segmentNumber = Natural
pSegmentNumber_,
$sel:totalSegments:Segment' :: Natural
totalSegments = Natural
pTotalSegments_
}
segment_segmentNumber :: Lens.Lens' Segment Prelude.Natural
segment_segmentNumber :: Lens' Segment Natural
segment_segmentNumber = 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 :: Lens' Segment Natural
segment_totalSegments = 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 where
hashWithSalt :: Int -> Segment -> Int
hashWithSalt Int
_salt Segment' {Natural
totalSegments :: Natural
segmentNumber :: Natural
$sel:totalSegments:Segment' :: Segment -> Natural
$sel:segmentNumber:Segment' :: Segment -> Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
segmentNumber
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Natural
totalSegments
instance Prelude.NFData Segment where
rnf :: Segment -> ()
rnf Segment' {Natural
totalSegments :: Natural
segmentNumber :: Natural
$sel:totalSegments:Segment' :: Segment -> Natural
$sel:segmentNumber:Segment' :: Segment -> Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Natural
segmentNumber
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Natural
totalSegments
instance Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"SegmentNumber" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
segmentNumber),
forall a. a -> Maybe a
Prelude.Just
(Key
"TotalSegments" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Natural
totalSegments)
]
)