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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 current status of the network.
    NetworkSummary -> Maybe NetworkStatus
status :: Prelude.Maybe NetworkStatus,
    -- | The blockchain framework that the network uses.
    NetworkSummary -> Maybe Framework
framework :: Prelude.Maybe Framework,
    -- | 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 /AWS General Reference/.
    NetworkSummary -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The version of the blockchain framework that the network uses.
    NetworkSummary -> Maybe Text
frameworkVersion :: Prelude.Maybe Prelude.Text,
    -- | The name of the network.
    NetworkSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The unique identifier of the network.
    NetworkSummary -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The date and time that the network was created.
    NetworkSummary -> Maybe POSIX
creationDate :: Prelude.Maybe Core.POSIX,
    -- | An optional description of the network.
    NetworkSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text
  }
  deriving (NetworkSummary -> NetworkSummary -> Bool
(NetworkSummary -> NetworkSummary -> Bool)
-> (NetworkSummary -> NetworkSummary -> Bool) -> Eq NetworkSummary
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]
(Int -> ReadS NetworkSummary)
-> ReadS [NetworkSummary]
-> ReadPrec NetworkSummary
-> ReadPrec [NetworkSummary]
-> Read 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
(Int -> NetworkSummary -> ShowS)
-> (NetworkSummary -> String)
-> ([NetworkSummary] -> ShowS)
-> Show NetworkSummary
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. NetworkSummary -> Rep NetworkSummary x)
-> (forall x. Rep NetworkSummary x -> NetworkSummary)
-> Generic NetworkSummary
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:
--
-- 'status', 'networkSummary_status' - The current status of the network.
--
-- 'framework', 'networkSummary_framework' - The blockchain framework that the network uses.
--
-- '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 /AWS General Reference/.
--
-- 'frameworkVersion', 'networkSummary_frameworkVersion' - The version of the blockchain framework that the network uses.
--
-- 'name', 'networkSummary_name' - The name of the network.
--
-- 'id', 'networkSummary_id' - The unique identifier of the network.
--
-- 'creationDate', 'networkSummary_creationDate' - The date and time that the network was created.
--
-- 'description', 'networkSummary_description' - An optional description of the network.
newNetworkSummary ::
  NetworkSummary
newNetworkSummary :: NetworkSummary
newNetworkSummary =
  NetworkSummary' :: Maybe NetworkStatus
-> Maybe Framework
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> NetworkSummary
NetworkSummary'
    { $sel:status:NetworkSummary' :: Maybe NetworkStatus
status = Maybe NetworkStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:framework:NetworkSummary' :: Maybe Framework
framework = Maybe Framework
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:NetworkSummary' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:frameworkVersion:NetworkSummary' :: Maybe Text
frameworkVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:NetworkSummary' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:NetworkSummary' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creationDate:NetworkSummary' :: Maybe POSIX
creationDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:description:NetworkSummary' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The current status of the network.
networkSummary_status :: Lens.Lens' NetworkSummary (Prelude.Maybe NetworkStatus)
networkSummary_status :: (Maybe NetworkStatus -> f (Maybe NetworkStatus))
-> NetworkSummary -> f NetworkSummary
networkSummary_status = (NetworkSummary -> Maybe NetworkStatus)
-> (NetworkSummary -> Maybe NetworkStatus -> NetworkSummary)
-> Lens
     NetworkSummary
     NetworkSummary
     (Maybe NetworkStatus)
     (Maybe NetworkStatus)
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)

