{-# 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.ManagedBlockChain.Types.NetworkSummary
-- 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.ManagedBlockChain.Types.NetworkSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ManagedBlockChain.Types.Framework
import Amazonka.ManagedBlockChain.Types.NetworkStatus
import qualified Amazonka.Prelude as Prelude

-- | A summary of network configuration properties.
--
-- /See:/ 'newNetworkSummary' smart constructor.
data NetworkSummary = NetworkSummary'
  { -- | The Amazon Resource Name (ARN) of the network. For more information
    -- about ARNs and their format, see
    -- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs)>
    -- in the /Amazon Web Services General Reference/.
    NetworkSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The date and time that the network was created.
    NetworkSummary -> Maybe ISO8601
creationDate :: Prelude.Maybe Data.ISO8601,
    -- | An optional description of the network.
    NetworkSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The blockchain framework that the network uses.
    NetworkSummary -> Maybe Framework
framework :: Prelude.Maybe Framework,
    -- | The version of the blockchain framework that the network uses.
    NetworkSummary -> Maybe Text
frameworkVersion :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier of the network.
    NetworkSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The name of the network.
    NetworkSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The current status of the network.
    NetworkSummary -> Maybe NetworkStatus
status :: Prelude.Maybe NetworkStatus
  }
  deriving (NetworkSummary -> NetworkSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NetworkSummary -> NetworkSummary -> Bool
$c/= :: NetworkSummary -> NetworkSummary -> Bool
== :: NetworkSummary -> NetworkSummary -> Bool
$c== :: NetworkSummary -> NetworkSummary -> Bool
Prelude.Eq, ReadPrec [NetworkSummary]
ReadPrec NetworkSummary
Int -> ReadS NetworkSummary
ReadS [NetworkSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NetworkSummary]
$creadListPrec :: ReadPrec [NetworkSummary]
readPrec :: ReadPrec NetworkSummary
$creadPrec :: ReadPrec NetworkSummary
readList :: ReadS [NetworkSummary]
$creadList :: ReadS [NetworkSummary]
readsPrec :: Int -> ReadS NetworkSummary
$creadsPrec :: Int -> ReadS NetworkSummary
Prelude.Read, Int -> NetworkSummary -> ShowS
[NetworkSummary] -> ShowS
NetworkSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NetworkSummary] -> ShowS
$cshowList :: [NetworkSummary] -> ShowS
show :: NetworkSummary -> String
$cshow :: NetworkSummary -> String
showsPrec :: Int -> NetworkSummary -> ShowS
$cshowsPrec :: Int -> NetworkSummary -> ShowS
Prelude.Show, forall x. Rep NetworkSummary x -> NetworkSummary
forall x. NetworkSummary -> Rep NetworkSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NetworkSummary x -> NetworkSummary
$cfrom :: forall x. NetworkSummary -> Rep NetworkSummary x
Prelude.Generic)

-- |
-- Create a value of 'NetworkSummary' 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', 'networkSummary_arn' - The Amazon Resource Name (ARN) of the network. For more information
-- about ARNs and their format, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs)>
-- in the /Amazon Web Services General Reference/.
--
-- 'creationDate', 'networkSummary_creationDate' - The date and time that the network was created.
--
-- 'description', 'networkSummary_description' - An optional description of the network.
--
-- 'framework', 'networkSummary_framework' - The blockchain framework that the network uses.
--
-- 'frameworkVersion', 'networkSummary_frameworkVersion' - The version of the blockchain framework that the network uses.
--
-- 'id', 'networkSummary_id' - The unique identifier of the network.
--
-- 'name', 'networkSummary_name' - The name of the network.
--
-- 'status', 'networkSummary_status' - The current status of the network.
newNetworkSummary ::
  NetworkSummary
