{-# 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.ActionTypeSettings
-- 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.ActionTypeSettings where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Returns information about the settings for an action type.
--
-- /See:/ 'newActionTypeSettings' smart constructor.
data ActionTypeSettings = ActionTypeSettings'
  { -- | The URL of a sign-up page where users can sign up for an external
    -- service and perform initial configuration of the action provided by that
    -- service.
    ActionTypeSettings -> Maybe Text
thirdPartyConfigurationUrl :: Prelude.Maybe Prelude.Text,
    -- | The URL returned to the AWS CodePipeline console that contains a link to
    -- the top-level landing page for the external system, such as the console
    -- page for AWS CodeDeploy. This link is shown on the pipeline view page in
    -- the AWS CodePipeline console and provides a link to the execution entity
    -- of the external action.
    ActionTypeSettings -> Maybe Text
executionUrlTemplate :: Prelude.Maybe Prelude.Text,
    -- | The URL returned to the AWS CodePipeline console that contains a link to
    -- the page where customers can update or change the configuration of the
    -- external action.
    ActionTypeSettings -> Maybe Text
revisionUrlTemplate :: Prelude.Maybe Prelude.Text,
    -- | The URL returned to the AWS CodePipeline console that provides a deep
    -- link to the resources of the external system, such as the configuration
    -- page for an AWS CodeDeploy deployment group. This link is provided as
    -- part of the action display in the pipeline.
    ActionTypeSettings -> Maybe Text
entityUrlTemplate :: Prelude.Maybe Prelude.Text
  }
  deriving (ActionTypeSettings -> ActionTypeSettings -> Bool
(ActionTypeSettings -> ActionTypeSettings -> Bool)
-> (ActionTypeSettings -> ActionTypeSettings -> Bool)
-> Eq ActionTypeSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ActionTypeSettings -> ActionTypeSettings -> Bool
$c/= :: ActionTypeSettings -> ActionTypeSettings -> Bool
== :: ActionTypeSettings -> ActionTypeSettings -> Bool
$c== :: ActionTypeSettings -> ActionTypeSettings -> Bool
Prelude.Eq, ReadPrec [ActionTypeSettings]
ReadPrec ActionTypeSettings
Int -> ReadS ActionTypeSettings
ReadS [ActionTypeSettings]
(Int -> ReadS ActionTypeSettings)
-> ReadS [ActionTypeSettings]
-> ReadPrec ActionTypeSettings
-> ReadPrec [ActionTypeSettings]
-> Read ActionTypeSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ActionTypeSettings]
$creadListPrec :: ReadPrec [ActionTypeSettings]
readPrec :: ReadPrec ActionTypeSettings
$creadPrec :: ReadPrec ActionTypeSettings
readList :: ReadS [ActionTypeSettings]
$creadList :: ReadS [ActionTypeSettings]
readsPrec :: Int -> ReadS ActionTypeSettings
$creadsPrec :: Int -> ReadS ActionTypeSettings
Prelude.Read, Int -> ActionTypeSettings -> ShowS
[ActionTypeSettings] -> ShowS
ActionTypeSettings -> String
(Int -> ActionTypeSettings -> ShowS)
-> (ActionTypeSettings -> String)
-> ([ActionTypeSettings] -> ShowS)
-> Show ActionTypeSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ActionTypeSettings] -> ShowS
$cshowList :: [ActionTypeSettings] -> ShowS
show :: ActionTypeSettings -> String
$cshow :: ActionTypeSettings -> String
showsPrec :: Int -> ActionTypeSettings -> ShowS
$cshowsPrec :: Int -> ActionTypeSettings -> ShowS
Prelude.Show, (forall x. ActionTypeSettings -> Rep ActionTypeSettings x)
-> (forall x. Rep ActionTypeSettings x -> ActionTypeSettings)
-> Generic ActionTypeSettings
forall x. Rep ActionTypeSettings x -> ActionTypeSettings
forall x. ActionTypeSettings -> Rep ActionTypeSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ActionTypeSettings x -> ActionTypeSettings
$cfrom :: forall x. ActionTypeSettings -> Rep ActionTypeSettings x
Prelude.Generic)

