{-# 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.Rekognition.Types.SegmentTypeInfo where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Rekognition.Types.SegmentType
data SegmentTypeInfo = SegmentTypeInfo'
{
SegmentTypeInfo -> Maybe Text
modelVersion :: Prelude.Maybe Prelude.Text,
SegmentTypeInfo -> Maybe SegmentType
type' :: Prelude.Maybe SegmentType
}
deriving (SegmentTypeInfo -> SegmentTypeInfo -> Bool
(SegmentTypeInfo -> SegmentTypeInfo -> Bool)
-> (SegmentTypeInfo -> SegmentTypeInfo -> Bool)
-> Eq SegmentTypeInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SegmentTypeInfo -> SegmentTypeInfo -> Bool
$c/= :: SegmentTypeInfo -> SegmentTypeInfo -> Bool
== :: SegmentTypeInfo -> SegmentTypeInfo -> Bool
$c== :: SegmentTypeInfo -> SegmentTypeInfo -> Bool
Prelude.Eq, ReadPrec [SegmentTypeInfo]
ReadPrec SegmentTypeInfo
Int -> ReadS SegmentTypeInfo
ReadS [SegmentTypeInfo]
(Int -> ReadS SegmentTypeInfo)
-> ReadS [SegmentTypeInfo]
-> ReadPrec SegmentTypeInfo
-> ReadPrec [SegmentTypeInfo]
-> Read SegmentTypeInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SegmentTypeInfo]
$creadListPrec :: ReadPrec [SegmentTypeInfo]
readPrec :: ReadPrec SegmentTypeInfo
$creadPrec :: ReadPrec SegmentTypeInfo
readList :: ReadS [SegmentTypeInfo]
$creadList :: ReadS [SegmentTypeInfo]
readsPrec :: Int -> ReadS SegmentTypeInfo
$creadsPrec :: Int -> ReadS SegmentTypeInfo
Prelude.Read, Int -> SegmentTypeInfo -> ShowS
[SegmentTypeInfo] -> ShowS
SegmentTypeInfo -> String
(Int -> SegmentTypeInfo -> ShowS)
-> (SegmentTypeInfo -> String)
-> ([SegmentTypeInfo] -> ShowS)
-> Show SegmentTypeInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SegmentTypeInfo] -> ShowS
$cshowList :: [SegmentTypeInfo] -> ShowS
show :: SegmentTypeInfo -> String
$cshow :: SegmentTypeInfo -> String
showsPrec :: Int -> SegmentTypeInfo -> ShowS
$cshowsPrec :: Int -> SegmentTypeInfo -> ShowS
Prelude.Show, (forall x. SegmentTypeInfo -> Rep SegmentTypeInfo x)
-> (forall x. Rep SegmentTypeInfo x -> SegmentTypeInfo)
-> Generic SegmentTypeInfo
forall x. Rep SegmentTypeInfo x -> SegmentTypeInfo
forall x. SegmentTypeInfo -> Rep SegmentTypeInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SegmentTypeInfo x -> SegmentTypeInfo
$cfrom :: forall x. SegmentTypeInfo -> Rep SegmentTypeInfo x
Prelude.Generic)
newSegmentTypeInfo ::
SegmentTypeInfo
newSegmentTypeInfo :: SegmentTypeInfo
newSegmentTypeInfo =
SegmentTypeInfo' :: Maybe Text -> Maybe SegmentType -> SegmentTypeInfo
SegmentTypeInfo'
{ $sel:modelVersion:SegmentTypeInfo' :: Maybe Text
modelVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:type':SegmentTypeInfo' :: Maybe SegmentType
type' = Maybe SegmentType
forall a. Maybe a
Prelude.Nothing
}
segmentTypeInfo_modelVersion :: Lens.Lens' SegmentTypeInfo (Prelude.Maybe Prelude.Text)
segmentTypeInfo_modelVersion :: (Maybe Text -> f (Maybe Text))
-> SegmentTypeInfo -> f SegmentTypeInfo
segmentTypeInfo_modelVersion = (SegmentTypeInfo -> Maybe Text)
-> (SegmentTypeInfo -> Maybe Text -> SegmentTypeInfo)
-> Lens SegmentTypeInfo SegmentTypeInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentTypeInfo' {Maybe Text
modelVersion :: Maybe Text
$sel:modelVersion:SegmentTypeInfo' :: SegmentTypeInfo -> Maybe Text
modelVersion} -> Maybe Text
modelVersion) (\s :: SegmentTypeInfo
s@SegmentTypeInfo' {} Maybe Text
a -> SegmentTypeInfo
s {$sel:modelVersion:SegmentTypeInfo' :: Maybe Text
modelVersion = Maybe Text
a} :: SegmentTypeInfo)
segmentTypeInfo_type :: Lens.Lens' SegmentTypeInfo (Prelude.Maybe SegmentType)
segmentTypeInfo_type :: (Maybe SegmentType -> f (Maybe SegmentType))
-> SegmentTypeInfo -> f SegmentTypeInfo
segmentTypeInfo_type = (SegmentTypeInfo -> Maybe SegmentType)
-> (SegmentTypeInfo -> Maybe SegmentType -> SegmentTypeInfo)
-> Lens
SegmentTypeInfo
SegmentTypeInfo
(Maybe SegmentType)
(Maybe SegmentType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SegmentTypeInfo' {Maybe SegmentType
type' :: Maybe SegmentType
$sel:type':SegmentTypeInfo' :: SegmentTypeInfo -> Maybe SegmentType
type'} -> Maybe SegmentType
type') (\s :: SegmentTypeInfo
s@SegmentTypeInfo' {} Maybe SegmentType
a -> SegmentTypeInfo
s {$sel:type':SegmentTypeInfo' :: Maybe SegmentType
type' = Maybe SegmentType
a} :: SegmentTypeInfo)
instance Core.FromJSON SegmentTypeInfo where
parseJSON :: Value -> Parser SegmentTypeInfo
parseJSON =
String
-> (Object -> Parser SegmentTypeInfo)
-> Value
-> Parser SegmentTypeInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SegmentTypeInfo"
( \Object
x ->
Maybe Text -> Maybe SegmentType -> SegmentTypeInfo
SegmentTypeInfo'
(Maybe Text -> Maybe SegmentType -> SegmentTypeInfo)
-> Parser (Maybe Text)
-> Parser (Maybe SegmentType -> SegmentTypeInfo)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ModelVersion")
Parser (Maybe SegmentType -> SegmentTypeInfo)
-> Parser (Maybe SegmentType) -> Parser SegmentTypeInfo
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SegmentType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Type")
)
instance Prelude.Hashable SegmentTypeInfo
instance Prelude.NFData SegmentTypeInfo