{-# 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-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)
--
-- 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_portInformationNeeded,
    listServerNeighbors_neighborConfigurationIds,
    listServerNeighbors_nextToken,
    listServerNeighbors_maxResults,
    listServerNeighbors_configurationId,

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

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

import qualified Amazonka.Core as Core
import Amazonka.Discovery.Types
import qualified Amazonka.Lens as Lens
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'
  { -- | Flag to indicate if port and protocol information is needed as part of
    -- the response.
    ListServerNeighbors -> Maybe Bool
portInformationNeeded :: Prelude.Maybe Prelude.Bool,
    -- | 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,
    -- | Maximum number of results to return in a single page of output.
    ListServerNeighbors -> Maybe Int
maxResults :: Prelude.Maybe Prelude.Int,
    -- | Configuration ID of the server for which neighbors are being listed.
    ListServerNeighbors -> Text
configurationId :: Prelude.Text
  }
  deriving (ListServerNeighbors -> ListServerNeighbors -> Bool
(ListServerNeighbors -> ListServerNeighbors -> Bool)
-> (ListServerNeighbors -> ListServerNeighbors -> Bool)
-> Eq ListServerNeighbors
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]
(Int -> ReadS ListServerNeighbors)
-> ReadS [ListServerNeighbors]
-> ReadPrec ListServerNeighbors
-> ReadPrec [ListServerNeighbors]
-> Read 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
(Int -> ListServerNeighbors -> ShowS)
-> (ListServerNeighbors -> String)
-> ([ListServerNeighbors] -> ShowS)
-> Show ListServerNeighbors
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. ListServerNeighbors -> Rep ListServerNeighbors x)
-> (forall x. Rep ListServerNeighbors x -> ListServerNeighbors)
-> Generic ListServerNeighbors
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:
--
-- 'portInformationNeeded', 'listServerNeighbors_portInformationNeeded' - Flag to indicate if port and protocol information is needed as part of
-- the response.
--
-- '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.
--
-- 'maxResults', 'listServerNeighbors_maxResults' - Maximum number of results to return in a single page of output.
--
-- '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' :: Maybe Bool
-> Maybe [Text]
-> Maybe Text
-> Maybe Int
-> Text
-> ListServerNeighbors
ListServerNeighbors'
    { $sel:portInformationNeeded:ListServerNeighbors' :: Maybe Bool
portInformationNeeded =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:neighborConfigurationIds:ListServerNeighbors' :: Maybe [Text]
neighborConfigurationIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListServerNeighbors' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListServerNeighbors' :: Maybe Int
maxResults = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:configurationId:ListServerNeighbors' :: Text
configurationId = Text
pConfigurationId_
    }

-- | 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 :: (Maybe Bool -> f (Maybe Bool))
-> ListServerNeighbors -> f ListServerNeighbors
listServerNeighbors_portInformationNeeded = (ListServerNeighbors -> Maybe Bool)
-> (ListServerNeighbors -> Maybe Bool -> ListServerNeighbors)
-> Lens
     ListServerNeighbors ListServerNeighbors (Maybe Bool) (Maybe Bool)
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)

-- | List of configuration IDs to test for one-hop-away.
listServerNeighbors_neighborConfigurationIds :: Lens.Lens' ListServerNeighbors (Prelude.Maybe [Prelude.Text])
listServerNeighbors_neighborConfigurationIds :: (Maybe [Text] -> f (Maybe [Text]))
-> ListServerNeighbors -> f ListServerNeighbors
listServerNeighbors_neighborConfigurationIds = (ListServerNeighbors -> Maybe [Text])
-> (ListServerNeighbors -> Maybe [Text] -> ListServerNeighbors)
-> Lens
     ListServerNeighbors
     ListServerNeighbors
     (Maybe [Text])
     (Maybe [Text])
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) ((Maybe [Text] -> f (Maybe [Text]))
 -> ListServerNeighbors -> f ListServerNeighbors)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ListServerNeighbors
