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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 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,
    -- | 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 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
  }
  deriving (ActionTypeUrls -> ActionTypeUrls -> Bool
(ActionTypeUrls -> ActionTypeUrls -> Bool)
-> (ActionTypeUrls -> ActionTypeUrls -> Bool) -> Eq ActionTypeUrls
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]
(Int -> ReadS ActionTypeUrls)
-> ReadS [ActionTypeUrls]
-> ReadPrec ActionTypeUrls
-> ReadPrec [ActionTypeUrls]
-> Read 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
(Int -> ActionTypeUrls -> ShowS)
-> (ActionTypeUrls -> String)
-> ([ActionTypeUrls] -> ShowS)
-> Show ActionTypeUrls
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. ActionTypeUrls -> Rep ActionTypeUrls x)
-> (forall x. Rep ActionTypeUrls x -> ActionTypeUrls)
-> Generic ActionTypeUrls
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:
--
-- '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.
--
-- '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.
--
-- 'configurationUrl', 'actionTypeUrls_configurationUrl' - The URL returned to the CodePipeline console that contains a link to the
-- page where customers can configure the external action.
newActionTypeUrls ::
  ActionTypeUrls
newActionTypeUrls :: ActionTypeUrls
newActionTypeUrls =
  ActionTypeUrls' :: Maybe Text
-> Maybe Text -> Maybe Text -> Maybe Text -> ActionTypeUrls
ActionTypeUrls'
    { $sel:executionUrlTemplate:ActionTypeUrls' :: Maybe Text
executionUrlTemplate =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:revisionUrlTemplate:ActionTypeUrls' :: Maybe Text
revisionUrlTemplate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:entityUrlTemplate:ActionTypeUrls' :: Maybe Text
entityUrlTemplate = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:configurationUrl:ActionTypeUrls' :: Maybe Text
configurationUrl = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> ActionTypeUrls -> f ActionTypeUrls
actionTypeUrls_executionUrlTemplate = (ActionTypeUrls -> Maybe Text)
-> (ActionTypeUrls -> Maybe Text -> ActionTypeUrls)
-> Lens ActionTypeUrls ActionTypeUrls (Maybe Text) (Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> ActionTypeUrls -> f ActionTypeUrls
actionTypeUrls_revisionUrlTemplate = (ActionTypeUrls -> Maybe Text)
-> (ActionTypeUrls -> Maybe Text -> ActionTypeUrls)
-> Lens ActionTypeUrls ActionTypeUrls (Maybe Text) (Maybe Text)
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)

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> ActionTypeUrls -> f ActionTypeUrls
actionTypeUrls_entityUrlTemplate = (ActionTypeUrls -> Maybe Text)
-> (ActionTypeUrls -> Maybe Text -> ActionTypeUrls)
-> Lens ActionTypeUrls ActionTypeUrls (Maybe Text) (Maybe Text)
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 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 :: (Maybe Text -> f (Maybe Text))
-> ActionTypeUrls -> f ActionTypeUrls
actionTypeUrls_configurationUrl = (ActionTypeUrls -> Maybe Text)
-> (ActionTypeUrls -> Maybe Text -> ActionTypeUrls)
-> Lens ActionTypeUrls ActionTypeUrls (Maybe Text) (Maybe Text)
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)

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

instance Prelude.Hashable ActionTypeUrls

instance Prelude.NFData ActionTypeUrls

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