-- |
-- Create a value of 'ActionTypeSettings' 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:
--
-- 'thirdPartyConfigurationUrl', 'actionTypeSettings_thirdPartyConfigurationUrl' - The URL of a sign-up page where users can sign up for an external
-- service and perform initial configuration of the action provided by that
-- service.
--
-- 'executionUrlTemplate', 'actionTypeSettings_executionUrlTemplate' - The URL returned to the AWS CodePipeline console that contains a link to
-- the top-level landing page for the external system, such as the console
-- page for AWS CodeDeploy. This link is shown on the pipeline view page in
-- the AWS CodePipeline console and provides a link to the execution entity
-- of the external action.
--
-- 'revisionUrlTemplate', 'actionTypeSettings_revisionUrlTemplate' - The URL returned to the AWS CodePipeline console that contains a link to
-- the page where customers can update or change the configuration of the
-- external action.
--
-- 'entityUrlTemplate', 'actionTypeSettings_entityUrlTemplate' - The URL returned to the AWS CodePipeline console that provides a deep
-- link to the resources of the external system, such as the configuration
-- page for an AWS CodeDeploy deployment group. This link is provided as
-- part of the action display in the pipeline.
newActionTypeSettings ::
  ActionTypeSettings
newActionTypeSettings :: ActionTypeSettings
newActionTypeSettings =
  ActionTypeSettings' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> ActionTypeSettings
ActionTypeSettings'
    { $sel:thirdPartyConfigurationUrl:ActionTypeSettings' :: Maybe Text
thirdPartyConfigurationUrl =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:executionUrlTemplate:ActionTypeSettings' :: Maybe Text
executionUrlTemplate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:revisionUrlTemplate:ActionTypeSettings' :: Maybe Text
revisionUrlTemplate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:entityUrlTemplate:ActionTypeSettings' :: Maybe Text
entityUrlTemplate = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The URL of a sign-up page where users can sign up for an external
-- service and perform initial configuration of the action provided by that
-- service.
actionTypeSettings_thirdPartyConfigurationUrl :: Lens.Lens' ActionTypeSettings (Prelude.Maybe Prelude.Text)
actionTypeSettings_thirdPartyConfigurationUrl :: (Maybe Text -> f (Maybe Text))
-> ActionTypeSettings -> f ActionTypeSettings
actionTypeSettings_thirdPartyConfigurationUrl = (ActionTypeSettings -> Maybe Text)
-> (ActionTypeSettings -> Maybe Text -> ActionTypeSettings)
-> Lens
     ActionTypeSettings ActionTypeSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionTypeSettings' {Maybe Text
thirdPartyConfigurationUrl :: Maybe Text
$sel:thirdPartyConfigurationUrl:ActionTypeSettings' :: ActionTypeSettings -> Maybe Text
thirdPartyConfigurationUrl} -> Maybe Text
thirdPartyConfigurationUrl) (\s :: ActionTypeSettings
s@ActionTypeSettings' {} Maybe Text
a -> ActionTypeSettings
s {$sel:thirdPartyConfigurationUrl:ActionTypeSettings' :: Maybe Text
thirdPartyConfigurationUrl = Maybe Text
a} :: ActionTypeSettings)

-- | The URL returned to the AWS CodePipeline console that contains a link to
-- the top-level landing page for the external system, such as the console
-- page for AWS CodeDeploy. This link is shown on the pipeline view page in
-- the AWS CodePipeline console and provides a link to the execution entity
-- of the external action.
actionTypeSettings_executionUrlTemplate :: Lens.Lens' ActionTypeSettings (Prelude.Maybe Prelude.Text)
actionTypeSettings_executionUrlTemplate :: (Maybe Text -> f (Maybe Text))
-> ActionTypeSettings -> f ActionTypeSettings
actionTypeSettings_executionUrlTemplate = (ActionTypeSettings -> Maybe Text)
-> (ActionTypeSettings -> Maybe Text -> ActionTypeSettings)
-> Lens
     ActionTypeSettings ActionTypeSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionTypeSettings' {Maybe Text
executionUrlTemplate :: Maybe Text
$sel:executionUrlTemplate:ActionTypeSettings' :: ActionTypeSettings -> Maybe Text
executionUrlTemplate} -> Maybe Text
executionUrlTemplate) (\s :: ActionTypeSettings
s@ActionTypeSettings' {} Maybe Text
a -> ActionTypeSettings
s {$sel:executionUrlTemplate:ActionTypeSettings' :: Maybe Text
executionUrlTemplate = Maybe Text
a} :: ActionTypeSettings)

