{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Discovery.ListServerNeighbors
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Retrieves a list of servers that are one network hop away from a
-- specified server.
module Amazonka.Discovery.ListServerNeighbors
  ( -- * Creating a Request
    ListServerNeighbors (..),
    newListServerNeighbors,

    -- * Request Lenses
    listServerNeighbors_maxResults,
    listServerNeighbors_neighborConfigurationIds,
    listServerNeighbors_nextToken,
    listServerNeighbors_portInformationNeeded,
    listServerNeighbors_configurationId,

    -- * Destructuring the Response
    ListServerNeighborsResponse (..),
    newListServerNeighborsResponse,

    -- * Response Lenses
    listServerNeighborsResponse_knownDependencyCount,
    listServerNeighborsResponse_nextToken,
    listServerNeighborsResponse_httpStatus,
    listServerNeighborsResponse_neighbors,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Discovery.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newListServerNeighbors' smart constructor.
data ListServerNeighbors = ListServerNeighbors'
  { -- | Maximum number of results to return in a single page of output.
    ListServerNeighbors -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int,
    -- | List of configuration IDs to test for one-hop-away.
    ListServerNeighbors -> Maybe [Text]
neighborConfigurationIds :: Prelude.Maybe [Prelude.Text],
    -- | Token to retrieve the next set of results. For example, if you
    -- previously specified 100 IDs for
    -- @ListServerNeighborsRequest$neighborConfigurationIds@ but set
    -- @ListServerNeighborsRequest$maxResults@ to 10, you received a set of 10
    -- results along with a token. Use that token in this query to get the next
    -- set of 10.
    ListServerNeighbors -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Flag to indicate if port and protocol information is needed as part of
    -- the response.
    ListServerNeighbors -> Maybe Bool
portInformationNeeded :: Prelude.Maybe Prelude.Bool,
    -- | Configuration ID of the server for which neighbors are being listed.
    ListServerNeighbors -> Text
configurationId :: Prelude.Text
  }
  deriving (ListServerNeighbors -> ListServerNeighbors -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListServerNeighbors -> ListServerNeighbors -> Bool
$c/= :: ListServerNeighbors -> ListServerNeighbors -> Bool
== :: ListServerNeighbors -> ListServerNeighbors -> Bool
$c== :: ListServerNeighbors -> ListServerNeighbors -> Bool
Prelude.Eq, ReadPrec [ListServerNeighbors]
ReadPrec ListServerNeighbors
Int -> ReadS ListServerNeighbors
ReadS [ListServerNeighbors]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListServerNeighbors]
$creadListPrec :: ReadPrec [ListServerNeighbors]
readPrec :: ReadPrec ListServerNeighbors
$creadPrec :: ReadPrec ListServerNeighbors
readList :: ReadS [ListServerNeighbors]
$creadList :: ReadS [ListServerNeighbors]
readsPrec :: Int -> ReadS ListServerNeighbors
$creadsPrec :: Int -> ReadS ListServerNeighbors
Prelude.Read, Int -> ListServerNeighbors -> ShowS
[ListServerNeighbors] -> ShowS
ListServerNeighbors -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListServerNeighbors] -> ShowS
$cshowList :: [ListServerNeighbors] -> ShowS
show :: ListServerNeighbors -> String
$cshow :: ListServerNeighbors -> String
showsPrec :: Int -> ListServerNeighbors -> ShowS
$cshowsPrec :: Int -> ListServerNeighbors -> ShowS
Prelude.Show, forall x. Rep ListServerNeighbors x -> ListServerNeighbors
forall x. ListServerNeighbors -> Rep ListServerNeighbors x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListServerNeighbors x -> ListServerNeighbors
$cfrom :: forall x. ListServerNeighbors -> Rep ListServerNeighbors x
Prelude.Generic)

-- |
-- Create a value of 'ListServerNeighbors' 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:
--
-- 'maxResults', 'listServerNeighbors_maxResults' - Maximum number of results to return in a single page of output.
--
-- 'neighborConfigurationIds', 'listServerNeighbors_neighborConfigurationIds' - List of configuration IDs to test for one-hop-away.
--
-- 'nextToken', 'listServerNeighbors_nextToken' - Token to retrieve the next set of results. For example, if you
-- previously specified 100 IDs for
-- @ListServerNeighborsRequest$neighborConfigurationIds@ but set
-- @ListServerNeighborsRequest$maxResults@ to 10, you received a set of 10
-- results along with a token. Use that token in this query to get the next
-- set of 10.
--
-- 'portInformationNeeded', 'listServerNeighbors_portInformationNeeded' - Flag to indicate if port and protocol information is needed as part of
-- the response.
--
-- 'configurationId', 'listServerNeighbors_configurationId' - Configuration ID of the server for which neighbors are being listed.
newListServerNeighbors ::
  -- | 'configurationId'
  Prelude.Text ->
  ListServerNeighbors
