{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.CodePipeline.Types.ActionTypeDeclaration
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.CodePipeline.Types.ActionTypeDeclaration where

import Amazonka.CodePipeline.Types.ActionTypeArtifactDetails
import Amazonka.CodePipeline.Types.ActionTypeExecutor
import Amazonka.CodePipeline.Types.ActionTypeIdentifier
import Amazonka.CodePipeline.Types.ActionTypePermissions
import Amazonka.CodePipeline.Types.ActionTypeProperty
import Amazonka.CodePipeline.Types.ActionTypeUrls
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The parameters for the action type definition that are provided when the
-- action type is created or updated.
--
-- /See:/ 'newActionTypeDeclaration' smart constructor.
data ActionTypeDeclaration = ActionTypeDeclaration'
  { -- | The links associated with the action type to be updated.
    ActionTypeDeclaration -> Maybe ActionTypeUrls
urls :: Prelude.Maybe ActionTypeUrls,
    -- | Details identifying the accounts with permissions to use the action
    -- type.
    ActionTypeDeclaration -> Maybe ActionTypePermissions
permissions :: Prelude.Maybe ActionTypePermissions,
    -- | The description for the action type to be updated.
    ActionTypeDeclaration -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The properties of the action type to be updated.
    ActionTypeDeclaration -> Maybe [ActionTypeProperty]
properties :: Prelude.Maybe [ActionTypeProperty],
    -- | Information about the executor for an action type that was created with
    -- any supported integration model.
    ActionTypeDeclaration -> ActionTypeExecutor
executor :: ActionTypeExecutor,
    -- | The action category, owner, provider, and version of the action type to
    -- be updated.
    ActionTypeDeclaration -> ActionTypeIdentifier
id :: ActionTypeIdentifier,
    -- | Details for the artifacts, such as application files, to be worked on by
    -- the action. For example, the minimum and maximum number of input
    -- artifacts allowed.
    ActionTypeDeclaration -> ActionTypeArtifactDetails
inputArtifactDetails :: ActionTypeArtifactDetails,
    -- | Details for the output artifacts, such as a built application, that are
    -- the result of the action. For example, the minimum and maximum number of
    -- output artifacts allowed.
    ActionTypeDeclaration -> ActionTypeArtifactDetails
outputArtifactDetails :: ActionTypeArtifactDetails
  }
  deriving (ActionTypeDeclaration -> ActionTypeDeclaration -> Bool
(ActionTypeDeclaration -> ActionTypeDeclaration -> Bool)
-> (ActionTypeDeclaration -> ActionTypeDeclaration -> Bool)
-> Eq ActionTypeDeclaration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ActionTypeDeclaration -> ActionTypeDeclaration -> Bool
$c/= :: ActionTypeDeclaration -> ActionTypeDeclaration -> Bool
== :: ActionTypeDeclaration -> ActionTypeDeclaration -> Bool
$c== :: ActionTypeDeclaration -> ActionTypeDeclaration -> Bool
Prelude.Eq, ReadPrec [ActionTypeDeclaration]
ReadPrec ActionTypeDeclaration
Int -> ReadS ActionTypeDeclaration
ReadS [ActionTypeDeclaration]
(Int -> ReadS ActionTypeDeclaration)
-> ReadS [ActionTypeDeclaration]
-> ReadPrec ActionTypeDeclaration
-> ReadPrec [ActionTypeDeclaration]
-> Read ActionTypeDeclaration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ActionTypeDeclaration]
$creadListPrec :: ReadPrec [ActionTypeDeclaration]
readPrec :: ReadPrec ActionTypeDeclaration
$creadPrec :: ReadPrec ActionTypeDeclaration
readList :: ReadS [ActionTypeDeclaration]
$creadList :: ReadS [ActionTypeDeclaration]
readsPrec :: Int -> ReadS ActionTypeDeclaration
$creadsPrec :: Int -> ReadS ActionTypeDeclaration
Prelude.Read, Int -> ActionTypeDeclaration -> ShowS
[ActionTypeDeclaration] -> ShowS
ActionTypeDeclaration -> String
(Int -> ActionTypeDeclaration -> ShowS)
-> (ActionTypeDeclaration -> String)
-> ([ActionTypeDeclaration] -> ShowS)
-> Show ActionTypeDeclaration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ActionTypeDeclaration] -> ShowS
$cshowList :: [ActionTypeDeclaration] -> ShowS
show :: ActionTypeDeclaration -> String
$cshow :: ActionTypeDeclaration -> String
showsPrec :: Int -> ActionTypeDeclaration -> ShowS
$cshowsPrec :: Int -> ActionTypeDeclaration -> ShowS
Prelude.Show, (forall x. ActionTypeDeclaration -> Rep ActionTypeDeclaration x)
-> (forall x. Rep ActionTypeDeclaration x -> ActionTypeDeclaration)
-> Generic ActionTypeDeclaration
forall x. Rep ActionTypeDeclaration x -> ActionTypeDeclaration
forall x. ActionTypeDeclaration -> Rep ActionTypeDeclaration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ActionTypeDeclaration x -> ActionTypeDeclaration
$cfrom :: forall x. ActionTypeDeclaration -> Rep ActionTypeDeclaration x
Prelude.Generic)