-- | The URL returned to the AWS CodePipeline console that contains a link to
-- the page where customers can update or change the configuration of the
-- external action.
actionTypeSettings_revisionUrlTemplate :: Lens.Lens' ActionTypeSettings (Prelude.Maybe Prelude.Text)
actionTypeSettings_revisionUrlTemplate :: (Maybe Text -> f (Maybe Text))
-> ActionTypeSettings -> f ActionTypeSettings
actionTypeSettings_revisionUrlTemplate = (ActionTypeSettings -> Maybe Text)
-> (ActionTypeSettings -> Maybe Text -> ActionTypeSettings)
-> Lens
     ActionTypeSettings ActionTypeSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionTypeSettings' {Maybe Text
revisionUrlTemplate :: Maybe Text
$sel:revisionUrlTemplate:ActionTypeSettings' :: ActionTypeSettings -> Maybe Text
revisionUrlTemplate} -> Maybe Text
revisionUrlTemplate) (\s :: ActionTypeSettings
s@ActionTypeSettings' {} Maybe Text
a -> ActionTypeSettings
s {$sel:revisionUrlTemplate:ActionTypeSettings' :: Maybe Text
revisionUrlTemplate = Maybe Text
a} :: ActionTypeSettings)

-- | The URL returned to the AWS CodePipeline console that provides a deep
-- link to the resources of the external system, such as the configuration
-- page for an AWS CodeDeploy deployment group. This link is provided as
-- part of the action display in the pipeline.
actionTypeSettings_entityUrlTemplate :: Lens.Lens' ActionTypeSettings (Prelude.Maybe Prelude.Text)
actionTypeSettings_entityUrlTemplate :: (Maybe Text -> f (Maybe Text))
-> ActionTypeSettings -> f ActionTypeSettings
actionTypeSettings_entityUrlTemplate = (ActionTypeSettings -> Maybe Text)
-> (ActionTypeSettings -> Maybe Text -> ActionTypeSettings)
-> Lens
     ActionTypeSettings ActionTypeSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionTypeSettings' {Maybe Text
entityUrlTemplate :: Maybe Text
$sel:entityUrlTemplate:ActionTypeSettings' :: ActionTypeSettings -> Maybe Text
entityUrlTemplate} -> Maybe Text
entityUrlTemplate) (\s :: ActionTypeSettings
s@ActionTypeSettings' {} Maybe Text
a -> ActionTypeSettings
s {$sel:entityUrlTemplate:ActionTypeSettings' :: Maybe Text
entityUrlTemplate = Maybe Text
a} :: ActionTypeSettings)

instance Core.FromJSON ActionTypeSettings where
  parseJSON :: Value -> Parser ActionTypeSettings
parseJSON =
    String
-> (Object -> Parser ActionTypeSettings)
-> Value
-> Parser ActionTypeSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ActionTypeSettings"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> ActionTypeSettings
ActionTypeSettings'
            (Maybe Text
 -> Maybe Text -> Maybe Text -> Maybe Text -> ActionTypeSettings)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Text -> ActionTypeSettings)
forall (f :: * -> *) a b. Functor 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
"thirdPartyConfigurationUrl")
            Parser
  (Maybe Text -> Maybe Text -> Maybe Text -> ActionTypeSettings)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> ActionTypeSettings)
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
"executionUrlTemplate")
            Parser (Maybe Text -> Maybe Text -> ActionTypeSettings)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ActionTypeSettings)
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
"revisionUrlTemplate")
            Parser (Maybe Text -> ActionTypeSettings)
-> Parser (Maybe Text) -> Parser ActionTypeSettings
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
"entityUrlTemplate")
      )

instance Prelude.Hashable ActionTypeSettings

instance Prelude.NFData ActionTypeSettings

instance Core.ToJSON ActionTypeSettings where
  toJSON :: ActionTypeSettings -> Value
toJSON ActionTypeSettings' {Maybe Text
entityUrlTemplate :: Maybe Text
revisionUrlTemplate :: Maybe Text
executionUrlTemplate :: Maybe Text
thirdPartyConfigurationUrl :: Maybe Text
$sel:entityUrlTemplate:ActionTypeSettings' :: ActionTypeSettings -> Maybe Text
$sel:revisionUrlTemplate:ActionTypeSettings' :: ActionTypeSettings -> Maybe Text
$sel:executionUrlTemplate:ActionTypeSettings' :: ActionTypeSettings -> Maybe Text
$sel:thirdPartyConfigurationUrl:ActionTypeSettings' :: ActionTypeSettings -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"thirdPartyConfigurationUrl" 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
thirdPartyConfigurationUrl,
            (Text
"executionUrlTemplate" 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
executionUrlTemplate,
            (Text
"revisionUrlTemplate" 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
revisionUrlTemplate,
            (Text
"entityUrlTemplate" 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
entityUrlTemplate
          ]
      )