-> f ListServerNeighbors
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
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 :: (Maybe Text -> f (Maybe Text))
-> ListServerNeighbors -> f ListServerNeighbors
listServerNeighbors_nextToken = (ListServerNeighbors -> Maybe Text)
-> (ListServerNeighbors -> Maybe Text -> ListServerNeighbors)
-> Lens
     ListServerNeighbors ListServerNeighbors (Maybe Text) (Maybe Text)
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)

-- | Maximum number of results to return in a single page of output.
listServerNeighbors_maxResults :: Lens.Lens' ListServerNeighbors (Prelude.Maybe Prelude.Int)
listServerNeighbors_maxResults :: (Maybe Int -> f (Maybe Int))
-> ListServerNeighbors -> f ListServerNeighbors
listServerNeighbors_maxResults = (ListServerNeighbors -> Maybe Int)
-> (ListServerNeighbors -> Maybe Int -> ListServerNeighbors)
-> Lens
     ListServerNeighbors ListServerNeighbors (Maybe Int) (Maybe Int)
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)

-- | Configuration ID of the server for which neighbors are being listed.
listServerNeighbors_configurationId :: Lens.Lens' ListServerNeighbors Prelude.Text
listServerNeighbors_configurationId :: (Text -> f Text) -> ListServerNeighbors -> f ListServerNeighbors
listServerNeighbors_configurationId = (ListServerNeighbors -> Text)
-> (ListServerNeighbors -> Text -> ListServerNeighbors)
-> Lens ListServerNeighbors ListServerNeighbors Text Text
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 :: ListServerNeighbors -> Request ListServerNeighbors
request = Service -> ListServerNeighbors -> Request ListServerNeighbors
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ListServerNeighbors
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListServerNeighbors)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListServerNeighbors))
-> Logger
-> Service
-> Proxy ListServerNeighbors
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ListServerNeighbors)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe Integer
-> Int
-> [NeighborConnectionDetail]
-> ListServerNeighborsResponse
ListServerNeighborsResponse'
            (Maybe Text
 -> Maybe Integer
 -> Int
 -> [NeighborConnectionDetail]
 -> ListServerNeighborsResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Integer
      -> Int
      -> [NeighborConnectionDetail]
      -> ListServerNeighborsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"nextToken")
            Either
  String
  (Maybe Integer
   -> Int
   -> [NeighborConnectionDetail]
   -> ListServerNeighborsResponse)
-> Either String (Maybe Integer)
-> Either
     String
     (Int -> [NeighborConnectionDetail] -> ListServerNeighborsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"knownDependencyCount")
            Either
  String
  (Int -> [NeighborConnectionDetail] -> ListServerNeighborsResponse)
-> Either String Int
-> Either
     String ([NeighborConnectionDetail] -> ListServerNeighborsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            Either
  String ([NeighborConnectionDetail] -> ListServerNeighborsResponse)
-> Either String [NeighborConnectionDetail]
-> Either String ListServerNeighborsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe [NeighborConnectionDetail])
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"neighbors" Either String (Maybe [NeighborConnectionDetail])
-> [NeighborConnectionDetail]
-> Either String [NeighborConnectionDetail]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [NeighborConnectionDetail]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable ListServerNeighbors

instance Prelude.NFData ListServerNeighbors

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

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

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

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

-- | /See:/ 'newListServerNeighborsResponse' smart constructor.
data ListServerNeighborsResponse = 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 -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Count of distinct servers that are one hop away from the given server.
    ListServerNeighborsResponse -> Maybe Integer
knownDependencyCount :: Prelude.Maybe Prelude.Integer,
    -- | 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
(ListServerNeighborsResponse
 -> ListServerNeighborsResponse -> Bool)
-> (ListServerNeighborsResponse
    -> ListServerNeighborsResponse -> Bool)
-> Eq ListServerNeighborsResponse
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]
(Int -> ReadS ListServerNeighborsResponse)
-> ReadS [ListServerNeighborsResponse]
-> ReadPrec ListServerNeighborsResponse
-> ReadPrec [ListServerNeighborsResponse]
-> Read 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
(Int -> ListServerNeighborsResponse -> ShowS)
-> (ListServerNeighborsResponse -> String)
-> ([ListServerNeighborsResponse] -> ShowS)
-> Show ListServerNeighborsResponse
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.
 ListServerNeighborsResponse -> Rep ListServerNeighborsResponse x)