-- | The blockchain framework that the network uses.
networkSummary_framework :: Lens.Lens' NetworkSummary (Prelude.Maybe Framework)
networkSummary_framework :: (Maybe Framework -> f (Maybe Framework))
-> NetworkSummary -> f NetworkSummary
networkSummary_framework = (NetworkSummary -> Maybe Framework)
-> (NetworkSummary -> Maybe Framework -> NetworkSummary)
-> Lens
     NetworkSummary NetworkSummary (Maybe Framework) (Maybe 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 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 /AWS General Reference/.
networkSummary_arn :: Lens.Lens' NetworkSummary (Prelude.Maybe Prelude.Text)
networkSummary_arn :: (Maybe Text -> f (Maybe Text))
-> NetworkSummary -> f NetworkSummary
networkSummary_arn = (NetworkSummary -> Maybe Text)
-> (NetworkSummary -> Maybe Text -> NetworkSummary)
-> Lens NetworkSummary NetworkSummary (Maybe Text) (Maybe Text)
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 version of the blockchain framework that the network uses.
networkSummary_frameworkVersion :: Lens.Lens' NetworkSummary (Prelude.Maybe Prelude.Text)
networkSummary_frameworkVersion :: (Maybe Text -> f (Maybe Text))
-> NetworkSummary -> f NetworkSummary
networkSummary_frameworkVersion = (NetworkSummary -> Maybe Text)
-> (NetworkSummary -> Maybe Text -> NetworkSummary)
-> Lens NetworkSummary NetworkSummary (Maybe Text) (Maybe Text)
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 name of the network.
networkSummary_name :: Lens.Lens' NetworkSummary (Prelude.Maybe Prelude.Text)
networkSummary_name :: (Maybe Text -> f (Maybe Text))
-> NetworkSummary -> f NetworkSummary
networkSummary_name = (NetworkSummary -> Maybe Text)
-> (NetworkSummary -> Maybe Text -> NetworkSummary)
-> Lens NetworkSummary NetworkSummary (Maybe Text) (Maybe Text)
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 unique identifier of the network.
networkSummary_id :: Lens.Lens' NetworkSummary (Prelude.Maybe Prelude.Text)
networkSummary_id :: (Maybe Text -> f (Maybe Text))
-> NetworkSummary -> f NetworkSummary
networkSummary_id = (NetworkSummary -> Maybe Text)
-> (NetworkSummary -> Maybe Text -> NetworkSummary)
-> Lens NetworkSummary NetworkSummary (Maybe Text) (Maybe Text)
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 date and time that the network was created.
networkSummary_creationDate :: Lens.Lens' NetworkSummary (Prelude.Maybe Prelude.UTCTime)
networkSummary_creationDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> NetworkSummary -> f NetworkSummary
networkSummary_creationDate = (NetworkSummary -> Maybe POSIX)
-> (NetworkSummary -> Maybe POSIX -> NetworkSummary)
-> Lens NetworkSummary NetworkSummary (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkSummary' {Maybe POSIX
creationDate :: Maybe POSIX
$sel:creationDate:NetworkSummary' :: NetworkSummary -> Maybe POSIX
creationDate} -> Maybe POSIX
creationDate) (\s :: NetworkSummary
s@NetworkSummary' {} Maybe POSIX
a -> NetworkSummary
s {$sel:creationDate:NetworkSummary' :: Maybe POSIX
creationDate = Maybe POSIX
a} :: NetworkSummary) ((Maybe POSIX -> f (Maybe POSIX))
 -> NetworkSummary -> f NetworkSummary)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> NetworkSummary
-> f NetworkSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | An optional description of the network.
networkSummary_description :: Lens.Lens' NetworkSummary (Prelude.Maybe Prelude.Text)
networkSummary_description :: (Maybe Text -> f (Maybe Text))
-> NetworkSummary -> f NetworkSummary
networkSummary_description = (NetworkSummary -> Maybe Text)
-> (NetworkSummary -> Maybe Text -> NetworkSummary)
-> Lens NetworkSummary NetworkSummary (Maybe Text) (Maybe Text)
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)

instance Core.FromJSON NetworkSummary where
  parseJSON :: Value -> Parser NetworkSummary
parseJSON =
    String
-> (Object -> Parser NetworkSummary)
-> Value
-> Parser NetworkSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"NetworkSummary"
      ( \Object
x ->
          Maybe NetworkStatus
-> Maybe Framework
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> NetworkSummary
NetworkSummary'
            (Maybe NetworkStatus
 -> Maybe Framework
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> NetworkSummary)
-> Parser (Maybe NetworkStatus)
-> Parser
     (Maybe Framework
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> NetworkSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe NetworkStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
            Parser
  (Maybe Framework
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> NetworkSummary)
-> Parser (Maybe Framework)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> NetworkSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Framework)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Framework")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> NetworkSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> NetworkSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Arn")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> NetworkSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe POSIX -> Maybe Text -> NetworkSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FrameworkVersion")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe POSIX -> Maybe Text -> NetworkSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe POSIX -> Maybe Text -> NetworkSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Name")
            Parser (Maybe Text -> Maybe POSIX -> Maybe Text -> NetworkSummary)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> Maybe Text -> NetworkSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Id")
            Parser (Maybe POSIX -> Maybe Text -> NetworkSummary)
-> Parser (Maybe POSIX) -> Parser (Maybe Text -> NetworkSummary)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CreationDate")
            Parser (Maybe Text -> NetworkSummary)
-> Parser (Maybe Text) -> Parser NetworkSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Description")
      )

instance Prelude.Hashable NetworkSummary

instance Prelude.NFData NetworkSummary