newListServerNeighbors :: Text -> ListServerNeighbors
newListServerNeighbors Text
pConfigurationId_ =
  ListServerNeighbors'
    { $sel:maxResults:ListServerNeighbors' :: Maybe Int
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:neighborConfigurationIds:ListServerNeighbors' :: Maybe [Text]
neighborConfigurationIds = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListServerNeighbors' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:portInformationNeeded:ListServerNeighbors' :: Maybe Bool
portInformationNeeded = forall a. Maybe a
Prelude.Nothing,
      $sel:configurationId:ListServerNeighbors' :: Text
configurationId = Text
pConfigurationId_
    }

-- | Maximum number of results to return in a single page of output.
listServerNeighbors_maxResults :: Lens.Lens' ListServerNeighbors (Prelude.Maybe Prelude.Int)
listServerNeighbors_maxResults :: Lens' ListServerNeighbors (Maybe Int)
listServerNeighbors_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListServerNeighbors' {Maybe Int
maxResults :: Maybe Int
$sel:maxResults:ListServerNeighbors' :: ListServerNeighbors -> Maybe Int
maxResults} -> Maybe Int
maxResults) (\s :: ListServerNeighbors
s@ListServerNeighbors' {} Maybe Int
a -> ListServerNeighbors
s {$sel:maxResults:ListServerNeighbors' :: Maybe Int
maxResults = Maybe Int
a} :: ListServerNeighbors)

-- | List of configuration IDs to test for one-hop-away.
listServerNeighbors_neighborConfigurationIds :: Lens.Lens' ListServerNeighbors (Prelude.Maybe [Prelude.Text])
listServerNeighbors_neighborConfigurationIds :: Lens' ListServerNeighbors (Maybe [Text])
listServerNeighbors_neighborConfigurationIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListServerNeighbors' {Maybe [Text]
neighborConfigurationIds :: Maybe [Text]
$sel:neighborConfigurationIds:ListServerNeighbors' :: ListServerNeighbors -> Maybe [Text]
neighborConfigurationIds} -> Maybe [Text]
neighborConfigurationIds) (\s :: ListServerNeighbors
s@ListServerNeighbors' {} Maybe [Text]
a -> ListServerNeighbors
s {$sel:neighborConfigurationIds:ListServerNeighbors' :: Maybe [Text]
neighborConfigurationIds = Maybe [Text]
a} :: ListServerNeighbors) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Token to retrieve the next set of results. For example, if you
-- previously specified 100 IDs for
-- @ListServerNeighborsRequest$neighborConfigurationIds@ but set
-- @ListServerNeighborsRequest$maxResults@ to 10, you received a set of 10
-- results along with a token. Use that token in this query to get the next
-- set of 10.
listServerNeighbors_nextToken :: Lens.Lens' ListServerNeighbors (Prelude.Maybe Prelude.Text)
listServerNeighbors_nextToken :: Lens' ListServerNeighbors (Maybe Text)
listServerNeighbors_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListServerNeighbors' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListServerNeighbors' :: ListServerNeighbors -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListServerNeighbors
s@ListServerNeighbors' {} Maybe Text
a -> ListServerNeighbors
s {$sel:nextToken:ListServerNeighbors' :: Maybe Text
nextToken = Maybe Text
a} :: ListServerNeighbors)

-- | Flag to indicate if port and protocol information is needed as part of
-- the response.
listServerNeighbors_portInformationNeeded :: Lens.Lens' ListServerNeighbors (Prelude.Maybe Prelude.Bool)
listServerNeighbors_portInformationNeeded :: Lens' ListServerNeighbors (Maybe Bool)
listServerNeighbors_portInformationNeeded = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListServerNeighbors' {Maybe Bool
portInformationNeeded :: Maybe Bool
$sel:portInformationNeeded:ListServerNeighbors' :: ListServerNeighbors -> Maybe Bool
portInformationNeeded} -> Maybe Bool
portInformationNeeded) (\s :: ListServerNeighbors
s@ListServerNeighbors' {} Maybe Bool
a -> ListServerNeighbors
s {$sel:portInformationNeeded:ListServerNeighbors' :: Maybe Bool
portInformationNeeded = Maybe Bool
a} :: ListServerNeighbors)

