{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.CodePipeline.Types.ActionTypeSettings 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

-- | Returns information about the settings for an action type.
--
-- /See:/ 'newActionTypeSettings' smart constructor.
data ActionTypeSettings = 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 -> Maybe Text
entityUrlTemplate :: 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 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
  }
  deriving (ActionTypeSettings -> ActionTypeSettings -> Bool
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]
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
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. 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:
--
-- '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.
--
-- '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.
--
-- '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.
newActionTypeSettings ::
  ActionTypeSettings
newActionTypeSettings :: ActionTypeSettings
newActionTypeSettings =
  ActionTypeSettings'
    { $sel:entityUrlTemplate:ActionTypeSettings' :: Maybe Text
entityUrlTemplate =
        forall a. Maybe a
Prelude.Nothing,
      $sel:executionUrlTemplate:ActionTypeSettings' :: Maybe Text
executionUrlTemplate = forall a. Maybe a
Prelude.Nothing,
      $sel:revisionUrlTemplate:ActionTypeSettings' :: Maybe Text
revisionUrlTemplate = forall a. Maybe a
Prelude.Nothing,
      $sel:thirdPartyConfigurationUrl:ActionTypeSettings' :: Maybe Text
thirdPartyConfigurationUrl = forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: Lens' ActionTypeSettings (Maybe Text)
actionTypeSettings_entityUrlTemplate = 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)

-- | 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 :: Lens' ActionTypeSettings (Maybe Text)
actionTypeSettings_executionUrlTemplate = 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 :: Lens' ActionTypeSettings (Maybe Text)
actionTypeSettings_revisionUrlTemplate = 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 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 :: Lens' ActionTypeSettings (Maybe Text)
actionTypeSettings_thirdPartyConfigurationUrl = 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)

instance Data.FromJSON ActionTypeSettings where
  parseJSON :: Value -> Parser ActionTypeSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ActionTypeSettings"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> ActionTypeSettings
ActionTypeSettings'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"entityUrlTemplate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"executionUrlTemplate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"revisionUrlTemplate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"thirdPartyConfigurationUrl")
      )

instance Prelude.Hashable ActionTypeSettings where
  hashWithSalt :: Int -> ActionTypeSettings -> Int
hashWithSalt Int
_salt ActionTypeSettings' {Maybe Text
thirdPartyConfigurationUrl :: Maybe Text
revisionUrlTemplate :: Maybe Text
executionUrlTemplate :: Maybe Text
entityUrlTemplate :: Maybe Text
$sel:thirdPartyConfigurationUrl:ActionTypeSettings' :: ActionTypeSettings -> Maybe Text
$sel:revisionUrlTemplate:ActionTypeSettings' :: ActionTypeSettings -> Maybe Text
$sel:executionUrlTemplate:ActionTypeSettings' :: ActionTypeSettings -> Maybe Text
$sel:entityUrlTemplate:ActionTypeSettings' :: ActionTypeSettings -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
entityUrlTemplate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
executionUrlTemplate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
revisionUrlTemplate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
thirdPartyConfigurationUrl

instance Prelude.NFData ActionTypeSettings where
  rnf :: ActionTypeSettings -> ()
rnf ActionTypeSettings' {Maybe Text
thirdPartyConfigurationUrl :: Maybe Text
revisionUrlTemplate :: Maybe Text
executionUrlTemplate :: Maybe Text
entityUrlTemplate :: Maybe Text
$sel:thirdPartyConfigurationUrl:ActionTypeSettings' :: ActionTypeSettings -> Maybe Text
$sel:revisionUrlTemplate:ActionTypeSettings' :: ActionTypeSettings -> Maybe Text
$sel:executionUrlTemplate:ActionTypeSettings' :: ActionTypeSettings -> Maybe Text
$sel:entityUrlTemplate:ActionTypeSettings' :: ActionTypeSettings -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
entityUrlTemplate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
executionUrlTemplate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
revisionUrlTemplate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
thirdPartyConfigurationUrl

instance Data.ToJSON ActionTypeSettings where
  toJSON :: ActionTypeSettings -> Value
toJSON ActionTypeSettings' {Maybe Text
thirdPartyConfigurationUrl :: Maybe Text
revisionUrlTemplate :: Maybe Text
executionUrlTemplate :: Maybe Text
entityUrlTemplate :: Maybe Text
$sel:thirdPartyConfigurationUrl:ActionTypeSettings' :: ActionTypeSettings -> Maybe Text
$sel:revisionUrlTemplate:ActionTypeSettings' :: ActionTypeSettings -> Maybe Text
$sel:executionUrlTemplate:ActionTypeSettings' :: ActionTypeSettings -> Maybe Text
$sel:entityUrlTemplate:ActionTypeSettings' :: ActionTypeSettings -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"entityUrlTemplate" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
entityUrlTemplate,
            (Key
"executionUrlTemplate" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
executionUrlTemplate,
            (Key
"revisionUrlTemplate" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
revisionUrlTemplate,
            (Key
"thirdPartyConfigurationUrl" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
thirdPartyConfigurationUrl
          ]
      )