{-# 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.OAM.Types.ListSinksItem
-- 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.OAM.Types.ListSinksItem 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

-- | A structure that contains information about one of this monitoring
-- account\'s sinks.
--
-- /See:/ 'newListSinksItem' smart constructor.
data ListSinksItem = ListSinksItem'
  { -- | The ARN of the sink.
    ListSinksItem -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The random ID string that Amazon Web Services generated as part of the
    -- sink ARN.
    ListSinksItem -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The name of the sink.
    ListSinksItem -> Maybe Text
name :: Prelude.Maybe Prelude.Text
  }
  deriving (ListSinksItem -> ListSinksItem -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSinksItem -> ListSinksItem -> Bool
$c/= :: ListSinksItem -> ListSinksItem -> Bool
== :: ListSinksItem -> ListSinksItem -> Bool
$c== :: ListSinksItem -> ListSinksItem -> Bool
Prelude.Eq, ReadPrec [ListSinksItem]
ReadPrec ListSinksItem
Int -> ReadS ListSinksItem
ReadS [ListSinksItem]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSinksItem]
$creadListPrec :: ReadPrec [ListSinksItem]
readPrec :: ReadPrec ListSinksItem
$creadPrec :: ReadPrec ListSinksItem
readList :: ReadS [ListSinksItem]
$creadList :: ReadS [ListSinksItem]
readsPrec :: Int -> ReadS ListSinksItem
$creadsPrec :: Int -> ReadS ListSinksItem
Prelude.Read, Int -> ListSinksItem -> ShowS
[ListSinksItem] -> ShowS
ListSinksItem -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSinksItem] -> ShowS
$cshowList :: [ListSinksItem] -> ShowS
show :: ListSinksItem -> String
$cshow :: ListSinksItem -> String
showsPrec :: Int -> ListSinksItem -> ShowS
$cshowsPrec :: Int -> ListSinksItem -> ShowS
Prelude.Show, forall x. Rep ListSinksItem x -> ListSinksItem
forall x. ListSinksItem -> Rep ListSinksItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListSinksItem x -> ListSinksItem
$cfrom :: forall x. ListSinksItem -> Rep ListSinksItem x
Prelude.Generic)

-- |
-- Create a value of 'ListSinksItem' 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', 'listSinksItem_arn' - The ARN of the sink.
--
-- 'id', 'listSinksItem_id' - The random ID string that Amazon Web Services generated as part of the
-- sink ARN.
--
-- 'name', 'listSinksItem_name' - The name of the sink.
newListSinksItem ::
  ListSinksItem
newListSinksItem :: ListSinksItem
newListSinksItem =
  ListSinksItem'
    { $sel:arn:ListSinksItem' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:id:ListSinksItem' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:name:ListSinksItem' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing
    }

-- | The ARN of the sink.
listSinksItem_arn :: Lens.Lens' ListSinksItem (Prelude.Maybe Prelude.Text)
listSinksItem_arn :: Lens' ListSinksItem (Maybe Text)
listSinksItem_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSinksItem' {Maybe Text
arn :: Maybe Text
$sel:arn:ListSinksItem' :: ListSinksItem -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ListSinksItem
s@ListSinksItem' {} Maybe Text
a -> ListSinksItem
s {$sel:arn:ListSinksItem' :: Maybe Text
arn = Maybe Text
a} :: ListSinksItem)

-- | The random ID string that Amazon Web Services generated as part of the
-- sink ARN.
listSinksItem_id :: Lens.Lens' ListSinksItem (Prelude.Maybe Prelude.Text)
listSinksItem_id :: Lens' ListSinksItem (Maybe Text)
listSinksItem_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSinksItem' {Maybe Text
id :: Maybe Text
$sel:id:ListSinksItem' :: ListSinksItem -> Maybe Text
id} -> Maybe Text
id) (\s :: ListSinksItem
s@ListSinksItem' {} Maybe Text
a -> ListSinksItem
s {$sel:id:ListSinksItem' :: Maybe Text
id = Maybe Text
a} :: ListSinksItem)

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

instance Data.FromJSON ListSinksItem where
  parseJSON :: Value -> Parser ListSinksItem
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ListSinksItem"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Text -> ListSinksItem
ListSinksItem'
            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
"Arn")
            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
"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 ListSinksItem where
  hashWithSalt :: Int -> ListSinksItem -> Int
hashWithSalt Int
_salt ListSinksItem' {Maybe Text
name :: Maybe Text
id :: Maybe Text
arn :: Maybe Text
$sel:name:ListSinksItem' :: ListSinksItem -> Maybe Text
$sel:id:ListSinksItem' :: ListSinksItem -> Maybe Text
$sel:arn:ListSinksItem' :: ListSinksItem -> 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 ListSinksItem where
  rnf :: ListSinksItem -> ()
rnf ListSinksItem' {Maybe Text
name :: Maybe Text
id :: Maybe Text
arn :: Maybe Text
$sel:name:ListSinksItem' :: ListSinksItem -> Maybe Text
$sel:id:ListSinksItem' :: ListSinksItem -> Maybe Text
$sel:arn:ListSinksItem' :: ListSinksItem -> 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