{-# 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.DataPipeline.Types.PipelineIdName
-- 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.DataPipeline.Types.PipelineIdName 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

-- | Contains the name and identifier of a pipeline.
--
-- /See:/ 'newPipelineIdName' smart constructor.
data PipelineIdName = PipelineIdName'
  { -- | The ID of the pipeline that was assigned by AWS Data Pipeline. This is a
    -- string of the form @df-297EG78HU43EEXAMPLE@.
    PipelineIdName -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The name of the pipeline.
    PipelineIdName -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (PipelineIdName -> PipelineIdName -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PipelineIdName -> PipelineIdName -> Bool
$c/= :: PipelineIdName -> PipelineIdName -> Bool
== :: PipelineIdName -> PipelineIdName -> Bool
$c== :: PipelineIdName -> PipelineIdName -> Bool
Prelude.Eq, ReadPrec [PipelineIdName]
ReadPrec PipelineIdName
Int -> ReadS PipelineIdName
ReadS [PipelineIdName]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PipelineIdName]
$creadListPrec :: ReadPrec [PipelineIdName]
readPrec :: ReadPrec PipelineIdName
$creadPrec :: ReadPrec PipelineIdName
readList :: ReadS [PipelineIdName]
$creadList :: ReadS [PipelineIdName]
readsPrec :: Int -> ReadS PipelineIdName
$creadsPrec :: Int -> ReadS PipelineIdName
Prelude.Read, Int -> PipelineIdName -> ShowS
[PipelineIdName] -> ShowS
PipelineIdName -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PipelineIdName] -> ShowS
$cshowList :: [PipelineIdName] -> ShowS
show :: PipelineIdName -> String
$cshow :: PipelineIdName -> String
showsPrec :: Int -> PipelineIdName -> ShowS
$cshowsPrec :: Int -> PipelineIdName -> ShowS
Prelude.Show, forall x. Rep PipelineIdName x -> PipelineIdName
forall x. PipelineIdName -> Rep PipelineIdName x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PipelineIdName x -> PipelineIdName
$cfrom :: forall x. PipelineIdName -> Rep PipelineIdName x
Prelude.Generic)

-- |
-- Create a value of 'PipelineIdName' 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:
--
-- 'id', 'pipelineIdName_id' - The ID of the pipeline that was assigned by AWS Data Pipeline. This is a
-- string of the form @df-297EG78HU43EEXAMPLE@.
--
-- 'name', 'pipelineIdName_name' - The name of the pipeline.
newPipelineIdName ::
  PipelineIdName
newPipelineIdName :: PipelineIdName
newPipelineIdName =
  PipelineIdName'
    { $sel:id:PipelineIdName' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:name:PipelineIdName' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the pipeline that was assigned by AWS Data Pipeline. This is a
-- string of the form @df-297EG78HU43EEXAMPLE@.
pipelineIdName_id :: Lens.Lens' PipelineIdName (Prelude.Maybe Prelude.Text)
pipelineIdName_id :: Lens' PipelineIdName (Maybe Text)
pipelineIdName_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipelineIdName' {Maybe Text
id :: Maybe Text
$sel:id:PipelineIdName' :: PipelineIdName -> Maybe Text
id} -> Maybe Text
id) (\s :: PipelineIdName
s@PipelineIdName' {} Maybe Text
a -> PipelineIdName
s {$sel:id:PipelineIdName' :: Maybe Text
id = Maybe Text
a} :: PipelineIdName)

-- | The name of the pipeline.
pipelineIdName_name :: Lens.Lens' PipelineIdName (Prelude.Maybe Prelude.Text)
pipelineIdName_name :: Lens' PipelineIdName (Maybe Text)
pipelineIdName_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PipelineIdName' {Maybe Text
name :: Maybe Text
$sel:name:PipelineIdName' :: PipelineIdName -> Maybe Text
name} -> Maybe Text
name) (\s :: PipelineIdName
s@PipelineIdName' {} Maybe Text
a -> PipelineIdName
s {$sel:name:PipelineIdName' :: Maybe Text
name = Maybe Text
a} :: PipelineIdName)

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

instance Prelude.Hashable PipelineIdName where
  hashWithSalt :: Int -> PipelineIdName -> Int
hashWithSalt Int
_salt PipelineIdName' {Maybe Text
name :: Maybe Text
id :: Maybe Text
$sel:name:PipelineIdName' :: PipelineIdName -> Maybe Text
$sel:id:PipelineIdName' :: PipelineIdName -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name

instance Prelude.NFData PipelineIdName where
  rnf :: PipelineIdName -> ()
rnf PipelineIdName' {Maybe Text
name :: Maybe Text
id :: Maybe Text
$sel:name:PipelineIdName' :: PipelineIdName -> Maybe Text
$sel:id:PipelineIdName' :: PipelineIdName -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name