-> (forall x.
    Rep ListServerNeighborsResponse x -> ListServerNeighborsResponse)
-> Generic ListServerNeighborsResponse
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:
--
-- '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.
--
-- 'knownDependencyCount', 'listServerNeighborsResponse_knownDependencyCount' - Count of distinct servers that are one hop away from the given server.
--
-- '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' :: Maybe Text
-> Maybe Integer
-> Int
-> [NeighborConnectionDetail]
-> ListServerNeighborsResponse
ListServerNeighborsResponse'
    { $sel:nextToken:ListServerNeighborsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:knownDependencyCount:ListServerNeighborsResponse' :: Maybe Integer
knownDependencyCount = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListServerNeighborsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:neighbors:ListServerNeighborsResponse' :: [NeighborConnectionDetail]
neighbors = [NeighborConnectionDetail]
forall a. Monoid a => a
Prelude.mempty
    }

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> ListServerNeighborsResponse -> f ListServerNeighborsResponse
listServerNeighborsResponse_nextToken = (ListServerNeighborsResponse -> Maybe Text)
-> (ListServerNeighborsResponse
    -> Maybe Text -> ListServerNeighborsResponse)
-> Lens
     ListServerNeighborsResponse
     ListServerNeighborsResponse
     (Maybe Text)
     (Maybe Text)
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)

-- | Count of distinct servers that are one hop away from the given server.
listServerNeighborsResponse_knownDependencyCount :: Lens.Lens' ListServerNeighborsResponse (Prelude.Maybe Prelude.Integer)
listServerNeighborsResponse_knownDependencyCount :: (Maybe Integer -> f (Maybe Integer))
-> ListServerNeighborsResponse -> f ListServerNeighborsResponse
listServerNeighborsResponse_knownDependencyCount = (ListServerNeighborsResponse -> Maybe Integer)
-> (ListServerNeighborsResponse
    -> Maybe Integer -> ListServerNeighborsResponse)
-> Lens
     ListServerNeighborsResponse
     ListServerNeighborsResponse
     (Maybe Integer)
     (Maybe Integer)
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)

-- | The response's http status code.
listServerNeighborsResponse_httpStatus :: Lens.Lens' ListServerNeighborsResponse Prelude.Int
listServerNeighborsResponse_httpStatus :: (Int -> f Int)
-> ListServerNeighborsResponse -> f ListServerNeighborsResponse
listServerNeighborsResponse_httpStatus = (ListServerNeighborsResponse -> Int)
-> (ListServerNeighborsResponse
    -> Int -> ListServerNeighborsResponse)
-> Lens
     ListServerNeighborsResponse ListServerNeighborsResponse Int Int
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 :: ([NeighborConnectionDetail] -> f [NeighborConnectionDetail])
-> ListServerNeighborsResponse -> f ListServerNeighborsResponse
listServerNeighborsResponse_neighbors = (ListServerNeighborsResponse -> [NeighborConnectionDetail])
-> (ListServerNeighborsResponse
    -> [NeighborConnectionDetail] -> ListServerNeighborsResponse)
-> Lens
     ListServerNeighborsResponse
     ListServerNeighborsResponse
     [NeighborConnectionDetail]
     [NeighborConnectionDetail]
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) (([NeighborConnectionDetail] -> f [NeighborConnectionDetail])
 -> ListServerNeighborsResponse -> f ListServerNeighborsResponse)
-> (([NeighborConnectionDetail] -> f [NeighborConnectionDetail])
    -> [NeighborConnectionDetail] -> f [NeighborConnectionDetail])
-> ([NeighborConnectionDetail] -> f [NeighborConnectionDetail])
-> ListServerNeighborsResponse
-> f ListServerNeighborsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([NeighborConnectionDetail] -> f [NeighborConnectionDetail])
-> [NeighborConnectionDetail] -> f [NeighborConnectionDetail]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData ListServerNeighborsResponse