-- | Configuration ID of the server for which neighbors are being listed.
listServerNeighbors_configurationId :: Lens.Lens' ListServerNeighbors Prelude.Text
listServerNeighbors_configurationId :: Lens' ListServerNeighbors Text
listServerNeighbors_configurationId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListServerNeighbors' {Text
configurationId :: Text
$sel:configurationId:ListServerNeighbors' :: ListServerNeighbors -> Text
configurationId} -> Text
configurationId) (\s :: ListServerNeighbors
s@ListServerNeighbors' {} Text
a -> ListServerNeighbors
s {$sel:configurationId:ListServerNeighbors' :: Text
configurationId = Text
a} :: ListServerNeighbors)

instance Core.AWSRequest ListServerNeighbors where
  type
    AWSResponse ListServerNeighbors =
      ListServerNeighborsResponse
  request :: (Service -> Service)
-> ListServerNeighbors -> Request ListServerNeighbors
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListServerNeighbors
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListServerNeighbors)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Integer
-> Maybe Text
-> Int
-> [NeighborConnectionDetail]
-> ListServerNeighborsResponse
ListServerNeighborsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"knownDependencyCount")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"nextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"neighbors" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable ListServerNeighbors where
  hashWithSalt :: Int -> ListServerNeighbors -> Int
hashWithSalt Int
_salt ListServerNeighbors' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe Text
Text
configurationId :: Text
portInformationNeeded :: Maybe Bool
nextToken :: Maybe Text
neighborConfigurationIds :: Maybe [Text]
maxResults :: Maybe Int
$sel:configurationId:ListServerNeighbors' :: ListServerNeighbors -> Text
$sel:portInformationNeeded:ListServerNeighbors' :: ListServerNeighbors -> Maybe Bool
$sel:nextToken:ListServerNeighbors' :: ListServerNeighbors -> Maybe Text
$sel:neighborConfigurationIds:ListServerNeighbors' :: ListServerNeighbors -> Maybe [Text]
$sel:maxResults:ListServerNeighbors' :: ListServerNeighbors -> Maybe Int
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
neighborConfigurationIds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
portInformationNeeded
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
configurationId

instance Prelude.NFData ListServerNeighbors where
  rnf :: ListServerNeighbors -> ()
rnf ListServerNeighbors' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe Text
Text
configurationId :: Text
portInformationNeeded :: Maybe Bool
nextToken :: Maybe Text
neighborConfigurationIds :: Maybe [Text]
maxResults :: Maybe Int
$sel:configurationId:ListServerNeighbors' :: ListServerNeighbors -> Text
$sel:portInformationNeeded:ListServerNeighbors' :: ListServerNeighbors -> Maybe Bool
$sel:nextToken:ListServerNeighbors' :: ListServerNeighbors -> Maybe Text
$sel:neighborConfigurationIds:ListServerNeighbors' :: ListServerNeighbors -> Maybe [Text]
$sel:maxResults:ListServerNeighbors' :: ListServerNeighbors -> Maybe Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
neighborConfigurationIds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
portInformationNeeded
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
configurationId

instance Data.ToHeaders ListServerNeighbors where
  toHeaders :: ListServerNeighbors -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AWSPoseidonService_V2015_11_01.ListServerNeighbors" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON ListServerNeighbors where
  toJSON :: ListServerNeighbors -> Value
toJSON ListServerNeighbors' {Maybe Bool
Maybe Int
Maybe [Text]
Maybe Text
Text
configurationId :: Text
portInformationNeeded :: Maybe Bool
nextToken :: Maybe Text
neighborConfigurationIds :: Maybe [Text]
maxResults :: Maybe Int
$sel:configurationId:ListServerNeighbors' :: ListServerNeighbors -> Text
$sel:portInformationNeeded:ListServerNeighbors' :: ListServerNeighbors -> Maybe Bool
$sel:nextToken:ListServerNeighbors' :: ListServerNeighbors -> Maybe Text
$sel:neighborConfigurationIds:ListServerNeighbors' :: ListServerNeighbors -> Maybe [Text]
$sel:maxResults:ListServerNeighbors' :: ListServerNeighbors -> Maybe Int
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"maxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
maxResults,
            (Key
"neighborConfigurationIds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
neighborConfigurationIds,
            (Key
"nextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Key
"portInformationNeeded" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
portInformationNeeded,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"configurationId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
configurationId)
          ]
      )