-- |
-- Create a value of 'ActionTypeDeclaration' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'urls', 'actionTypeDeclaration_urls' - The links associated with the action type to be updated.
--
-- 'permissions', 'actionTypeDeclaration_permissions' - Details identifying the accounts with permissions to use the action
-- type.
--
-- 'description', 'actionTypeDeclaration_description' - The description for the action type to be updated.
--
-- 'properties', 'actionTypeDeclaration_properties' - The properties of the action type to be updated.
--
-- 'executor', 'actionTypeDeclaration_executor' - Information about the executor for an action type that was created with
-- any supported integration model.
--
-- 'id', 'actionTypeDeclaration_id' - The action category, owner, provider, and version of the action type to
-- be updated.
--
-- 'inputArtifactDetails', 'actionTypeDeclaration_inputArtifactDetails' - Details for the artifacts, such as application files, to be worked on by
-- the action. For example, the minimum and maximum number of input
-- artifacts allowed.
--
-- 'outputArtifactDetails', 'actionTypeDeclaration_outputArtifactDetails' - Details for the output artifacts, such as a built application, that are
-- the result of the action. For example, the minimum and maximum number of
-- output artifacts allowed.
newActionTypeDeclaration ::
  -- | 'executor'
  ActionTypeExecutor ->
  -- | 'id'
  ActionTypeIdentifier ->
  -- | 'inputArtifactDetails'
  ActionTypeArtifactDetails ->
  -- | 'outputArtifactDetails'
  ActionTypeArtifactDetails ->
  ActionTypeDeclaration
newActionTypeDeclaration :: ActionTypeExecutor
-> ActionTypeIdentifier
-> ActionTypeArtifactDetails
-> ActionTypeArtifactDetails
-> ActionTypeDeclaration
newActionTypeDeclaration
  ActionTypeExecutor
pExecutor_
  ActionTypeIdentifier
pId_
  ActionTypeArtifactDetails
pInputArtifactDetails_
  ActionTypeArtifactDetails
pOutputArtifactDetails_ =
    ActionTypeDeclaration' :: Maybe ActionTypeUrls
-> Maybe ActionTypePermissions
-> Maybe Text
-> Maybe [ActionTypeProperty]
-> ActionTypeExecutor
-> ActionTypeIdentifier
-> ActionTypeArtifactDetails
-> ActionTypeArtifactDetails
-> ActionTypeDeclaration
ActionTypeDeclaration'
      { $sel:urls:ActionTypeDeclaration' :: Maybe ActionTypeUrls
urls = Maybe ActionTypeUrls
forall a. Maybe a
Prelude.Nothing,
        $sel:permissions:ActionTypeDeclaration' :: Maybe ActionTypePermissions
permissions = Maybe ActionTypePermissions
forall a. Maybe a
Prelude.Nothing,
        $sel:description:ActionTypeDeclaration' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:properties:ActionTypeDeclaration' :: Maybe [ActionTypeProperty]
properties = Maybe [ActionTypeProperty]
forall a. Maybe a
Prelude.Nothing,
        $sel:executor:ActionTypeDeclaration' :: ActionTypeExecutor
executor = ActionTypeExecutor
pExecutor_,
        $sel:id:ActionTypeDeclaration' :: ActionTypeIdentifier
id = ActionTypeIdentifier
pId_,
        $sel:inputArtifactDetails:ActionTypeDeclaration' :: ActionTypeArtifactDetails
inputArtifactDetails = ActionTypeArtifactDetails
pInputArtifactDetails_,
        $sel:outputArtifactDetails:ActionTypeDeclaration' :: ActionTypeArtifactDetails
outputArtifactDetails = ActionTypeArtifactDetails
pOutputArtifactDetails_
      }

