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