instance Data.ToPath ListServerNeighbors where
  toPath :: ListServerNeighbors -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery ListServerNeighbors where
  toQuery :: ListServerNeighbors -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newListServerNeighborsResponse' smart constructor.
data ListServerNeighborsResponse = ListServerNeighborsResponse'
  { -- | Count of distinct servers that are one hop away from the given server.
    ListServerNeighborsResponse -> Maybe Integer
knownDependencyCount :: Prelude.Maybe Prelude.Integer,
    -- | Token to retrieve the next set of results. For example, if you specified
    -- 100 IDs for @ListServerNeighborsRequest$neighborConfigurationIds@ but
    -- set @ListServerNeighborsRequest$maxResults@ to 10, you received a set of
    -- 10 results along with this token. Use this token in the next query to
    -- retrieve the next set of 10.
    ListServerNeighborsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListServerNeighborsResponse -> Int
httpStatus :: Prelude.Int,
    -- | List of distinct servers that are one hop away from the given server.
    ListServerNeighborsResponse -> [NeighborConnectionDetail]
neighbors :: [NeighborConnectionDetail]
  }
  deriving (ListServerNeighborsResponse -> ListServerNeighborsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListServerNeighborsResponse -> ListServerNeighborsResponse -> Bool
$c/= :: ListServerNeighborsResponse -> ListServerNeighborsResponse -> Bool
== :: ListServerNeighborsResponse -> ListServerNeighborsResponse -> Bool
$c== :: ListServerNeighborsResponse -> ListServerNeighborsResponse -> Bool
Prelude.Eq, ReadPrec [ListServerNeighborsResponse]
ReadPrec ListServerNeighborsResponse
Int -> ReadS ListServerNeighborsResponse
ReadS [ListServerNeighborsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListServerNeighborsResponse]
$creadListPrec :: ReadPrec [ListServerNeighborsResponse]
readPrec :: ReadPrec ListServerNeighborsResponse
$creadPrec :: ReadPrec ListServerNeighborsResponse
readList :: ReadS [ListServerNeighborsResponse]
$creadList :: ReadS [ListServerNeighborsResponse]
readsPrec :: Int -> ReadS ListServerNeighborsResponse
$creadsPrec :: Int -> ReadS ListServerNeighborsResponse
Prelude.Read, Int -> ListServerNeighborsResponse -> ShowS
[ListServerNeighborsResponse] -> ShowS
ListServerNeighborsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListServerNeighborsResponse] -> ShowS
$cshowList :: [ListServerNeighborsResponse] -> ShowS
show :: ListServerNeighborsResponse -> String
$cshow :: ListServerNeighborsResponse -> String
showsPrec :: Int -> ListServerNeighborsResponse -> ShowS
$cshowsPrec :: Int -> ListServerNeighborsResponse -> ShowS
Prelude.Show, forall x.
Rep ListServerNeighborsResponse x -> ListServerNeighborsResponse
forall x.
ListServerNeighborsResponse -> Rep ListServerNeighborsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListServerNeighborsResponse x -> ListServerNeighborsResponse
$cfrom :: forall x.
ListServerNeighborsResponse -> Rep ListServerNeighborsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListServerNeighborsResponse' 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:
--
-- 'knownDependencyCount', 'listServerNeighborsResponse_knownDependencyCount' - Count of distinct servers that are one hop away from the given server.
--
-- 'nextToken', 'listServerNeighborsResponse_nextToken' - Token to retrieve the next set of results. For example, if you specified
-- 100 IDs for @ListServerNeighborsRequest$neighborConfigurationIds@ but
-- set @ListServerNeighborsRequest$maxResults@ to 10, you received a set of
-- 10 results along with this token. Use this token in the next query to
-- retrieve the next set of 10.
--
-- 'httpStatus', 'listServerNeighborsResponse_httpStatus' - The response's http status code.
--
-- 'neighbors', 'listServerNeighborsResponse_neighbors' - List of distinct servers that are one hop away from the given server.
newListServerNeighborsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListServerNeighborsResponse
newListServerNeighborsResponse :: Int -> ListServerNeighborsResponse
newListServerNeighborsResponse Int
pHttpStatus_ =
  ListServerNeighborsResponse'
    { $sel:knownDependencyCount:ListServerNeighborsResponse' :: Maybe Integer
knownDependencyCount =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListServerNeighborsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListServerNeighborsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:neighbors:ListServerNeighborsResponse' :: [NeighborConnectionDetail]
neighbors = forall a. Monoid a => a
Prelude.mempty
    }