-- | The links associated with the action type to be updated.
actionTypeDeclaration_urls :: Lens.Lens' ActionTypeDeclaration (Prelude.Maybe ActionTypeUrls)
actionTypeDeclaration_urls :: (Maybe ActionTypeUrls -> f (Maybe ActionTypeUrls))
-> ActionTypeDeclaration -> f ActionTypeDeclaration
actionTypeDeclaration_urls = (ActionTypeDeclaration -> Maybe ActionTypeUrls)
-> (ActionTypeDeclaration
    -> Maybe ActionTypeUrls -> ActionTypeDeclaration)
-> Lens
     ActionTypeDeclaration
     ActionTypeDeclaration
     (Maybe ActionTypeUrls)
     (Maybe ActionTypeUrls)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionTypeDeclaration' {Maybe ActionTypeUrls
urls :: Maybe ActionTypeUrls
$sel:urls:ActionTypeDeclaration' :: ActionTypeDeclaration -> Maybe ActionTypeUrls
urls} -> Maybe ActionTypeUrls
urls) (\s :: ActionTypeDeclaration
s@ActionTypeDeclaration' {} Maybe ActionTypeUrls
a -> ActionTypeDeclaration
s {$sel:urls:ActionTypeDeclaration' :: Maybe ActionTypeUrls
urls = Maybe ActionTypeUrls
a} :: ActionTypeDeclaration)

-- | Details identifying the accounts with permissions to use the action
-- type.
actionTypeDeclaration_permissions :: Lens.Lens' ActionTypeDeclaration (Prelude.Maybe ActionTypePermissions)
actionTypeDeclaration_permissions :: (Maybe ActionTypePermissions -> f (Maybe ActionTypePermissions))
-> ActionTypeDeclaration -> f ActionTypeDeclaration
actionTypeDeclaration_permissions = (ActionTypeDeclaration -> Maybe ActionTypePermissions)
-> (ActionTypeDeclaration
    -> Maybe ActionTypePermissions -> ActionTypeDeclaration)
-> Lens
     ActionTypeDeclaration
     ActionTypeDeclaration
     (Maybe ActionTypePermissions)
     (Maybe ActionTypePermissions)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionTypeDeclaration' {Maybe ActionTypePermissions
permissions :: Maybe ActionTypePermissions
$sel:permissions:ActionTypeDeclaration' :: ActionTypeDeclaration -> Maybe ActionTypePermissions
permissions} -> Maybe ActionTypePermissions
permissions) (\s :: ActionTypeDeclaration
s@ActionTypeDeclaration' {} Maybe ActionTypePermissions
a -> ActionTypeDeclaration
s {$sel:permissions:ActionTypeDeclaration' :: Maybe ActionTypePermissions
permissions = Maybe ActionTypePermissions
a} :: ActionTypeDeclaration)

-- | The description for the action type to be updated.
actionTypeDeclaration_description :: Lens.Lens' ActionTypeDeclaration (Prelude.Maybe Prelude.Text)
actionTypeDeclaration_description :: (Maybe Text -> f (Maybe Text))
-> ActionTypeDeclaration -> f ActionTypeDeclaration
actionTypeDeclaration_description = (ActionTypeDeclaration -> Maybe Text)
-> (ActionTypeDeclaration -> Maybe Text -> ActionTypeDeclaration)
-> Lens
     ActionTypeDeclaration
     ActionTypeDeclaration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionTypeDeclaration' {Maybe Text