newNetworkSummary :: NetworkSummary
newNetworkSummary =
  NetworkSummary'
    { $sel:arn:NetworkSummary' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
      $sel:creationDate:NetworkSummary' :: Maybe ISO8601
creationDate = forall a. Maybe a
Prelude.Nothing,
      $sel:description:NetworkSummary' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:framework:NetworkSummary' :: Maybe Framework
framework = forall a. Maybe a
Prelude.Nothing,
      $sel:frameworkVersion:NetworkSummary' :: Maybe Text
frameworkVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:id:NetworkSummary' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
      $sel:name:NetworkSummary' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:status:NetworkSummary' :: Maybe NetworkStatus
status = forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the network. For more information
-- about ARNs and their format, see
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html Amazon Resource Names (ARNs)>
-- in the /Amazon Web Services General Reference/.
networkSummary_arn :: Lens.Lens' NetworkSummary (Prelude.Maybe Prelude.Text)
networkSummary_arn :: Lens' NetworkSummary (Maybe Text)
networkSummary_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkSummary' {Maybe Text
arn :: Maybe Text
$sel:arn:NetworkSummary' :: NetworkSummary -> Maybe Text
arn} -> Maybe Text
arn) (\s :: NetworkSummary
s@NetworkSummary' {} Maybe Text
a -> NetworkSummary
s {$sel:arn:NetworkSummary' :: Maybe Text
arn = Maybe Text
a} :: NetworkSummary)

-- | The date and time that the network was created.
networkSummary_creationDate :: Lens.Lens' NetworkSummary (Prelude.Maybe Prelude.UTCTime)
networkSummary_creationDate :: Lens' NetworkSummary (Maybe UTCTime)
networkSummary_creationDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkSummary' {Maybe ISO8601
creationDate :: Maybe ISO8601
$sel:creationDate:NetworkSummary' :: NetworkSummary -> Maybe ISO8601
creationDate} -> Maybe ISO8601
creationDate) (\s :: NetworkSummary
s@NetworkSummary' {} Maybe ISO8601
a -> NetworkSummary
s {$sel:creationDate:NetworkSummary' :: Maybe ISO8601
creationDate = Maybe ISO8601
a} :: NetworkSummary) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | An optional description of the network.
networkSummary_description :: Lens.Lens' NetworkSummary (Prelude.Maybe Prelude.Text)
networkSummary_description :: Lens' NetworkSummary (Maybe Text)
networkSummary_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkSummary' {Maybe Text
description :: Maybe Text
$sel:description:NetworkSummary' :: NetworkSummary -> Maybe Text
description} -> Maybe Text
description) (\s :: NetworkSummary
s@NetworkSummary' {} Maybe Text
a -> NetworkSummary
s {$sel:description:NetworkSummary' :: Maybe Text
description = Maybe Text
a} :: NetworkSummary)

-- | The blockchain framework that the network uses.
networkSummary_framework :: Lens.Lens' NetworkSummary (Prelude.Maybe Framework)
networkSummary_framework :: Lens' NetworkSummary (Maybe Framework)
networkSummary_framework = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkSummary' {Maybe Framework
framework :: Maybe Framework
$sel:framework:NetworkSummary' :: NetworkSummary -> Maybe Framework
framework} -> Maybe Framework
framework) (\s :: NetworkSummary
s@NetworkSummary' {} Maybe Framework
a -> NetworkSummary
s {$sel:framework:NetworkSummary' :: Maybe Framework
framework = Maybe Framework
a} :: NetworkSummary)

-- | The version of the blockchain framework that the network uses.
networkSummary_frameworkVersion :: Lens.Lens' NetworkSummary (Prelude.Maybe Prelude.Text)
networkSummary_frameworkVersion :: Lens' NetworkSummary (Maybe Text)
networkSummary_frameworkVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkSummary' {Maybe Text
frameworkVersion :: Maybe Text
$sel:frameworkVersion:NetworkSummary' :: NetworkSummary -> Maybe Text
frameworkVersion} -> Maybe Text
frameworkVersion) (\s :: NetworkSummary
s@NetworkSummary' {} Maybe Text
a -> NetworkSummary
s {$sel:frameworkVersion:NetworkSummary' :: Maybe Text
frameworkVersion = Maybe Text
a} :: NetworkSummary)

