{-# 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.DMS.Types.ServerShortInfoResponse
-- 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.DMS.Types.ServerShortInfoResponse 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 server in a Fleet Advisor collector inventory.
--
-- /See:/ 'newServerShortInfoResponse' smart constructor.
data ServerShortInfoResponse = ServerShortInfoResponse'
  { -- | The IP address of a server in a Fleet Advisor collector inventory.
    ServerShortInfoResponse -> Maybe Text
ipAddress :: Prelude.Maybe Prelude.Text,
    -- | The ID of a server in a Fleet Advisor collector inventory.
    ServerShortInfoResponse -> Maybe Text
serverId :: Prelude.Maybe Prelude.Text,
    -- | The name address of a server in a Fleet Advisor collector inventory.
    ServerShortInfoResponse -> Maybe Text
serverName :: Prelude.Maybe Prelude.Text
  }
  deriving (ServerShortInfoResponse -> ServerShortInfoResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ServerShortInfoResponse -> ServerShortInfoResponse -> Bool
$c/= :: ServerShortInfoResponse -> ServerShortInfoResponse -> Bool
== :: ServerShortInfoResponse -> ServerShortInfoResponse -> Bool
$c== :: ServerShortInfoResponse -> ServerShortInfoResponse -> Bool
Prelude.Eq, ReadPrec [ServerShortInfoResponse]
ReadPrec ServerShortInfoResponse
Int -> ReadS ServerShortInfoResponse
ReadS [ServerShortInfoResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ServerShortInfoResponse]
$creadListPrec :: ReadPrec [ServerShortInfoResponse]
readPrec :: ReadPrec ServerShortInfoResponse
$creadPrec :: ReadPrec ServerShortInfoResponse
readList :: ReadS [ServerShortInfoResponse]
$creadList :: ReadS [ServerShortInfoResponse]
readsPrec :: Int -> ReadS ServerShortInfoResponse
$creadsPrec :: Int -> ReadS ServerShortInfoResponse
Prelude.Read, Int -> ServerShortInfoResponse -> ShowS
[ServerShortInfoResponse] -> ShowS
ServerShortInfoResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ServerShortInfoResponse] -> ShowS
$cshowList :: [ServerShortInfoResponse] -> ShowS
show :: ServerShortInfoResponse -> String
$cshow :: ServerShortInfoResponse -> String
showsPrec :: Int -> ServerShortInfoResponse -> ShowS
$cshowsPrec :: Int -> ServerShortInfoResponse -> ShowS
Prelude.Show, forall x. Rep ServerShortInfoResponse x -> ServerShortInfoResponse
forall x. ServerShortInfoResponse -> Rep ServerShortInfoResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ServerShortInfoResponse x -> ServerShortInfoResponse
$cfrom :: forall x. ServerShortInfoResponse -> Rep ServerShortInfoResponse x
Prelude.Generic)

-- |
-- Create a value of 'ServerShortInfoResponse' 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:
--
-- 'ipAddress', 'serverShortInfoResponse_ipAddress' - The IP address of a server in a Fleet Advisor collector inventory.
--
-- 'serverId', 'serverShortInfoResponse_serverId' - The ID of a server in a Fleet Advisor collector inventory.
--
-- 'serverName', 'serverShortInfoResponse_serverName' - The name address of a server in a Fleet Advisor collector inventory.
newServerShortInfoResponse ::
  ServerShortInfoResponse
newServerShortInfoResponse :: ServerShortInfoResponse
newServerShortInfoResponse =
  ServerShortInfoResponse'
    { $sel:ipAddress:ServerShortInfoResponse' :: Maybe Text
ipAddress =
        forall a. Maybe a
Prelude.Nothing,
      $sel:serverId:ServerShortInfoResponse' :: Maybe Text
serverId = forall a. Maybe a
Prelude.Nothing,
      $sel:serverName:ServerShortInfoResponse' :: Maybe Text
serverName = forall a. Maybe a
Prelude.Nothing
    }