description :: Maybe Text
$sel:description:ActionTypeDeclaration' :: ActionTypeDeclaration -> Maybe Text
description} -> Maybe Text
description) (\s :: ActionTypeDeclaration
s@ActionTypeDeclaration' {} Maybe Text
a -> ActionTypeDeclaration
s {$sel:description:ActionTypeDeclaration' :: Maybe Text
description = Maybe Text
a} :: ActionTypeDeclaration)

-- | The properties of the action type to be updated.
actionTypeDeclaration_properties :: Lens.Lens' ActionTypeDeclaration (Prelude.Maybe [ActionTypeProperty])
actionTypeDeclaration_properties :: (Maybe [ActionTypeProperty] -> f (Maybe [ActionTypeProperty]))
-> ActionTypeDeclaration -> f ActionTypeDeclaration
actionTypeDeclaration_properties = (ActionTypeDeclaration -> Maybe [ActionTypeProperty])
-> (ActionTypeDeclaration
    -> Maybe [ActionTypeProperty] -> ActionTypeDeclaration)
-> Lens
     ActionTypeDeclaration
     ActionTypeDeclaration
     (Maybe [ActionTypeProperty])
     (Maybe [ActionTypeProperty])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionTypeDeclaration' {Maybe [ActionTypeProperty]
properties :: Maybe [ActionTypeProperty]
$sel:properties:ActionTypeDeclaration' :: ActionTypeDeclaration -> Maybe [ActionTypeProperty]
properties} -> Maybe [ActionTypeProperty]
properties) (\s :: ActionTypeDeclaration
s@ActionTypeDeclaration' {} Maybe [ActionTypeProperty]
a -> ActionTypeDeclaration
s {$sel:properties:ActionTypeDeclaration' :: Maybe [ActionTypeProperty]
properties = Maybe [ActionTypeProperty]
a} :: ActionTypeDeclaration) ((Maybe [ActionTypeProperty] -> f (Maybe [ActionTypeProperty]))
 -> ActionTypeDeclaration -> f ActionTypeDeclaration)
-> ((Maybe [ActionTypeProperty] -> f (Maybe [ActionTypeProperty]))
    -> Maybe [ActionTypeProperty] -> f (Maybe [ActionTypeProperty]))
-> (Maybe [ActionTypeProperty] -> f (Maybe [ActionTypeProperty]))
-> ActionTypeDeclaration
-> f ActionTypeDeclaration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ActionTypeProperty]
  [ActionTypeProperty]
  [ActionTypeProperty]
  [ActionTypeProperty]
-> Iso
     (Maybe [ActionTypeProperty])
     (Maybe [ActionTypeProperty])
     (Maybe [ActionTypeProperty])
     (Maybe [ActionTypeProperty])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [ActionTypeProperty]
  [ActionTypeProperty]
  [ActionTypeProperty]
  [ActionTypeProperty]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Information about the executor for an action type that was created with
-- any supported integration model.
actionTypeDeclaration_executor :: Lens.Lens' ActionTypeDeclaration ActionTypeExecutor
actionTypeDeclaration_executor :: (ActionTypeExecutor -> f ActionTypeExecutor)
-> ActionTypeDeclaration -> f ActionTypeDeclaration
actionTypeDeclaration_executor = (ActionTypeDeclaration -> ActionTypeExecutor)
-> (ActionTypeDeclaration
    -> ActionTypeExecutor -> ActionTypeDeclaration)
-> Lens
     ActionTypeDeclaration
     ActionTypeDeclaration
     ActionTypeExecutor
     ActionTypeExecutor
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionTypeDeclaration' {ActionTypeExecutor
executor :: ActionTypeExecutor
$sel:executor:ActionTypeDeclaration' :: ActionTypeDeclaration -> ActionTypeExecutor
executor} -> ActionTypeExecutor
executor) (\s :: ActionTypeDeclaration
s@ActionTypeDeclaration' {} ActionTypeExecutor
a -> ActionTypeDeclaration
s {$sel:executor:ActionTypeDeclaration' :: ActionTypeExecutor
executor = ActionTypeExecutor
a} :: ActionTypeDeclaration)