-- | Count of distinct servers that are one hop away from the given server.
listServerNeighborsResponse_knownDependencyCount :: Lens.Lens' ListServerNeighborsResponse (Prelude.Maybe Prelude.Integer)
listServerNeighborsResponse_knownDependencyCount :: Lens' ListServerNeighborsResponse (Maybe Integer)
listServerNeighborsResponse_knownDependencyCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListServerNeighborsResponse' {Maybe Integer
knownDependencyCount :: Maybe Integer
$sel:knownDependencyCount:ListServerNeighborsResponse' :: ListServerNeighborsResponse -> Maybe Integer
knownDependencyCount} -> Maybe Integer
knownDependencyCount) (\s :: ListServerNeighborsResponse
s@ListServerNeighborsResponse' {} Maybe Integer
a -> ListServerNeighborsResponse
s {$sel:knownDependencyCount:ListServerNeighborsResponse' :: Maybe Integer
knownDependencyCount = Maybe Integer
a} :: ListServerNeighborsResponse)

-- | Token to retrieve the next set of results. For example, if you specified
-- 100 IDs for @ListServerNeighborsRequest$neighborConfigurationIds@ but
-- set @ListServerNeighborsRequest$maxResults@ to 10, you received a set of
-- 10 results along with this token. Use this token in the next query to
-- retrieve the next set of 10.
listServerNeighborsResponse_nextToken :: Lens.Lens' ListServerNeighborsResponse (Prelude.Maybe Prelude.Text)
listServerNeighborsResponse_nextToken :: Lens' ListServerNeighborsResponse (Maybe Text)
listServerNeighborsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListServerNeighborsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListServerNeighborsResponse' :: ListServerNeighborsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListServerNeighborsResponse
s@ListServerNeighborsResponse' {} Maybe Text
a -> ListServerNeighborsResponse
s {$sel:nextToken:ListServerNeighborsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListServerNeighborsResponse)

-- | The response's http status code.
listServerNeighborsResponse_httpStatus :: Lens.Lens' ListServerNeighborsResponse Prelude.Int
listServerNeighborsResponse_httpStatus :: Lens' ListServerNeighborsResponse Int
listServerNeighborsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListServerNeighborsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListServerNeighborsResponse' :: ListServerNeighborsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListServerNeighborsResponse
s@ListServerNeighborsResponse' {} Int
a -> ListServerNeighborsResponse
s {$sel:httpStatus:ListServerNeighborsResponse' :: Int
httpStatus = Int
a} :: ListServerNeighborsResponse)

-- | List of distinct servers that are one hop away from the given server.
listServerNeighborsResponse_neighbors :: Lens.Lens' ListServerNeighborsResponse [NeighborConnectionDetail]
listServerNeighborsResponse_neighbors :: Lens' ListServerNeighborsResponse [NeighborConnectionDetail]
listServerNeighborsResponse_neighbors = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListServerNeighborsResponse' {[NeighborConnectionDetail]
neighbors :: [NeighborConnectionDetail]
$sel:neighbors:ListServerNeighborsResponse' :: ListServerNeighborsResponse -> [NeighborConnectionDetail]
neighbors} -> [NeighborConnectionDetail]
neighbors) (\s :: ListServerNeighborsResponse
s@ListServerNeighborsResponse' {} [NeighborConnectionDetail]
a -> ListServerNeighborsResponse
s {$sel:neighbors:ListServerNeighborsResponse' :: [NeighborConnectionDetail]
neighbors = [NeighborConnectionDetail]
a} :: ListServerNeighborsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListServerNeighborsResponse where
  rnf :: ListServerNeighborsResponse -> ()
rnf ListServerNeighborsResponse' {Int
[NeighborConnectionDetail]
Maybe Integer
Maybe Text
neighbors :: [NeighborConnectionDetail]
httpStatus :: Int
nextToken :: Maybe Text
knownDependencyCount :: Maybe Integer
$sel:neighbors:ListServerNeighborsResponse' :: ListServerNeighborsResponse -> [NeighborConnectionDetail]
$sel:httpStatus:ListServerNeighborsResponse' :: ListServerNeighborsResponse -> Int
$sel:nextToken:ListServerNeighborsResponse' :: ListServerNeighborsResponse -> Maybe Text
$sel:knownDependencyCount:ListServerNeighborsResponse' :: ListServerNeighborsResponse -> Maybe Integer
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
knownDependencyCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [NeighborConnectionDetail]
neighbors