{-# 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.NetworkManager.Types.NetworkResourceSummary
-- 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.NetworkManager.Types.NetworkResourceSummary 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

-- | Describes a network resource.
--
-- /See:/ 'newNetworkResourceSummary' smart constructor.
data NetworkResourceSummary = NetworkResourceSummary'
  { -- | Information about the resource, in JSON format. Network Manager gets
    -- this information by describing the resource using its Describe API call.
    NetworkResourceSummary -> Maybe Text
definition :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether this is a middlebox appliance.
    NetworkResourceSummary -> Maybe Bool
isMiddlebox :: Prelude.Maybe Prelude.Bool,
    -- | The value for the Name tag.
    NetworkResourceSummary -> Maybe Text
nameTag :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the gateway.
    NetworkResourceSummary -> Maybe Text
registeredGatewayArn :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the resource.
    NetworkResourceSummary -> Maybe Text
resourceArn :: Prelude.Maybe Prelude.Text,
    -- | The resource type.
    NetworkResourceSummary -> Maybe Text
resourceType :: Prelude.Maybe Prelude.Text
  }
  deriving (NetworkResourceSummary -> NetworkResourceSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NetworkResourceSummary -> NetworkResourceSummary -> Bool
$c/= :: NetworkResourceSummary -> NetworkResourceSummary -> Bool
== :: NetworkResourceSummary -> NetworkResourceSummary -> Bool
$c== :: NetworkResourceSummary -> NetworkResourceSummary -> Bool
Prelude.Eq, ReadPrec [NetworkResourceSummary]
ReadPrec NetworkResourceSummary
Int -> ReadS NetworkResourceSummary
ReadS [NetworkResourceSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NetworkResourceSummary]
$creadListPrec :: ReadPrec [NetworkResourceSummary]
readPrec :: ReadPrec NetworkResourceSummary
$creadPrec :: ReadPrec NetworkResourceSummary
readList :: ReadS [NetworkResourceSummary]
$creadList :: ReadS [NetworkResourceSummary]
readsPrec :: Int -> ReadS NetworkResourceSummary
$creadsPrec :: Int -> ReadS NetworkResourceSummary
Prelude.Read, Int -> NetworkResourceSummary -> ShowS
[NetworkResourceSummary] -> ShowS
NetworkResourceSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NetworkResourceSummary] -> ShowS
$cshowList :: [NetworkResourceSummary] -> ShowS
show :: NetworkResourceSummary -> String
$cshow :: NetworkResourceSummary -> String
showsPrec :: Int -> NetworkResourceSummary -> ShowS
$cshowsPrec :: Int -> NetworkResourceSummary -> ShowS
Prelude.Show, forall x. Rep NetworkResourceSummary x -> NetworkResourceSummary
forall x. NetworkResourceSummary -> Rep NetworkResourceSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NetworkResourceSummary x -> NetworkResourceSummary
$cfrom :: forall x. NetworkResourceSummary -> Rep NetworkResourceSummary x
Prelude.Generic)

-- |
-- Create a value of 'NetworkResourceSummary' 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:
--
-- 'definition', 'networkResourceSummary_definition' - Information about the resource, in JSON format. Network Manager gets
-- this information by describing the resource using its Describe API call.
--
-- 'isMiddlebox', 'networkResourceSummary_isMiddlebox' - Indicates whether this is a middlebox appliance.
--
-- 'nameTag', 'networkResourceSummary_nameTag' - The value for the Name tag.
--
-- 'registeredGatewayArn', 'networkResourceSummary_registeredGatewayArn' - The ARN of the gateway.
--
-- 'resourceArn', 'networkResourceSummary_resourceArn' - The ARN of the resource.
--
-- 'resourceType', 'networkResourceSummary_resourceType' - The resource type.
newNetworkResourceSummary ::
  NetworkResourceSummary
