{-# 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.ActionTypeUrls
-- 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.ActionTypeUrls 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 URLs for web pages that display to customers
-- as links on the pipeline view, such as an external configuration page
-- for the action type.
--
-- /See:/ 'newActionTypeUrls' smart constructor.
data ActionTypeUrls = ActionTypeUrls'
  { -- | The URL returned to the CodePipeline console that contains a link to the
    -- page where customers can configure the external action.
    ActionTypeUrls -> Maybe Text
configurationUrl :: Prelude.Maybe Prelude.Text,
    -- | The URL returned to the CodePipeline console that provides a deep link
    -- to the resources of the external system, such as a status page. This
    -- link is provided as part of the action display in the pipeline.
    ActionTypeUrls -> Maybe Text
entityUrlTemplate :: Prelude.Maybe Prelude.Text,
    -- | The link to an execution page for the action type in progress. For
    -- example, for a CodeDeploy action, this link is shown on the pipeline
    -- view page in the CodePipeline console, and it links to a CodeDeploy
    -- status page.
    ActionTypeUrls -> Maybe Text
executionUrlTemplate :: Prelude.Maybe Prelude.Text,
    -- | The URL returned to the CodePipeline console that contains a link to the
    -- page where customers can update or change the configuration of the
    -- external action.
    ActionTypeUrls -> Maybe Text
revisionUrlTemplate :: Prelude.Maybe Prelude.Text
  }
  deriving (ActionTypeUrls -> ActionTypeUrls -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ActionTypeUrls -> ActionTypeUrls -> Bool
$c/= :: ActionTypeUrls -> ActionTypeUrls -> Bool
== :: ActionTypeUrls -> ActionTypeUrls -> Bool
$c== :: ActionTypeUrls -> ActionTypeUrls -> Bool
Prelude.Eq, ReadPrec [ActionTypeUrls]
ReadPrec ActionTypeUrls
Int -> ReadS ActionTypeUrls
ReadS [ActionTypeUrls]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ActionTypeUrls]
$creadListPrec :: ReadPrec [ActionTypeUrls]
readPrec :: ReadPrec ActionTypeUrls
$creadPrec :: ReadPrec ActionTypeUrls
readList :: ReadS [ActionTypeUrls]
$creadList :: ReadS [ActionTypeUrls]
readsPrec :: Int -> ReadS ActionTypeUrls
$creadsPrec :: Int -> ReadS ActionTypeUrls
Prelude.Read, Int -> ActionTypeUrls -> ShowS
[ActionTypeUrls] -> ShowS
ActionTypeUrls -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ActionTypeUrls] -> ShowS
$cshowList :: [ActionTypeUrls] -> ShowS
show :: ActionTypeUrls -> String
$cshow :: ActionTypeUrls -> String
showsPrec :: Int -> ActionTypeUrls -> ShowS
$cshowsPrec :: Int -> ActionTypeUrls -> ShowS
Prelude.Show, forall x. Rep ActionTypeUrls x -> ActionTypeUrls
forall x. ActionTypeUrls -> Rep ActionTypeUrls x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ActionTypeUrls x -> ActionTypeUrls
$cfrom :: forall x. ActionTypeUrls -> Rep ActionTypeUrls x
Prelude.Generic)

-- |
-- Create a value of 'ActionTypeUrls' 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:
--
-- 'configurationUrl', 'actionTypeUrls_configurationUrl' - The URL returned to the CodePipeline console that contains a link to the
-- page where customers can configure the external action.
--
-- 'entityUrlTemplate', 'actionTypeUrls_entityUrlTemplate' - The URL returned to the CodePipeline console that provides a deep link
-- to the resources of the external system, such as a status page. This
-- link is provided as part of the action display in the pipeline.
--
-- 'executionUrlTemplate', 'actionTypeUrls_executionUrlTemplate' - The link to an execution page for the action type in progress. For
-- example, for a CodeDeploy action, this link is shown on the pipeline
-- view page in the CodePipeline console, and it links to a CodeDeploy
-- status page.
--
-- 'revisionUrlTemplate', 'actionTypeUrls_revisionUrlTemplate' - The URL returned to the CodePipeline console that contains a link to the
-- page where customers can update or change the configuration of the
-- external action.
newActionTypeUrls ::
  ActionTypeUrls
