{-# 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.Amplify.Types.Artifact 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 Artifact = Artifact'
{
Artifact -> Text
artifactFileName :: Prelude.Text,
Artifact -> Text
artifactId :: Prelude.Text
}
deriving (Artifact -> Artifact -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Artifact -> Artifact -> Bool
$c/= :: Artifact -> Artifact -> Bool
== :: Artifact -> Artifact -> Bool
$c== :: Artifact -> Artifact -> Bool
Prelude.Eq, ReadPrec [Artifact]
ReadPrec Artifact
Int -> ReadS Artifact
ReadS [Artifact]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Artifact]
$creadListPrec :: ReadPrec [Artifact]
readPrec :: ReadPrec Artifact
$creadPrec :: ReadPrec Artifact
readList :: ReadS [Artifact]
$creadList :: ReadS [Artifact]
readsPrec :: Int -> ReadS Artifact
$creadsPrec :: Int -> ReadS Artifact
Prelude.Read, Int -> Artifact -> ShowS
[Artifact] -> ShowS
Artifact -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Artifact] -> ShowS
$cshowList :: [Artifact] -> ShowS
show :: Artifact -> String
$cshow :: Artifact -> String
showsPrec :: Int -> Artifact -> ShowS
$cshowsPrec :: Int -> Artifact -> ShowS
Prelude.Show, forall x. Rep Artifact x -> Artifact
forall x. Artifact -> Rep Artifact x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Artifact x -> Artifact
$cfrom :: forall x. Artifact -> Rep Artifact x
Prelude.Generic)
newArtifact ::
Prelude.Text ->
Prelude.Text ->
Artifact
newArtifact :: Text -> Text -> Artifact
newArtifact Text
pArtifactFileName_ Text
pArtifactId_ =
Artifact'
{ $sel:artifactFileName:Artifact' :: Text
artifactFileName = Text
pArtifactFileName_,
$sel:artifactId:Artifact' :: Text
artifactId = Text
pArtifactId_
}
artifact_artifactFileName :: Lens.Lens' Artifact Prelude.Text
artifact_artifactFileName :: Lens' Artifact Text
artifact_artifactFileName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Artifact' {Text
artifactFileName :: Text
$sel:artifactFileName:Artifact' :: Artifact -> Text
artifactFileName} -> Text
artifactFileName) (\s :: Artifact
s@Artifact' {} Text
a -> Artifact
s {$sel:artifactFileName:Artifact' :: Text
artifactFileName = Text
a} :: Artifact)
artifact_artifactId :: Lens.Lens' Artifact Prelude.Text
artifact_artifactId :: Lens' Artifact Text
artifact_artifactId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Artifact' {Text
artifactId :: Text
$sel:artifactId:Artifact' :: Artifact -> Text
artifactId} -> Text
artifactId) (\s :: Artifact
s@Artifact' {} Text
a -> Artifact
s {$sel:artifactId:Artifact' :: Text
artifactId = Text
a} :: Artifact)
instance Data.FromJSON Artifact where
parseJSON :: Value -> Parser Artifact
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Artifact"
( \Object
x ->
Text -> Text -> Artifact
Artifact'
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
"artifactFileName")
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")
)
instance Prelude.Hashable Artifact where
hashWithSalt :: Int -> Artifact -> Int
hashWithSalt Int
_salt Artifact' {Text
artifactId :: Text
artifactFileName :: Text
$sel:artifactId:Artifact' :: Artifact -> Text
$sel:artifactFileName:Artifact' :: Artifact -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
artifactFileName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
artifactId
instance Prelude.NFData Artifact where
rnf :: Artifact -> ()
rnf Artifact' {Text
artifactId :: Text
artifactFileName :: Text
$sel:artifactId:Artifact' :: Artifact -> Text
$sel:artifactFileName:Artifact' :: Artifact -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
artifactFileName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
artifactId