-- | The action category, owner, provider, and version of the action type to
-- be updated.
actionTypeDeclaration_id :: Lens.Lens' ActionTypeDeclaration ActionTypeIdentifier
actionTypeDeclaration_id :: (ActionTypeIdentifier -> f ActionTypeIdentifier)
-> ActionTypeDeclaration -> f ActionTypeDeclaration
actionTypeDeclaration_id = (ActionTypeDeclaration -> ActionTypeIdentifier)
-> (ActionTypeDeclaration
    -> ActionTypeIdentifier -> ActionTypeDeclaration)
-> Lens
     ActionTypeDeclaration
     ActionTypeDeclaration
     ActionTypeIdentifier
     ActionTypeIdentifier
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionTypeDeclaration' {ActionTypeIdentifier
id :: ActionTypeIdentifier
$sel:id:ActionTypeDeclaration' :: ActionTypeDeclaration -> ActionTypeIdentifier
id} -> ActionTypeIdentifier
id) (\s :: ActionTypeDeclaration
s@ActionTypeDeclaration' {} ActionTypeIdentifier
a -> ActionTypeDeclaration
s {$sel:id:ActionTypeDeclaration' :: ActionTypeIdentifier
id = ActionTypeIdentifier
a} :: ActionTypeDeclaration)

-- | Details for the artifacts, such as application files, to be worked on by
-- the action. For example, the minimum and maximum number of input
-- artifacts allowed.
actionTypeDeclaration_inputArtifactDetails :: Lens.Lens' ActionTypeDeclaration ActionTypeArtifactDetails
actionTypeDeclaration_inputArtifactDetails :: (ActionTypeArtifactDetails -> f ActionTypeArtifactDetails)
-> ActionTypeDeclaration -> f ActionTypeDeclaration
actionTypeDeclaration_inputArtifactDetails = (ActionTypeDeclaration -> ActionTypeArtifactDetails)
-> (ActionTypeDeclaration
    -> ActionTypeArtifactDetails -> ActionTypeDeclaration)
-> Lens
     ActionTypeDeclaration
     ActionTypeDeclaration
     ActionTypeArtifactDetails
     ActionTypeArtifactDetails
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionTypeDeclaration' {ActionTypeArtifactDetails
inputArtifactDetails :: ActionTypeArtifactDetails
$sel:inputArtifactDetails:ActionTypeDeclaration' :: ActionTypeDeclaration -> ActionTypeArtifactDetails
inputArtifactDetails} -> ActionTypeArtifactDetails
inputArtifactDetails) (\s :: ActionTypeDeclaration
s@ActionTypeDeclaration' {} ActionTypeArtifactDetails
a -> ActionTypeDeclaration
s {$sel:inputArtifactDetails:ActionTypeDeclaration' :: ActionTypeArtifactDetails
inputArtifactDetails = ActionTypeArtifactDetails
a} :: ActionTypeDeclaration)

-- | Details for the output artifacts, such as a built application, that are
-- the result of the action. For example, the minimum and maximum number of
-- output artifacts allowed.
actionTypeDeclaration_outputArtifactDetails :: Lens.Lens' ActionTypeDeclaration ActionTypeArtifactDetails
actionTypeDeclaration_outputArtifactDetails :: (ActionTypeArtifactDetails -> f ActionTypeArtifactDetails)
-> ActionTypeDeclaration -> f ActionTypeDeclaration
actionTypeDeclaration_outputArtifactDetails = (ActionTypeDeclaration -> ActionTypeArtifactDetails)
-> (ActionTypeDeclaration
    -> ActionTypeArtifactDetails -> ActionTypeDeclaration)
-> Lens
     ActionTypeDeclaration
     ActionTypeDeclaration
     ActionTypeArtifactDetails
     ActionTypeArtifactDetails
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionTypeDeclaration' {ActionTypeArtifactDetails
outputArtifactDetails :: ActionTypeArtifactDetails
$sel:outputArtifactDetails:ActionTypeDeclaration' :: ActionTypeDeclaration -> ActionTypeArtifactDetails
outputArtifactDetails} -> ActionTypeArtifactDetails
outputArtifactDetails) (\s :: ActionTypeDeclaration
s@ActionTypeDeclaration' {} ActionTypeArtifactDetails
a -> ActionTypeDeclaration
s {$sel:outputArtifactDetails:ActionTypeDeclaration' :: ActionTypeArtifactDetails
outputArtifactDetails = ActionTypeArtifactDetails
a} :: ActionTypeDeclaration)