-- | The unique identifier of the network.
networkSummary_id :: Lens.Lens' NetworkSummary (Prelude.Maybe Prelude.Text)
networkSummary_id :: Lens' NetworkSummary (Maybe Text)
networkSummary_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkSummary' {Maybe Text
id :: Maybe Text
$sel:id:NetworkSummary' :: NetworkSummary -> Maybe Text
id} -> Maybe Text
id) (\s :: NetworkSummary
s@NetworkSummary' {} Maybe Text
a -> NetworkSummary
s {$sel:id:NetworkSummary' :: Maybe Text
id = Maybe Text
a} :: NetworkSummary)

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

-- | The current status of the network.
networkSummary_status :: Lens.Lens' NetworkSummary (Prelude.Maybe NetworkStatus)
networkSummary_status :: Lens' NetworkSummary (Maybe NetworkStatus)
networkSummary_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkSummary' {Maybe NetworkStatus
status :: Maybe NetworkStatus
$sel:status:NetworkSummary' :: NetworkSummary -> Maybe NetworkStatus
status} -> Maybe NetworkStatus
status) (\s :: NetworkSummary
s@NetworkSummary' {} Maybe NetworkStatus
a -> NetworkSummary
s {$sel:status:NetworkSummary' :: Maybe NetworkStatus
status = Maybe NetworkStatus
a} :: NetworkSummary)

instance Data.FromJSON NetworkSummary where
  parseJSON :: Value -> Parser NetworkSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"NetworkSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe ISO8601
-> Maybe Text
-> Maybe Framework
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe NetworkStatus
-> NetworkSummary
NetworkSummary'
            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
"CreationDate")
            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
"Description")
            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
"Framework")
            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
"FrameworkVersion")
            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")
            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
"Status")
      )

instance Prelude.Hashable NetworkSummary where
  hashWithSalt :: Int -> NetworkSummary -> Int
hashWithSalt Int
_salt NetworkSummary' {Maybe Text
Maybe ISO8601
Maybe Framework
Maybe NetworkStatus
status :: Maybe NetworkStatus
name :: Maybe Text
id :: Maybe Text
frameworkVersion :: Maybe Text
framework :: Maybe Framework
description :: Maybe Text
creationDate :: Maybe ISO8601
arn :: Maybe Text
$sel:status:NetworkSummary' :: NetworkSummary -> Maybe NetworkStatus
$sel:name:NetworkSummary' :: NetworkSummary -> Maybe Text
$sel:id:NetworkSummary' :: NetworkSummary -> Maybe Text
$sel:frameworkVersion:NetworkSummary' :: NetworkSummary -> Maybe Text
$sel:framework:NetworkSummary' :: NetworkSummary -> Maybe Framework
$sel:description:NetworkSummary' :: NetworkSummary -> Maybe Text
$sel:creationDate:NetworkSummary' :: NetworkSummary -> Maybe ISO8601
$sel:arn:NetworkSummary' :: NetworkSummary -> 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 ISO8601
creationDate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Framework
framework
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
frameworkVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe NetworkStatus
status

instance Prelude.NFData NetworkSummary where
  rnf :: NetworkSummary -> ()
rnf NetworkSummary' {Maybe Text
Maybe ISO8601
Maybe Framework
Maybe NetworkStatus
status :: Maybe NetworkStatus
name :: Maybe Text
id :: Maybe Text
frameworkVersion :: Maybe Text
framework :: Maybe Framework
description :: Maybe Text
creationDate :: Maybe ISO8601
arn :: Maybe Text
$sel:status:NetworkSummary' :: NetworkSummary -> Maybe NetworkStatus
$sel:name:NetworkSummary' :: NetworkSummary -> Maybe Text
$sel:id:NetworkSummary' :: NetworkSummary -> Maybe Text
$sel:frameworkVersion:NetworkSummary' :: NetworkSummary -> Maybe Text
$sel:framework:NetworkSummary' :: NetworkSummary -> Maybe Framework
$sel:description:NetworkSummary' :: NetworkSummary -> Maybe Text
$sel:creationDate:NetworkSummary' :: NetworkSummary -> Maybe ISO8601
$sel:arn:NetworkSummary' :: NetworkSummary -> 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 ISO8601
creationDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Framework
framework
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
frameworkVersion
      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
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe NetworkStatus
status