packages feed

amazonka-codepipeline-2.0: gen/Amazonka/CodePipeline/Types/ActionTypeIdentifier.hs

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

import Amazonka.CodePipeline.Types.ActionCategory
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

-- | Specifies the category, owner, provider, and version of the action type.
--
-- /See:/ 'newActionTypeIdentifier' smart constructor.
data ActionTypeIdentifier = ActionTypeIdentifier'
  { -- | Defines what kind of action can be taken in the stage, one of the
    -- following:
    --
    -- -   @Source@
    --
    -- -   @Build@
    --
    -- -   @Test@
    --
    -- -   @Deploy@
    --
    -- -   @Approval@
    --
    -- -   @Invoke@
    category :: ActionCategory,
    -- | The creator of the action type being called: @AWS@ or @ThirdParty@.
    owner :: Prelude.Text,
    -- | The provider of the action type being called. The provider name is
    -- supplied when the action type is created.
    provider :: Prelude.Text,
    -- | A string that describes the action type version.
    version :: Prelude.Text
  }
  deriving (Prelude.Eq, Prelude.Read, Prelude.Show, Prelude.Generic)

-- |
-- Create a value of 'ActionTypeIdentifier' 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:
--
-- 'category', 'actionTypeIdentifier_category' - Defines what kind of action can be taken in the stage, one of the
-- following:
--
-- -   @Source@
--
-- -   @Build@
--
-- -   @Test@
--
-- -   @Deploy@
--
-- -   @Approval@
--
-- -   @Invoke@
--
-- 'owner', 'actionTypeIdentifier_owner' - The creator of the action type being called: @AWS@ or @ThirdParty@.
--
-- 'provider', 'actionTypeIdentifier_provider' - The provider of the action type being called. The provider name is
-- supplied when the action type is created.
--
-- 'version', 'actionTypeIdentifier_version' - A string that describes the action type version.
newActionTypeIdentifier ::
  -- | 'category'
  ActionCategory ->
  -- | 'owner'
  Prelude.Text ->
  -- | 'provider'
  Prelude.Text ->
  -- | 'version'
  Prelude.Text ->
  ActionTypeIdentifier
newActionTypeIdentifier
  pCategory_
  pOwner_
  pProvider_
  pVersion_ =
    ActionTypeIdentifier'
      { category = pCategory_,
        owner = pOwner_,
        provider = pProvider_,
        version = pVersion_
      }

-- | Defines what kind of action can be taken in the stage, one of the
-- following:
--
-- -   @Source@
--
-- -   @Build@
--
-- -   @Test@
--
-- -   @Deploy@
--
-- -   @Approval@
--
-- -   @Invoke@
actionTypeIdentifier_category :: Lens.Lens' ActionTypeIdentifier ActionCategory
actionTypeIdentifier_category = Lens.lens (\ActionTypeIdentifier' {category} -> category) (\s@ActionTypeIdentifier' {} a -> s {category = a} :: ActionTypeIdentifier)

-- | The creator of the action type being called: @AWS@ or @ThirdParty@.
actionTypeIdentifier_owner :: Lens.Lens' ActionTypeIdentifier Prelude.Text
actionTypeIdentifier_owner = Lens.lens (\ActionTypeIdentifier' {owner} -> owner) (\s@ActionTypeIdentifier' {} a -> s {owner = a} :: ActionTypeIdentifier)

-- | The provider of the action type being called. The provider name is
-- supplied when the action type is created.
actionTypeIdentifier_provider :: Lens.Lens' ActionTypeIdentifier Prelude.Text
actionTypeIdentifier_provider = Lens.lens (\ActionTypeIdentifier' {provider} -> provider) (\s@ActionTypeIdentifier' {} a -> s {provider = a} :: ActionTypeIdentifier)

-- | A string that describes the action type version.
actionTypeIdentifier_version :: Lens.Lens' ActionTypeIdentifier Prelude.Text
actionTypeIdentifier_version = Lens.lens (\ActionTypeIdentifier' {version} -> version) (\s@ActionTypeIdentifier' {} a -> s {version = a} :: ActionTypeIdentifier)

instance Data.FromJSON ActionTypeIdentifier where
  parseJSON =
    Data.withObject
      "ActionTypeIdentifier"
      ( \x ->
          ActionTypeIdentifier'
            Prelude.<$> (x Data..: "category")
            Prelude.<*> (x Data..: "owner")
            Prelude.<*> (x Data..: "provider")
            Prelude.<*> (x Data..: "version")
      )

instance Prelude.Hashable ActionTypeIdentifier where
  hashWithSalt _salt ActionTypeIdentifier' {..} =
    _salt
      `Prelude.hashWithSalt` category
      `Prelude.hashWithSalt` owner
      `Prelude.hashWithSalt` provider
      `Prelude.hashWithSalt` version

instance Prelude.NFData ActionTypeIdentifier where
  rnf ActionTypeIdentifier' {..} =
    Prelude.rnf category
      `Prelude.seq` Prelude.rnf owner
      `Prelude.seq` Prelude.rnf provider
      `Prelude.seq` Prelude.rnf version

instance Data.ToJSON ActionTypeIdentifier where
  toJSON ActionTypeIdentifier' {..} =
    Data.object
      ( Prelude.catMaybes
          [ Prelude.Just ("category" Data..= category),
            Prelude.Just ("owner" Data..= owner),
            Prelude.Just ("provider" Data..= provider),
            Prelude.Just ("version" Data..= version)
          ]
      )