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