instance Core.FromJSON ActionTypeDeclaration where
  parseJSON :: Value -> Parser ActionTypeDeclaration
parseJSON =
    String
-> (Object -> Parser ActionTypeDeclaration)
-> Value
-> Parser ActionTypeDeclaration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ActionTypeDeclaration"
      ( \Object
x ->
          Maybe ActionTypeUrls
-> Maybe ActionTypePermissions
-> Maybe Text
-> Maybe [ActionTypeProperty]
-> ActionTypeExecutor
-> ActionTypeIdentifier
-> ActionTypeArtifactDetails
-> ActionTypeArtifactDetails
-> ActionTypeDeclaration
ActionTypeDeclaration'
            (Maybe ActionTypeUrls
 -> Maybe ActionTypePermissions
 -> Maybe Text
 -> Maybe [ActionTypeProperty]
 -> ActionTypeExecutor
 -> ActionTypeIdentifier
 -> ActionTypeArtifactDetails
 -> ActionTypeArtifactDetails
 -> ActionTypeDeclaration)
-> Parser (Maybe ActionTypeUrls)
-> Parser
     (Maybe ActionTypePermissions
      -> Maybe Text
      -> Maybe [ActionTypeProperty]
      -> ActionTypeExecutor
      -> ActionTypeIdentifier
      -> ActionTypeArtifactDetails
      -> ActionTypeArtifactDetails
      -> ActionTypeDeclaration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ActionTypeUrls)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"urls")
            Parser
  (Maybe ActionTypePermissions
   -> Maybe Text
   -> Maybe [ActionTypeProperty]
   -> ActionTypeExecutor
   -> ActionTypeIdentifier
   -> ActionTypeArtifactDetails
   -> ActionTypeArtifactDetails
   -> ActionTypeDeclaration)
-> Parser (Maybe ActionTypePermissions)
-> Parser
     (Maybe Text
      -> Maybe [ActionTypeProperty]
      -> ActionTypeExecutor
      -> ActionTypeIdentifier
      -> ActionTypeArtifactDetails
      -> ActionTypeArtifactDetails
      -> ActionTypeDeclaration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ActionTypePermissions)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"permissions")
            Parser
  (Maybe Text
   -> Maybe [ActionTypeProperty]
   -> ActionTypeExecutor
   -> ActionTypeIdentifier
   -> ActionTypeArtifactDetails
   -> ActionTypeArtifactDetails
   -> ActionTypeDeclaration)
-> Parser (Maybe Text)
-> Parser
     (Maybe [ActionTypeProperty]
      -> ActionTypeExecutor
      -> ActionTypeIdentifier
      -> ActionTypeArtifactDetails
      -> ActionTypeArtifactDetails
      -> ActionTypeDeclaration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"description")
            Parser
  (Maybe [ActionTypeProperty]
   -> ActionTypeExecutor
   -> ActionTypeIdentifier
   -> ActionTypeArtifactDetails
   -> ActionTypeArtifactDetails
   -> ActionTypeDeclaration)
-> Parser (Maybe [ActionTypeProperty])
-> Parser
     (ActionTypeExecutor
      -> ActionTypeIdentifier
      -> ActionTypeArtifactDetails
      -> ActionTypeArtifactDetails
      -> ActionTypeDeclaration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [ActionTypeProperty]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"properties" Parser (Maybe (Maybe [ActionTypeProperty]))
-> Maybe [ActionTypeProperty]
-> Parser (Maybe [ActionTypeProperty])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ActionTypeProperty]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (ActionTypeExecutor
   -> ActionTypeIdentifier
   -> ActionTypeArtifactDetails
   -> ActionTypeArtifactDetails
   -> ActionTypeDeclaration)