newNetworkResourceSummary :: NetworkResourceSummary
newNetworkResourceSummary =
  NetworkResourceSummary'
    { $sel:definition:NetworkResourceSummary' :: Maybe Text
definition =
        forall a. Maybe a
Prelude.Nothing,
      $sel:isMiddlebox:NetworkResourceSummary' :: Maybe Bool
isMiddlebox = forall a. Maybe a
Prelude.Nothing,
      $sel:nameTag:NetworkResourceSummary' :: Maybe Text
nameTag = forall a. Maybe a
Prelude.Nothing,
      $sel:registeredGatewayArn:NetworkResourceSummary' :: Maybe Text
registeredGatewayArn = forall a. Maybe a
Prelude.Nothing,
      $sel:resourceArn:NetworkResourceSummary' :: Maybe Text
resourceArn = forall a. Maybe a
Prelude.Nothing,
      $sel:resourceType:NetworkResourceSummary' :: Maybe Text
resourceType = forall a. Maybe a
Prelude.Nothing
    }

-- | Information about the resource, in JSON format. Network Manager gets
-- this information by describing the resource using its Describe API call.
networkResourceSummary_definition :: Lens.Lens' NetworkResourceSummary (Prelude.Maybe Prelude.Text)
networkResourceSummary_definition :: Lens' NetworkResourceSummary (Maybe Text)
networkResourceSummary_definition = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkResourceSummary' {Maybe Text
definition :: Maybe Text
$sel:definition:NetworkResourceSummary' :: NetworkResourceSummary -> Maybe Text
definition} -> Maybe Text
definition) (\s :: NetworkResourceSummary
s@NetworkResourceSummary' {} Maybe Text
a -> NetworkResourceSummary
s {$sel:definition:NetworkResourceSummary' :: Maybe Text
definition = Maybe Text
a} :: NetworkResourceSummary)

-- | Indicates whether this is a middlebox appliance.
networkResourceSummary_isMiddlebox :: Lens.Lens' NetworkResourceSummary (Prelude.Maybe Prelude.Bool)
networkResourceSummary_isMiddlebox :: Lens' NetworkResourceSummary (Maybe Bool)
networkResourceSummary_isMiddlebox = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkResourceSummary' {Maybe Bool
isMiddlebox :: Maybe Bool
$sel:isMiddlebox:NetworkResourceSummary' :: NetworkResourceSummary -> Maybe Bool
isMiddlebox} -> Maybe Bool
isMiddlebox) (\s :: NetworkResourceSummary
s@NetworkResourceSummary' {} Maybe Bool
a -> NetworkResourceSummary
s {$sel:isMiddlebox:NetworkResourceSummary' :: Maybe Bool
isMiddlebox = Maybe Bool
a} :: NetworkResourceSummary)

-- | The value for the Name tag.
networkResourceSummary_nameTag :: Lens.Lens' NetworkResourceSummary (Prelude.Maybe Prelude.Text)
networkResourceSummary_nameTag :: Lens' NetworkResourceSummary (Maybe Text)
networkResourceSummary_nameTag = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkResourceSummary' {Maybe Text
nameTag :: Maybe Text
$sel:nameTag:NetworkResourceSummary' :: NetworkResourceSummary -> Maybe Text
nameTag} -> Maybe Text
nameTag) (\s :: NetworkResourceSummary
s@NetworkResourceSummary' {} Maybe Text
a -> NetworkResourceSummary
s {$sel:nameTag:NetworkResourceSummary' :: Maybe Text
nameTag = Maybe Text
a} :: NetworkResourceSummary)

-- | The ARN of the gateway.
networkResourceSummary_registeredGatewayArn :: Lens.Lens' NetworkResourceSummary (Prelude.Maybe Prelude.Text)
networkResourceSummary_registeredGatewayArn :: Lens' NetworkResourceSummary (Maybe Text)
networkResourceSummary_registeredGatewayArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkResourceSummary' {Maybe Text
registeredGatewayArn :: Maybe Text
$sel:registeredGatewayArn:NetworkResourceSummary' :: NetworkResourceSummary -> Maybe Text
registeredGatewayArn} -> Maybe Text
registeredGatewayArn) (\s :: NetworkResourceSummary
s@NetworkResourceSummary' {} Maybe Text
a -> NetworkResourceSummary
s {$sel:registeredGatewayArn:NetworkResourceSummary' :: Maybe Text
registeredGatewayArn = Maybe Text
a} :: NetworkResourceSummary)

