{-# 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.Glue.Types.CrawlerNodeDetails
-- 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.Glue.Types.CrawlerNodeDetails where

import qualified Amazonka.Core as Core
import Amazonka.Glue.Types.Crawl
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | The details of a Crawler node present in the workflow.
--
-- /See:/ 'newCrawlerNodeDetails' smart constructor.
data CrawlerNodeDetails = CrawlerNodeDetails'
  { -- | A list of crawls represented by the crawl node.
    CrawlerNodeDetails -> Maybe [Crawl]
crawls :: Prelude.Maybe [Crawl]
  }
  deriving (CrawlerNodeDetails -> CrawlerNodeDetails -> Bool
(CrawlerNodeDetails -> CrawlerNodeDetails -> Bool)
-> (CrawlerNodeDetails -> CrawlerNodeDetails -> Bool)
-> Eq CrawlerNodeDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CrawlerNodeDetails -> CrawlerNodeDetails -> Bool
$c/= :: CrawlerNodeDetails -> CrawlerNodeDetails -> Bool
== :: CrawlerNodeDetails -> CrawlerNodeDetails -> Bool
$c== :: CrawlerNodeDetails -> CrawlerNodeDetails -> Bool
Prelude.Eq, ReadPrec [CrawlerNodeDetails]
ReadPrec CrawlerNodeDetails
Int -> ReadS CrawlerNodeDetails
ReadS [CrawlerNodeDetails]
(Int -> ReadS CrawlerNodeDetails)
-> ReadS [CrawlerNodeDetails]
-> ReadPrec CrawlerNodeDetails
-> ReadPrec [CrawlerNodeDetails]
-> Read CrawlerNodeDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CrawlerNodeDetails]
$creadListPrec :: ReadPrec [CrawlerNodeDetails]
readPrec :: ReadPrec CrawlerNodeDetails
$creadPrec :: ReadPrec CrawlerNodeDetails
readList :: ReadS [CrawlerNodeDetails]
$creadList :: ReadS [CrawlerNodeDetails]
readsPrec :: Int -> ReadS CrawlerNodeDetails
$creadsPrec :: Int -> ReadS CrawlerNodeDetails
Prelude.Read, Int -> CrawlerNodeDetails -> ShowS
[CrawlerNodeDetails] -> ShowS
CrawlerNodeDetails -> String
(Int -> CrawlerNodeDetails -> ShowS)
-> (CrawlerNodeDetails -> String)
-> ([CrawlerNodeDetails] -> ShowS)
-> Show CrawlerNodeDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CrawlerNodeDetails] -> ShowS
$cshowList :: [CrawlerNodeDetails] -> ShowS
show :: CrawlerNodeDetails -> String
$cshow :: CrawlerNodeDetails -> String
showsPrec :: Int -> CrawlerNodeDetails -> ShowS
$cshowsPrec :: Int -> CrawlerNodeDetails -> ShowS
Prelude.Show, (forall x. CrawlerNodeDetails -> Rep CrawlerNodeDetails x)
-> (forall x. Rep CrawlerNodeDetails x -> CrawlerNodeDetails)
-> Generic CrawlerNodeDetails
forall x. Rep CrawlerNodeDetails x -> CrawlerNodeDetails
forall x. CrawlerNodeDetails -> Rep CrawlerNodeDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CrawlerNodeDetails x -> CrawlerNodeDetails
$cfrom :: forall x. CrawlerNodeDetails -> Rep CrawlerNodeDetails x
Prelude.Generic)

-- |
-- Create a value of 'CrawlerNodeDetails' 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:
--
-- 'crawls', 'crawlerNodeDetails_crawls' - A list of crawls represented by the crawl node.
newCrawlerNodeDetails ::
  CrawlerNodeDetails
newCrawlerNodeDetails :: CrawlerNodeDetails
newCrawlerNodeDetails =
  CrawlerNodeDetails' :: Maybe [Crawl] -> CrawlerNodeDetails
CrawlerNodeDetails' {$sel:crawls:CrawlerNodeDetails' :: Maybe [Crawl]
crawls = Maybe [Crawl]
forall a. Maybe a
Prelude.Nothing}

-- | A list of crawls represented by the crawl node.
crawlerNodeDetails_crawls :: Lens.Lens' CrawlerNodeDetails (Prelude.Maybe [Crawl])
crawlerNodeDetails_crawls :: (Maybe [Crawl] -> f (Maybe [Crawl]))
-> CrawlerNodeDetails -> f CrawlerNodeDetails
crawlerNodeDetails_crawls = (CrawlerNodeDetails -> Maybe [Crawl])
-> (CrawlerNodeDetails -> Maybe [Crawl] -> CrawlerNodeDetails)
-> Lens
     CrawlerNodeDetails
     CrawlerNodeDetails
     (Maybe [Crawl])
     (Maybe [Crawl])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CrawlerNodeDetails' {Maybe [Crawl]
crawls :: Maybe [Crawl]
$sel:crawls:CrawlerNodeDetails' :: CrawlerNodeDetails -> Maybe [Crawl]
crawls} -> Maybe [Crawl]
crawls) (\s :: CrawlerNodeDetails
s@CrawlerNodeDetails' {} Maybe [Crawl]
a -> CrawlerNodeDetails
s {$sel:crawls:CrawlerNodeDetails' :: Maybe [Crawl]
crawls = Maybe [Crawl]
a} :: CrawlerNodeDetails) ((Maybe [Crawl] -> f (Maybe [Crawl]))
 -> CrawlerNodeDetails -> f CrawlerNodeDetails)
-> ((Maybe [Crawl] -> f (Maybe [Crawl]))
    -> Maybe [Crawl] -> f (Maybe [Crawl]))
-> (Maybe [Crawl] -> f (Maybe [Crawl]))
-> CrawlerNodeDetails
-> f CrawlerNodeDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Crawl] [Crawl] [Crawl] [Crawl]
-> Iso
     (Maybe [Crawl]) (Maybe [Crawl]) (Maybe [Crawl]) (Maybe [Crawl])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Crawl] [Crawl] [Crawl] [Crawl]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON CrawlerNodeDetails where
  parseJSON :: Value -> Parser CrawlerNodeDetails
parseJSON =
    String
-> (Object -> Parser CrawlerNodeDetails)
-> Value
-> Parser CrawlerNodeDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"CrawlerNodeDetails"
      ( \Object
x ->
          Maybe [Crawl] -> CrawlerNodeDetails
CrawlerNodeDetails'
            (Maybe [Crawl] -> CrawlerNodeDetails)
-> Parser (Maybe [Crawl]) -> Parser CrawlerNodeDetails
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [Crawl]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Crawls" Parser (Maybe (Maybe [Crawl]))
-> Maybe [Crawl] -> Parser (Maybe [Crawl])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Crawl]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable CrawlerNodeDetails

instance Prelude.NFData CrawlerNodeDetails