{-# 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.CodePipeline.Types.ActionTypeIdentifier where
import Amazonka.CodePipeline.Types.ActionCategory
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ActionTypeIdentifier = ActionTypeIdentifier'
{
ActionTypeIdentifier -> ActionCategory
category :: ActionCategory,
ActionTypeIdentifier -> Text
owner :: Prelude.Text,
ActionTypeIdentifier -> Text
provider :: Prelude.Text,
ActionTypeIdentifier -> Text
version :: Prelude.Text
}
deriving (ActionTypeIdentifier -> ActionTypeIdentifier -> Bool
(ActionTypeIdentifier -> ActionTypeIdentifier -> Bool)
-> (ActionTypeIdentifier -> ActionTypeIdentifier -> Bool)
-> Eq ActionTypeIdentifier
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ActionTypeIdentifier -> ActionTypeIdentifier -> Bool
$c/= :: ActionTypeIdentifier -> ActionTypeIdentifier -> Bool
== :: ActionTypeIdentifier -> ActionTypeIdentifier -> Bool
$c== :: ActionTypeIdentifier -> ActionTypeIdentifier -> Bool
Prelude.Eq, ReadPrec [ActionTypeIdentifier]
ReadPrec ActionTypeIdentifier
Int -> ReadS ActionTypeIdentifier
ReadS [ActionTypeIdentifier]
(Int -> ReadS ActionTypeIdentifier)
-> ReadS [ActionTypeIdentifier]
-> ReadPrec ActionTypeIdentifier
-> ReadPrec [ActionTypeIdentifier]
-> Read ActionTypeIdentifier
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ActionTypeIdentifier]
$creadListPrec :: ReadPrec [ActionTypeIdentifier]
readPrec :: ReadPrec ActionTypeIdentifier
$creadPrec :: ReadPrec ActionTypeIdentifier
readList :: ReadS [ActionTypeIdentifier]
$creadList :: ReadS [ActionTypeIdentifier]
readsPrec :: Int -> ReadS ActionTypeIdentifier
$creadsPrec :: Int -> ReadS ActionTypeIdentifier
Prelude.Read, Int -> ActionTypeIdentifier -> ShowS
[ActionTypeIdentifier] -> ShowS
ActionTypeIdentifier -> String
(Int -> ActionTypeIdentifier -> ShowS)
-> (ActionTypeIdentifier -> String)
-> ([ActionTypeIdentifier] -> ShowS)
-> Show ActionTypeIdentifier
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ActionTypeIdentifier] -> ShowS
$cshowList :: [ActionTypeIdentifier] -> ShowS
show :: ActionTypeIdentifier -> String
$cshow :: ActionTypeIdentifier -> String
showsPrec :: Int -> ActionTypeIdentifier -> ShowS
$cshowsPrec :: Int -> ActionTypeIdentifier -> ShowS
Prelude.Show, (forall x. ActionTypeIdentifier -> Rep ActionTypeIdentifier x)
-> (forall x. Rep ActionTypeIdentifier x -> ActionTypeIdentifier)
-> Generic ActionTypeIdentifier
forall x. Rep ActionTypeIdentifier x -> ActionTypeIdentifier
forall x. ActionTypeIdentifier -> Rep ActionTypeIdentifier x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ActionTypeIdentifier x -> ActionTypeIdentifier
$cfrom :: forall x. ActionTypeIdentifier -> Rep ActionTypeIdentifier x
Prelude.Generic)
newActionTypeIdentifier ::
ActionCategory ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
ActionTypeIdentifier
newActionTypeIdentifier :: ActionCategory -> Text -> Text -> Text -> ActionTypeIdentifier
newActionTypeIdentifier
ActionCategory
pCategory_
Text
pOwner_
Text
pProvider_
Text
pVersion_ =
ActionTypeIdentifier' :: ActionCategory -> Text -> Text -> Text -> ActionTypeIdentifier
ActionTypeIdentifier'
{ $sel:category:ActionTypeIdentifier' :: ActionCategory
category = ActionCategory
pCategory_,
$sel:owner:ActionTypeIdentifier' :: Text
owner = Text
pOwner_,
$sel:provider:ActionTypeIdentifier' :: Text
provider = Text
pProvider_,
$sel:version:ActionTypeIdentifier' :: Text
version = Text
pVersion_
}
actionTypeIdentifier_category :: Lens.Lens' ActionTypeIdentifier ActionCategory
actionTypeIdentifier_category :: (ActionCategory -> f ActionCategory)
-> ActionTypeIdentifier -> f ActionTypeIdentifier
actionTypeIdentifier_category = (ActionTypeIdentifier -> ActionCategory)
-> (ActionTypeIdentifier -> ActionCategory -> ActionTypeIdentifier)
-> Lens
ActionTypeIdentifier
ActionTypeIdentifier
ActionCategory
ActionCategory
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionTypeIdentifier' {ActionCategory
category :: ActionCategory
$sel:category:ActionTypeIdentifier' :: ActionTypeIdentifier -> ActionCategory
category} -> ActionCategory
category) (\s :: ActionTypeIdentifier
s@ActionTypeIdentifier' {} ActionCategory
a -> ActionTypeIdentifier
s {$sel:category:ActionTypeIdentifier' :: ActionCategory
category = ActionCategory
a} :: ActionTypeIdentifier)
actionTypeIdentifier_owner :: Lens.Lens' ActionTypeIdentifier Prelude.Text
actionTypeIdentifier_owner :: (Text -> f Text) -> ActionTypeIdentifier -> f ActionTypeIdentifier
actionTypeIdentifier_owner = (ActionTypeIdentifier -> Text)
-> (ActionTypeIdentifier -> Text -> ActionTypeIdentifier)
-> Lens ActionTypeIdentifier ActionTypeIdentifier Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionTypeIdentifier' {Text
owner :: Text
$sel:owner:ActionTypeIdentifier' :: ActionTypeIdentifier -> Text
owner} -> Text
owner) (\s :: ActionTypeIdentifier
s@ActionTypeIdentifier' {} Text
a -> ActionTypeIdentifier
s {$sel:owner:ActionTypeIdentifier' :: Text
owner = Text
a} :: ActionTypeIdentifier)
actionTypeIdentifier_provider :: Lens.Lens' ActionTypeIdentifier Prelude.Text
actionTypeIdentifier_provider :: (Text -> f Text) -> ActionTypeIdentifier -> f ActionTypeIdentifier
actionTypeIdentifier_provider = (ActionTypeIdentifier -> Text)
-> (ActionTypeIdentifier -> Text -> ActionTypeIdentifier)
-> Lens ActionTypeIdentifier ActionTypeIdentifier Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionTypeIdentifier' {Text
provider :: Text
$sel:provider:ActionTypeIdentifier' :: ActionTypeIdentifier -> Text
provider} -> Text
provider) (\s :: ActionTypeIdentifier
s@ActionTypeIdentifier' {} Text
a -> ActionTypeIdentifier
s {$sel:provider:ActionTypeIdentifier' :: Text
provider = Text
a} :: ActionTypeIdentifier)
actionTypeIdentifier_version :: Lens.Lens' ActionTypeIdentifier Prelude.Text
actionTypeIdentifier_version :: (Text -> f Text) -> ActionTypeIdentifier -> f ActionTypeIdentifier
actionTypeIdentifier_version = (ActionTypeIdentifier -> Text)
-> (ActionTypeIdentifier -> Text -> ActionTypeIdentifier)
-> Lens ActionTypeIdentifier ActionTypeIdentifier Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionTypeIdentifier' {Text
version :: Text
$sel:version:ActionTypeIdentifier' :: ActionTypeIdentifier -> Text
version} -> Text
version) (\s :: ActionTypeIdentifier
s@ActionTypeIdentifier' {} Text
a -> ActionTypeIdentifier
s {$sel:version:ActionTypeIdentifier' :: Text
version = Text
a} :: ActionTypeIdentifier)
instance Core.FromJSON ActionTypeIdentifier where
parseJSON :: Value -> Parser ActionTypeIdentifier
parseJSON =
String
-> (Object -> Parser ActionTypeIdentifier)
-> Value
-> Parser ActionTypeIdentifier
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ActionTypeIdentifier"
( \Object
x ->
ActionCategory -> Text -> Text -> Text -> ActionTypeIdentifier
ActionTypeIdentifier'
(ActionCategory -> Text -> Text -> Text -> ActionTypeIdentifier)
-> Parser ActionCategory
-> Parser (Text -> Text -> Text -> ActionTypeIdentifier)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser ActionCategory
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"category")
Parser (Text -> Text -> Text -> ActionTypeIdentifier)
-> Parser Text -> Parser (Text -> Text -> ActionTypeIdentifier)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"owner")
Parser (Text -> Text -> ActionTypeIdentifier)
-> Parser Text -> Parser (Text -> ActionTypeIdentifier)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"provider")
Parser (Text -> ActionTypeIdentifier)
-> Parser Text -> Parser ActionTypeIdentifier
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"version")
)
instance Prelude.Hashable ActionTypeIdentifier
instance Prelude.NFData ActionTypeIdentifier
instance Core.ToJSON ActionTypeIdentifier where
toJSON :: ActionTypeIdentifier -> Value
toJSON ActionTypeIdentifier' {Text
ActionCategory
version :: Text
provider :: Text
owner :: Text
category :: ActionCategory
$sel:version:ActionTypeIdentifier' :: ActionTypeIdentifier -> Text
$sel:provider:ActionTypeIdentifier' :: ActionTypeIdentifier -> Text
$sel:owner:ActionTypeIdentifier' :: ActionTypeIdentifier -> Text
$sel:category:ActionTypeIdentifier' :: ActionTypeIdentifier -> ActionCategory
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"category" Text -> ActionCategory -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ActionCategory
category),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"owner" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
owner),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"provider" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
provider),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"version" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
version)
]
)