-> Parser ActionTypeExecutor
-> Parser
     (ActionTypeIdentifier
      -> ActionTypeArtifactDetails
      -> ActionTypeArtifactDetails
      -> ActionTypeDeclaration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ActionTypeExecutor
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"executor")
            Parser
  (ActionTypeIdentifier
   -> ActionTypeArtifactDetails
   -> ActionTypeArtifactDetails
   -> ActionTypeDeclaration)
-> Parser ActionTypeIdentifier
-> Parser
     (ActionTypeArtifactDetails
      -> ActionTypeArtifactDetails -> ActionTypeDeclaration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ActionTypeIdentifier
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"id")
            Parser
  (ActionTypeArtifactDetails
   -> ActionTypeArtifactDetails -> ActionTypeDeclaration)
-> Parser ActionTypeArtifactDetails
-> Parser (ActionTypeArtifactDetails -> ActionTypeDeclaration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ActionTypeArtifactDetails
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"inputArtifactDetails")
            Parser (ActionTypeArtifactDetails -> ActionTypeDeclaration)
-> Parser ActionTypeArtifactDetails -> Parser ActionTypeDeclaration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ActionTypeArtifactDetails
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"outputArtifactDetails")
      )

instance Prelude.Hashable ActionTypeDeclaration

instance Prelude.NFData ActionTypeDeclaration

instance Core.ToJSON ActionTypeDeclaration where
  toJSON :: ActionTypeDeclaration -> Value
toJSON ActionTypeDeclaration' {Maybe [ActionTypeProperty]
Maybe Text
Maybe ActionTypePermissions
Maybe ActionTypeUrls
ActionTypeArtifactDetails
ActionTypeIdentifier
ActionTypeExecutor
outputArtifactDetails :: ActionTypeArtifactDetails
inputArtifactDetails :: ActionTypeArtifactDetails
id :: ActionTypeIdentifier
executor :: ActionTypeExecutor
properties :: Maybe [ActionTypeProperty]
description :: Maybe Text
permissions :: Maybe ActionTypePermissions
urls :: Maybe ActionTypeUrls
$sel:outputArtifactDetails:ActionTypeDeclaration' :: ActionTypeDeclaration -> ActionTypeArtifactDetails
$sel:inputArtifactDetails:ActionTypeDeclaration' :: ActionTypeDeclaration -> ActionTypeArtifactDetails
$sel:id:ActionTypeDeclaration' :: ActionTypeDeclaration -> ActionTypeIdentifier
$sel:executor:ActionTypeDeclaration' :: ActionTypeDeclaration -> ActionTypeExecutor
$sel:properties:ActionTypeDeclaration' :: ActionTypeDeclaration -> Maybe [ActionTypeProperty]
$sel:description:ActionTypeDeclaration' :: ActionTypeDeclaration -> Maybe Text
$sel:permissions:ActionTypeDeclaration' :: ActionTypeDeclaration -> Maybe ActionTypePermissions
$sel:urls:ActionTypeDeclaration' :: ActionTypeDeclaration -> Maybe ActionTypeUrls
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"urls" Text -> ActionTypeUrls -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ActionTypeUrls -> Pair) -> Maybe ActionTypeUrls -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ActionTypeUrls
urls,
            (Text
"permissions" Text -> ActionTypePermissions -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ActionTypePermissions -> Pair)
-> Maybe ActionTypePermissions -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ActionTypePermissions
permissions,
            (Text
"description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Text
"properties" Text -> [ActionTypeProperty] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([ActionTypeProperty] -> Pair)
-> Maybe [ActionTypeProperty] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [ActionTypeProperty]
properties,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"executor" Text -> ActionTypeExecutor -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ActionTypeExecutor
executor),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"id" Text -> ActionTypeIdentifier -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ActionTypeIdentifier
id),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"inputArtifactDetails"
                  Text -> ActionTypeArtifactDetails -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ActionTypeArtifactDetails
inputArtifactDetails
              ),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"outputArtifactDetails"
                  Text -> ActionTypeArtifactDetails -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ActionTypeArtifactDetails
outputArtifactDetails
              )
          ]
      )