-- | The IP address of a server in a Fleet Advisor collector inventory.
serverShortInfoResponse_ipAddress :: Lens.Lens' ServerShortInfoResponse (Prelude.Maybe Prelude.Text)
serverShortInfoResponse_ipAddress :: Lens' ServerShortInfoResponse (Maybe Text)
serverShortInfoResponse_ipAddress = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerShortInfoResponse' {Maybe Text
ipAddress :: Maybe Text
$sel:ipAddress:ServerShortInfoResponse' :: ServerShortInfoResponse -> Maybe Text
ipAddress} -> Maybe Text
ipAddress) (\s :: ServerShortInfoResponse
s@ServerShortInfoResponse' {} Maybe Text
a -> ServerShortInfoResponse
s {$sel:ipAddress:ServerShortInfoResponse' :: Maybe Text
ipAddress = Maybe Text
a} :: ServerShortInfoResponse)

-- | The ID of a server in a Fleet Advisor collector inventory.
serverShortInfoResponse_serverId :: Lens.Lens' ServerShortInfoResponse (Prelude.Maybe Prelude.Text)
serverShortInfoResponse_serverId :: Lens' ServerShortInfoResponse (Maybe Text)
serverShortInfoResponse_serverId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerShortInfoResponse' {Maybe Text
serverId :: Maybe Text
$sel:serverId:ServerShortInfoResponse' :: ServerShortInfoResponse -> Maybe Text
serverId} -> Maybe Text
serverId) (\s :: ServerShortInfoResponse
s@ServerShortInfoResponse' {} Maybe Text
a -> ServerShortInfoResponse
s {$sel:serverId:ServerShortInfoResponse' :: Maybe Text
serverId = Maybe Text
a} :: ServerShortInfoResponse)

-- | The name address of a server in a Fleet Advisor collector inventory.
serverShortInfoResponse_serverName :: Lens.Lens' ServerShortInfoResponse (Prelude.Maybe Prelude.Text)
serverShortInfoResponse_serverName :: Lens' ServerShortInfoResponse (Maybe Text)
serverShortInfoResponse_serverName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServerShortInfoResponse' {Maybe Text
serverName :: Maybe Text
$sel:serverName:ServerShortInfoResponse' :: ServerShortInfoResponse -> Maybe Text
serverName} -> Maybe Text
serverName) (\s :: ServerShortInfoResponse
s@ServerShortInfoResponse' {} Maybe Text
a -> ServerShortInfoResponse
s {$sel:serverName:ServerShortInfoResponse' :: Maybe Text
serverName = Maybe Text
a} :: ServerShortInfoResponse)

instance Data.FromJSON ServerShortInfoResponse where
  parseJSON :: Value -> Parser ServerShortInfoResponse
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ServerShortInfoResponse"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Text -> ServerShortInfoResponse
ServerShortInfoResponse'
            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
"IpAddress")
            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
"ServerId")
            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
"ServerName")
      )

instance Prelude.Hashable ServerShortInfoResponse where
  hashWithSalt :: Int -> ServerShortInfoResponse -> Int
hashWithSalt Int
_salt ServerShortInfoResponse' {Maybe Text
serverName :: Maybe Text
serverId :: Maybe Text
ipAddress :: Maybe Text
$sel:serverName:ServerShortInfoResponse' :: ServerShortInfoResponse -> Maybe Text
$sel:serverId:ServerShortInfoResponse' :: ServerShortInfoResponse -> Maybe Text
$sel:ipAddress:ServerShortInfoResponse' :: ServerShortInfoResponse -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ipAddress
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
serverId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
serverName

instance Prelude.NFData ServerShortInfoResponse where
  rnf :: ServerShortInfoResponse -> ()
rnf ServerShortInfoResponse' {Maybe Text
serverName :: Maybe Text
serverId :: Maybe Text
ipAddress :: Maybe Text
$sel:serverName:ServerShortInfoResponse' :: ServerShortInfoResponse -> Maybe Text
$sel:serverId:ServerShortInfoResponse' :: ServerShortInfoResponse -> Maybe Text
$sel:ipAddress:ServerShortInfoResponse' :: ServerShortInfoResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ipAddress
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
serverId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
serverName