-- | The ARN of the resource.
networkResourceSummary_resourceArn :: Lens.Lens' NetworkResourceSummary (Prelude.Maybe Prelude.Text)
networkResourceSummary_resourceArn :: Lens' NetworkResourceSummary (Maybe Text)
networkResourceSummary_resourceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkResourceSummary' {Maybe Text
resourceArn :: Maybe Text
$sel:resourceArn:NetworkResourceSummary' :: NetworkResourceSummary -> Maybe Text
resourceArn} -> Maybe Text
resourceArn) (\s :: NetworkResourceSummary
s@NetworkResourceSummary' {} Maybe Text
a -> NetworkResourceSummary
s {$sel:resourceArn:NetworkResourceSummary' :: Maybe Text
resourceArn = Maybe Text
a} :: NetworkResourceSummary)

-- | The resource type.
networkResourceSummary_resourceType :: Lens.Lens' NetworkResourceSummary (Prelude.Maybe Prelude.Text)
networkResourceSummary_resourceType :: Lens' NetworkResourceSummary (Maybe Text)
networkResourceSummary_resourceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkResourceSummary' {Maybe Text
resourceType :: Maybe Text
$sel:resourceType:NetworkResourceSummary' :: NetworkResourceSummary -> Maybe Text
resourceType} -> Maybe Text
resourceType) (\s :: NetworkResourceSummary
s@NetworkResourceSummary' {} Maybe Text
a -> NetworkResourceSummary
s {$sel:resourceType:NetworkResourceSummary' :: Maybe Text
resourceType = Maybe Text
a} :: NetworkResourceSummary)

instance Data.FromJSON NetworkResourceSummary where
  parseJSON :: Value -> Parser NetworkResourceSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"NetworkResourceSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> NetworkResourceSummary
NetworkResourceSummary'
            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
"Definition")
            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
"IsMiddlebox")
            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
"NameTag")
            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
"RegisteredGatewayArn")
            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
"ResourceArn")
            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
"ResourceType")
      )

instance Prelude.Hashable NetworkResourceSummary where
  hashWithSalt :: Int -> NetworkResourceSummary -> Int
hashWithSalt Int
_salt NetworkResourceSummary' {Maybe Bool
Maybe Text
resourceType :: Maybe Text
resourceArn :: Maybe Text
registeredGatewayArn :: Maybe Text
nameTag :: Maybe Text
isMiddlebox :: Maybe Bool
definition :: Maybe Text
$sel:resourceType:NetworkResourceSummary' :: NetworkResourceSummary -> Maybe Text
$sel:resourceArn:NetworkResourceSummary' :: NetworkResourceSummary -> Maybe Text
$sel:registeredGatewayArn:NetworkResourceSummary' :: NetworkResourceSummary -> Maybe Text
$sel:nameTag:NetworkResourceSummary' :: NetworkResourceSummary -> Maybe Text
$sel:isMiddlebox:NetworkResourceSummary' :: NetworkResourceSummary -> Maybe Bool
$sel:definition:NetworkResourceSummary' :: NetworkResourceSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
definition
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
isMiddlebox
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nameTag
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
registeredGatewayArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
resourceArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
resourceType

instance Prelude.NFData NetworkResourceSummary where
  rnf :: NetworkResourceSummary -> ()
rnf NetworkResourceSummary' {Maybe Bool
Maybe Text
resourceType :: Maybe Text
resourceArn :: Maybe Text
registeredGatewayArn :: Maybe Text
nameTag :: Maybe Text
isMiddlebox :: Maybe Bool
definition :: Maybe Text
$sel:resourceType:NetworkResourceSummary' :: NetworkResourceSummary -> Maybe Text
$sel:resourceArn:NetworkResourceSummary' :: NetworkResourceSummary -> Maybe Text
$sel:registeredGatewayArn:NetworkResourceSummary' :: NetworkResourceSummary -> Maybe Text
$sel:nameTag:NetworkResourceSummary' :: NetworkResourceSummary -> Maybe Text
$sel:isMiddlebox:NetworkResourceSummary' :: NetworkResourceSummary -> Maybe Bool
$sel:definition:NetworkResourceSummary' :: NetworkResourceSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
definition
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
isMiddlebox
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nameTag
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
registeredGatewayArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resourceArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resourceType