{-# 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.KinesisAnalyticsV2.Types.MavenReference 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 MavenReference = MavenReference'
{
MavenReference -> Text
groupId :: Prelude.Text,
MavenReference -> Text
artifactId :: Prelude.Text,
MavenReference -> Text
version :: Prelude.Text
}
deriving (MavenReference -> MavenReference -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MavenReference -> MavenReference -> Bool
$c/= :: MavenReference -> MavenReference -> Bool
== :: MavenReference -> MavenReference -> Bool
$c== :: MavenReference -> MavenReference -> Bool
Prelude.Eq, ReadPrec [MavenReference]
ReadPrec MavenReference
Int -> ReadS MavenReference
ReadS [MavenReference]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MavenReference]
$creadListPrec :: ReadPrec [MavenReference]
readPrec :: ReadPrec MavenReference
$creadPrec :: ReadPrec MavenReference
readList :: ReadS [MavenReference]
$creadList :: ReadS [MavenReference]
readsPrec :: Int -> ReadS MavenReference
$creadsPrec :: Int -> ReadS MavenReference
Prelude.Read, Int -> MavenReference -> ShowS
[MavenReference] -> ShowS
MavenReference -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MavenReference] -> ShowS
$cshowList :: [MavenReference] -> ShowS
show :: MavenReference -> String
$cshow :: MavenReference -> String
showsPrec :: Int -> MavenReference -> ShowS
$cshowsPrec :: Int -> MavenReference -> ShowS
Prelude.Show, forall x. Rep MavenReference x -> MavenReference
forall x. MavenReference -> Rep MavenReference x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MavenReference x -> MavenReference
$cfrom :: forall x. MavenReference -> Rep MavenReference x
Prelude.Generic)
newMavenReference ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
MavenReference
newMavenReference :: Text -> Text -> Text -> MavenReference
newMavenReference Text
pGroupId_ Text
pArtifactId_ Text
pVersion_ =
MavenReference'
{ $sel:groupId:MavenReference' :: Text
groupId = Text
pGroupId_,
$sel:artifactId:MavenReference' :: Text
artifactId = Text
pArtifactId_,
$sel:version:MavenReference' :: Text
version = Text
pVersion_
}
mavenReference_groupId :: Lens.Lens' MavenReference Prelude.Text
mavenReference_groupId :: Lens' MavenReference Text
mavenReference_groupId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MavenReference' {Text
groupId :: Text
$sel:groupId:MavenReference' :: MavenReference -> Text
groupId} -> Text
groupId) (\s :: MavenReference
s@MavenReference' {} Text
a -> MavenReference
s {$sel:groupId:MavenReference' :: Text
groupId = Text
a} :: MavenReference)
mavenReference_artifactId :: Lens.Lens' MavenReference Prelude.Text
mavenReference_artifactId :: Lens' MavenReference Text
mavenReference_artifactId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MavenReference' {Text
artifactId :: Text
$sel:artifactId:MavenReference' :: MavenReference -> Text
artifactId} -> Text
artifactId) (\s :: MavenReference
s@MavenReference' {} Text
a -> MavenReference
s {$sel:artifactId:MavenReference' :: Text
artifactId = Text
a} :: MavenReference)
mavenReference_version :: Lens.Lens' MavenReference Prelude.Text
mavenReference_version :: Lens' MavenReference Text
mavenReference_version = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MavenReference' {Text
version :: Text
$sel:version:MavenReference' :: MavenReference -> Text
version} -> Text
version) (\s :: MavenReference
s@MavenReference' {} Text
a -> MavenReference
s {$sel:version:MavenReference' :: Text
version = Text
a} :: MavenReference)
instance Data.FromJSON MavenReference where
parseJSON :: Value -> Parser MavenReference
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"MavenReference"
( \Object
x ->
Text -> Text -> Text -> MavenReference
MavenReference'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"GroupId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"ArtifactId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Version")
)
instance Prelude.Hashable MavenReference where
hashWithSalt :: Int -> MavenReference -> Int
hashWithSalt Int
_salt MavenReference' {Text
version :: Text
artifactId :: Text
groupId :: Text
$sel:version:MavenReference' :: MavenReference -> Text
$sel:artifactId:MavenReference' :: MavenReference -> Text
$sel:groupId:MavenReference' :: MavenReference -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
groupId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
artifactId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
version
instance Prelude.NFData MavenReference where
rnf :: MavenReference -> ()
rnf MavenReference' {Text
version :: Text
artifactId :: Text
groupId :: Text
$sel:version:MavenReference' :: MavenReference -> Text
$sel:artifactId:MavenReference' :: MavenReference -> Text
$sel:groupId:MavenReference' :: MavenReference -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
groupId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
artifactId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
version
instance Data.ToJSON MavenReference where
toJSON :: MavenReference -> Value
toJSON MavenReference' {Text
version :: Text
artifactId :: Text
groupId :: Text
$sel:version:MavenReference' :: MavenReference -> Text
$sel:artifactId:MavenReference' :: MavenReference -> Text
$sel:groupId:MavenReference' :: MavenReference -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"GroupId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
groupId),
forall a. a -> Maybe a
Prelude.Just (Key
"ArtifactId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
artifactId),
forall a. a -> Maybe a
Prelude.Just (Key
"Version" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
version)
]
)