{-# 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.EC2.Types.AnalysisComponent
-- 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.EC2.Types.AnalysisComponent where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.EC2.Internal
import qualified Amazonka.Prelude as Prelude

-- | Describes a path component.
--
-- /See:/ 'newAnalysisComponent' smart constructor.
data AnalysisComponent = AnalysisComponent'
  { -- | The Amazon Resource Name (ARN) of the component.
    AnalysisComponent -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The ID of the component.
    AnalysisComponent -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The name of the analysis component.
    AnalysisComponent -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (AnalysisComponent -> AnalysisComponent -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AnalysisComponent -> AnalysisComponent -> Bool
$c/= :: AnalysisComponent -> AnalysisComponent -> Bool
== :: AnalysisComponent -> AnalysisComponent -> Bool
$c== :: AnalysisComponent -> AnalysisComponent -> Bool
Prelude.Eq, ReadPrec [AnalysisComponent]
ReadPrec AnalysisComponent
Int -> ReadS AnalysisComponent
ReadS [AnalysisComponent]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AnalysisComponent]
$creadListPrec :: ReadPrec [AnalysisComponent]
readPrec :: ReadPrec AnalysisComponent
$creadPrec :: ReadPrec AnalysisComponent
readList :: ReadS [AnalysisComponent]
$creadList :: ReadS [AnalysisComponent]
readsPrec :: Int -> ReadS AnalysisComponent
$creadsPrec :: Int -> ReadS AnalysisComponent
Prelude.Read, Int -> AnalysisComponent -> ShowS
[AnalysisComponent] -> ShowS
AnalysisComponent -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AnalysisComponent] -> ShowS
$cshowList :: [AnalysisComponent] -> ShowS
show :: AnalysisComponent -> String
$cshow :: AnalysisComponent -> String
showsPrec :: Int -> AnalysisComponent -> ShowS
$cshowsPrec :: Int -> AnalysisComponent -> ShowS
Prelude.Show, forall x. Rep AnalysisComponent x -> AnalysisComponent
forall x. AnalysisComponent -> Rep AnalysisComponent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AnalysisComponent x -> AnalysisComponent
$cfrom :: forall x. AnalysisComponent -> Rep AnalysisComponent x
Prelude.Generic)

-- |
-- Create a value of 'AnalysisComponent' 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:
--
-- 'arn', 'analysisComponent_arn' - The Amazon Resource Name (ARN) of the component.
--
-- 'id', 'analysisComponent_id' - The ID of the component.
--
-- 'name', 'analysisComponent_name' - The name of the analysis component.
newAnalysisComponent ::
  AnalysisComponent
newAnalysisComponent :: AnalysisComponent
newAnalysisComponent =
  AnalysisComponent'
    { $sel:arn:AnalysisComponent' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:id:AnalysisComponent' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:name:AnalysisComponent' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the component.
analysisComponent_arn :: Lens.Lens' AnalysisComponent (Prelude.Maybe Prelude.Text)
analysisComponent_arn :: Lens' AnalysisComponent (Maybe Text)
analysisComponent_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnalysisComponent' {Maybe Text
arn :: Maybe Text
$sel:arn:AnalysisComponent' :: AnalysisComponent -> Maybe Text
arn} -> Maybe Text
arn) (\s :: AnalysisComponent
s@AnalysisComponent' {} Maybe Text
a -> AnalysisComponent
s {$sel:arn:AnalysisComponent' :: Maybe Text
arn = Maybe Text
a} :: AnalysisComponent)

-- | The ID of the component.
analysisComponent_id :: Lens.Lens' AnalysisComponent (Prelude.Maybe Prelude.Text)
analysisComponent_id :: Lens' AnalysisComponent (Maybe Text)
analysisComponent_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AnalysisComponent' {Maybe Text
id :: Maybe Text
$sel:id:AnalysisComponent' :: AnalysisComponent -> Maybe Text
id} -> Maybe Text
id) (\s :: AnalysisComponent
s@AnalysisComponent' {} Maybe Text
a -> AnalysisComponent
s {$sel:id:AnalysisComponent' :: Maybe Text
id = Maybe Text
a} :: AnalysisComponent)

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

instance Data.FromXML AnalysisComponent where
  parseXML :: [Node] -> Either String AnalysisComponent
parseXML [Node]
x =
    Maybe Text -> Maybe Text -> Maybe Text -> AnalysisComponent
AnalysisComponent'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"arn")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"id")
      forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"name")

instance Prelude.Hashable AnalysisComponent where
  hashWithSalt :: Int -> AnalysisComponent -> Int
hashWithSalt Int
_salt AnalysisComponent' {Maybe Text
name :: Maybe Text
id :: Maybe Text
arn :: Maybe Text
$sel:name:AnalysisComponent' :: AnalysisComponent -> Maybe Text
$sel:id:AnalysisComponent' :: AnalysisComponent -> Maybe Text
$sel:arn:AnalysisComponent' :: AnalysisComponent -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
      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 AnalysisComponent where
  rnf :: AnalysisComponent -> ()
rnf AnalysisComponent' {Maybe Text
name :: Maybe Text
id :: Maybe Text
arn :: Maybe Text
$sel:name:AnalysisComponent' :: AnalysisComponent -> Maybe Text
$sel:id:AnalysisComponent' :: AnalysisComponent -> Maybe Text
$sel:arn:AnalysisComponent' :: AnalysisComponent -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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