newActionTypeUrls :: ActionTypeUrls
newActionTypeUrls =
  ActionTypeUrls'
    { $sel:configurationUrl:ActionTypeUrls' :: Maybe Text
configurationUrl = forall a. Maybe a
Prelude.Nothing,
      $sel:entityUrlTemplate:ActionTypeUrls' :: Maybe Text
entityUrlTemplate = forall a. Maybe a
Prelude.Nothing,
      $sel:executionUrlTemplate:ActionTypeUrls' :: Maybe Text
executionUrlTemplate = forall a. Maybe a
Prelude.Nothing,
      $sel:revisionUrlTemplate:ActionTypeUrls' :: Maybe Text
revisionUrlTemplate = forall a. Maybe a
Prelude.Nothing
    }

-- | The URL returned to the CodePipeline console that contains a link to the
-- page where customers can configure the external action.
actionTypeUrls_configurationUrl :: Lens.Lens' ActionTypeUrls (Prelude.Maybe Prelude.Text)
actionTypeUrls_configurationUrl :: Lens' ActionTypeUrls (Maybe Text)
actionTypeUrls_configurationUrl = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionTypeUrls' {Maybe Text
configurationUrl :: Maybe Text
$sel:configurationUrl:ActionTypeUrls' :: ActionTypeUrls -> Maybe Text
configurationUrl} -> Maybe Text
configurationUrl) (\s :: ActionTypeUrls
s@ActionTypeUrls' {} Maybe Text
a -> ActionTypeUrls
s {$sel:configurationUrl:ActionTypeUrls' :: Maybe Text
configurationUrl = Maybe Text
a} :: ActionTypeUrls)

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

-- | The link to an execution page for the action type in progress. For
-- example, for a CodeDeploy action, this link is shown on the pipeline
-- view page in the CodePipeline console, and it links to a CodeDeploy
-- status page.
actionTypeUrls_executionUrlTemplate :: Lens.Lens' ActionTypeUrls (Prelude.Maybe Prelude.Text)
actionTypeUrls_executionUrlTemplate :: Lens' ActionTypeUrls (Maybe Text)
actionTypeUrls_executionUrlTemplate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ActionTypeUrls' {Maybe Text
executionUrlTemplate :: Maybe Text
$sel:executionUrlTemplate:ActionTypeUrls' :: ActionTypeUrls -> Maybe Text
executionUrlTemplate} -> Maybe Text
executionUrlTemplate) (\s :: ActionTypeUrls
s@ActionTypeUrls' {} Maybe Text
a -> ActionTypeUrls
s {$sel:executionUrlTemplate:ActionTypeUrls' :: Maybe Text
executionUrlTemplate = Maybe Text
a} :: ActionTypeUrls)

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

instance Data.FromJSON ActionTypeUrls where
  parseJSON :: Value -> Parser ActionTypeUrls
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ActionTypeUrls"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> ActionTypeUrls
ActionTypeUrls'
            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
"configurationUrl")
            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
"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")
      )

instance Prelude.Hashable ActionTypeUrls where
  hashWithSalt :: Int -> ActionTypeUrls -> Int
hashWithSalt Int
_salt ActionTypeUrls' {Maybe Text
revisionUrlTemplate :: Maybe Text
executionUrlTemplate :: Maybe Text
entityUrlTemplate :: Maybe Text
configurationUrl :: Maybe Text
$sel:revisionUrlTemplate:ActionTypeUrls' :: ActionTypeUrls -> Maybe Text
$sel:executionUrlTemplate:ActionTypeUrls' :: ActionTypeUrls -> Maybe Text
$sel:entityUrlTemplate:ActionTypeUrls' :: ActionTypeUrls -> Maybe Text
$sel:configurationUrl:ActionTypeUrls' :: ActionTypeUrls -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
configurationUrl
      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

instance Prelude.NFData ActionTypeUrls where
  rnf :: ActionTypeUrls -> ()
rnf ActionTypeUrls' {Maybe Text
revisionUrlTemplate :: Maybe Text
executionUrlTemplate :: Maybe Text
entityUrlTemplate :: Maybe Text
configurationUrl :: Maybe Text
$sel:revisionUrlTemplate:ActionTypeUrls' :: ActionTypeUrls -> Maybe Text
$sel:executionUrlTemplate:ActionTypeUrls' :: ActionTypeUrls -> Maybe Text
$sel:entityUrlTemplate:ActionTypeUrls' :: ActionTypeUrls -> Maybe Text
$sel:configurationUrl:ActionTypeUrls' :: ActionTypeUrls -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
configurationUrl
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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

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