{-# 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.NetworkManager.GetConnections
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Gets information about one or more of your connections in a global
-- network.
--
-- This operation returns paginated results.
module Amazonka.NetworkManager.GetConnections
  ( -- * Creating a Request
    GetConnections (..),
    newGetConnections,

    -- * Request Lenses
    getConnections_connectionIds,
    getConnections_deviceId,
    getConnections_maxResults,
    getConnections_nextToken,
    getConnections_globalNetworkId,

    -- * Destructuring the Response
    GetConnectionsResponse (..),
    newGetConnectionsResponse,

    -- * Response Lenses
    getConnectionsResponse_connections,
    getConnectionsResponse_nextToken,
    getConnectionsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newGetConnections' smart constructor.
data GetConnections = GetConnections'
  { -- | One or more connection IDs.
    GetConnections -> Maybe [Text]
connectionIds :: Prelude.Maybe [Prelude.Text],
    -- | The ID of the device.
    GetConnections -> Maybe Text
deviceId :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return.
    GetConnections -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | The token for the next page of results.
    GetConnections -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The ID of the global network.
    GetConnections -> Text
globalNetworkId :: Prelude.Text
  }
  deriving (GetConnections -> GetConnections -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetConnections -> GetConnections -> Bool
$c/= :: GetConnections -> GetConnections -> Bool
== :: GetConnections -> GetConnections -> Bool
$c== :: GetConnections -> GetConnections -> Bool
Prelude.Eq, ReadPrec [GetConnections]
ReadPrec GetConnections
Int -> ReadS GetConnections
ReadS [GetConnections]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetConnections]
$creadListPrec :: ReadPrec [GetConnections]
readPrec :: ReadPrec GetConnections
$creadPrec :: ReadPrec GetConnections
readList :: ReadS [GetConnections]
$creadList :: ReadS [GetConnections]
readsPrec :: Int -> ReadS GetConnections
$creadsPrec :: Int -> ReadS GetConnections
Prelude.Read, Int -> GetConnections -> ShowS
[GetConnections] -> ShowS
GetConnections -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetConnections] -> ShowS
$cshowList :: [GetConnections] -> ShowS
show :: GetConnections -> String
$cshow :: GetConnections -> String
showsPrec :: Int -> GetConnections -> ShowS
$cshowsPrec :: Int -> GetConnections -> ShowS
Prelude.Show, forall x. Rep GetConnections x -> GetConnections
forall x. GetConnections -> Rep GetConnections x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetConnections x -> GetConnections
$cfrom :: forall x. GetConnections -> Rep GetConnections x
Prelude.Generic)

-- |
-- Create a value of 'GetConnections' 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:
--
-- 'connectionIds', 'getConnections_connectionIds' - One or more connection IDs.
--
-- 'deviceId', 'getConnections_deviceId' - The ID of the device.
--
-- 'maxResults', 'getConnections_maxResults' - The maximum number of results to return.
--
-- 'nextToken', 'getConnections_nextToken' - The token for the next page of results.
--
-- 'globalNetworkId', 'getConnections_globalNetworkId' - The ID of the global network.
newGetConnections ::
  -- | 'globalNetworkId'
  Prelude.Text ->
  GetConnections
newGetConnections :: Text -> GetConnections
newGetConnections Text
pGlobalNetworkId_ =
  GetConnections'
    { $sel:connectionIds:GetConnections' :: Maybe [Text]
connectionIds = forall a. Maybe a
Prelude.Nothing,
      $sel:deviceId:GetConnections' :: Maybe Text
deviceId = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetConnections' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetConnections' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:globalNetworkId:GetConnections' :: Text
globalNetworkId = Text
pGlobalNetworkId_
    }

-- | One or more connection IDs.
getConnections_connectionIds :: Lens.Lens' GetConnections (Prelude.Maybe [Prelude.Text])
getConnections_connectionIds :: Lens' GetConnections (Maybe [Text])
getConnections_connectionIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetConnections' {Maybe [Text]
connectionIds :: Maybe [Text]
$sel:connectionIds:GetConnections' :: GetConnections -> Maybe [Text]
connectionIds} -> Maybe [Text]
connectionIds) (\s :: GetConnections
s@GetConnections' {} Maybe [Text]
a -> GetConnections
s {$sel:connectionIds:GetConnections' :: Maybe [Text]
connectionIds = Maybe [Text]
a} :: GetConnections) 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

-- | The ID of the device.
getConnections_deviceId :: Lens.Lens' GetConnections (Prelude.Maybe Prelude.Text)
getConnections_deviceId :: Lens' GetConnections (Maybe Text)
getConnections_deviceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetConnections' {Maybe Text
deviceId :: Maybe Text
$sel:deviceId:GetConnections' :: GetConnections -> Maybe Text
deviceId} -> Maybe Text
deviceId) (\s :: GetConnections
s@GetConnections' {} Maybe Text
a -> GetConnections
s {$sel:deviceId:GetConnections' :: Maybe Text
deviceId = Maybe Text
a} :: GetConnections)

-- | The maximum number of results to return.
getConnections_maxResults :: Lens.Lens' GetConnections (Prelude.Maybe Prelude.Natural)
getConnections_maxResults :: Lens' GetConnections (Maybe Natural)
getConnections_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetConnections' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:GetConnections' :: GetConnections -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: GetConnections
s@GetConnections' {} Maybe Natural
a -> GetConnections
s {$sel:maxResults:GetConnections' :: Maybe Natural
maxResults = Maybe Natural
a} :: GetConnections)

-- | The token for the next page of results.
getConnections_nextToken :: Lens.Lens' GetConnections (Prelude.Maybe Prelude.Text)
getConnections_nextToken :: Lens' GetConnections (Maybe Text)
getConnections_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetConnections' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetConnections' :: GetConnections -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetConnections
s@GetConnections' {} Maybe Text
a -> GetConnections
s {$sel:nextToken:GetConnections' :: Maybe Text
nextToken = Maybe Text
a} :: GetConnections)

-- | The ID of the global network.
getConnections_globalNetworkId :: Lens.Lens' GetConnections Prelude.Text
getConnections_globalNetworkId :: Lens' GetConnections Text
getConnections_globalNetworkId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetConnections' {Text
globalNetworkId :: Text
$sel:globalNetworkId:GetConnections' :: GetConnections -> Text
globalNetworkId} -> Text
globalNetworkId) (\s :: GetConnections
s@GetConnections' {} Text
a -> GetConnections
s {$sel:globalNetworkId:GetConnections' :: Text
globalNetworkId = Text
a} :: GetConnections)

instance Core.AWSPager GetConnections where
  page :: GetConnections
-> AWSResponse GetConnections -> Maybe GetConnections
page GetConnections
rq AWSResponse GetConnections
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetConnections
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetConnectionsResponse (Maybe Text)
getConnectionsResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetConnections
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetConnectionsResponse (Maybe [Connection])
getConnectionsResponse_connections
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ GetConnections
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' GetConnections (Maybe Text)
getConnections_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetConnections
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetConnectionsResponse (Maybe Text)
getConnectionsResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest GetConnections where
  type
    AWSResponse GetConnections =
      GetConnectionsResponse
  request :: (Service -> Service) -> GetConnections -> Request GetConnections
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy GetConnections
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetConnections)))
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 [Connection] -> Maybe Text -> Int -> GetConnectionsResponse
GetConnectionsResponse'
            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
"Connections" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            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))
      )

instance Prelude.Hashable GetConnections where
  hashWithSalt :: Int -> GetConnections -> Int
hashWithSalt Int
_salt GetConnections' {Maybe Natural
Maybe [Text]
Maybe Text
Text
globalNetworkId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
deviceId :: Maybe Text
connectionIds :: Maybe [Text]
$sel:globalNetworkId:GetConnections' :: GetConnections -> Text
$sel:nextToken:GetConnections' :: GetConnections -> Maybe Text
$sel:maxResults:GetConnections' :: GetConnections -> Maybe Natural
$sel:deviceId:GetConnections' :: GetConnections -> Maybe Text
$sel:connectionIds:GetConnections' :: GetConnections -> Maybe [Text]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
connectionIds
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
deviceId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
globalNetworkId

instance Prelude.NFData GetConnections where
  rnf :: GetConnections -> ()
rnf GetConnections' {Maybe Natural
Maybe [Text]
Maybe Text
Text
globalNetworkId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
deviceId :: Maybe Text
connectionIds :: Maybe [Text]
$sel:globalNetworkId:GetConnections' :: GetConnections -> Text
$sel:nextToken:GetConnections' :: GetConnections -> Maybe Text
$sel:maxResults:GetConnections' :: GetConnections -> Maybe Natural
$sel:deviceId:GetConnections' :: GetConnections -> Maybe Text
$sel:connectionIds:GetConnections' :: GetConnections -> Maybe [Text]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
connectionIds
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
deviceId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      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 Text
globalNetworkId

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

instance Data.ToPath GetConnections where
  toPath :: GetConnections -> ByteString
toPath GetConnections' {Maybe Natural
Maybe [Text]
Maybe Text
Text
globalNetworkId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
deviceId :: Maybe Text
connectionIds :: Maybe [Text]
$sel:globalNetworkId:GetConnections' :: GetConnections -> Text
$sel:nextToken:GetConnections' :: GetConnections -> Maybe Text
$sel:maxResults:GetConnections' :: GetConnections -> Maybe Natural
$sel:deviceId:GetConnections' :: GetConnections -> Maybe Text
$sel:connectionIds:GetConnections' :: GetConnections -> Maybe [Text]
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/global-networks/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
globalNetworkId,
        ByteString
"/connections"
      ]

instance Data.ToQuery GetConnections where
  toQuery :: GetConnections -> QueryString
toQuery GetConnections' {Maybe Natural
Maybe [Text]
Maybe Text
Text
globalNetworkId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
deviceId :: Maybe Text
connectionIds :: Maybe [Text]
$sel:globalNetworkId:GetConnections' :: GetConnections -> Text
$sel:nextToken:GetConnections' :: GetConnections -> Maybe Text
$sel:maxResults:GetConnections' :: GetConnections -> Maybe Natural
$sel:deviceId:GetConnections' :: GetConnections -> Maybe Text
$sel:connectionIds:GetConnections' :: GetConnections -> Maybe [Text]
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"connectionIds"
          forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a. ToQuery a => a -> QueryString
Data.toQuery
            ( forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member"
                forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
connectionIds
            ),
        ByteString
"deviceId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
deviceId,
        ByteString
"maxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
        ByteString
"nextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
      ]

-- | /See:/ 'newGetConnectionsResponse' smart constructor.
data GetConnectionsResponse = GetConnectionsResponse'
  { -- | Information about the connections.
    GetConnectionsResponse -> Maybe [Connection]
connections :: Prelude.Maybe [Connection],
    -- | The token to use for the next page of results.
    GetConnectionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetConnectionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetConnectionsResponse -> GetConnectionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetConnectionsResponse -> GetConnectionsResponse -> Bool
$c/= :: GetConnectionsResponse -> GetConnectionsResponse -> Bool
== :: GetConnectionsResponse -> GetConnectionsResponse -> Bool
$c== :: GetConnectionsResponse -> GetConnectionsResponse -> Bool
Prelude.Eq, ReadPrec [GetConnectionsResponse]
ReadPrec GetConnectionsResponse
Int -> ReadS GetConnectionsResponse
ReadS [GetConnectionsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetConnectionsResponse]
$creadListPrec :: ReadPrec [GetConnectionsResponse]
readPrec :: ReadPrec GetConnectionsResponse
$creadPrec :: ReadPrec GetConnectionsResponse
readList :: ReadS [GetConnectionsResponse]
$creadList :: ReadS [GetConnectionsResponse]
readsPrec :: Int -> ReadS GetConnectionsResponse
$creadsPrec :: Int -> ReadS GetConnectionsResponse
Prelude.Read, Int -> GetConnectionsResponse -> ShowS
[GetConnectionsResponse] -> ShowS
GetConnectionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetConnectionsResponse] -> ShowS
$cshowList :: [GetConnectionsResponse] -> ShowS
show :: GetConnectionsResponse -> String
$cshow :: GetConnectionsResponse -> String
showsPrec :: Int -> GetConnectionsResponse -> ShowS
$cshowsPrec :: Int -> GetConnectionsResponse -> ShowS
Prelude.Show, forall x. Rep GetConnectionsResponse x -> GetConnectionsResponse
forall x. GetConnectionsResponse -> Rep GetConnectionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetConnectionsResponse x -> GetConnectionsResponse
$cfrom :: forall x. GetConnectionsResponse -> Rep GetConnectionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetConnectionsResponse' 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:
--
-- 'connections', 'getConnectionsResponse_connections' - Information about the connections.
--
-- 'nextToken', 'getConnectionsResponse_nextToken' - The token to use for the next page of results.
--
-- 'httpStatus', 'getConnectionsResponse_httpStatus' - The response's http status code.
newGetConnectionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetConnectionsResponse
newGetConnectionsResponse :: Int -> GetConnectionsResponse
newGetConnectionsResponse Int
pHttpStatus_ =
  GetConnectionsResponse'
    { $sel:connections:GetConnectionsResponse' :: Maybe [Connection]
connections =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetConnectionsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetConnectionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the connections.
getConnectionsResponse_connections :: Lens.Lens' GetConnectionsResponse (Prelude.Maybe [Connection])
getConnectionsResponse_connections :: Lens' GetConnectionsResponse (Maybe [Connection])
getConnectionsResponse_connections = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetConnectionsResponse' {Maybe [Connection]
connections :: Maybe [Connection]
$sel:connections:GetConnectionsResponse' :: GetConnectionsResponse -> Maybe [Connection]
connections} -> Maybe [Connection]
connections) (\s :: GetConnectionsResponse
s@GetConnectionsResponse' {} Maybe [Connection]
a -> GetConnectionsResponse
s {$sel:connections:GetConnectionsResponse' :: Maybe [Connection]
connections = Maybe [Connection]
a} :: GetConnectionsResponse) 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

-- | The token to use for the next page of results.
getConnectionsResponse_nextToken :: Lens.Lens' GetConnectionsResponse (Prelude.Maybe Prelude.Text)
getConnectionsResponse_nextToken :: Lens' GetConnectionsResponse (Maybe Text)
getConnectionsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetConnectionsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetConnectionsResponse' :: GetConnectionsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetConnectionsResponse
s@GetConnectionsResponse' {} Maybe Text
a -> GetConnectionsResponse
s {$sel:nextToken:GetConnectionsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetConnectionsResponse)

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

instance Prelude.NFData GetConnectionsResponse where
  rnf :: GetConnectionsResponse -> ()
rnf GetConnectionsResponse' {Int
Maybe [Connection]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
connections :: Maybe [Connection]
$sel:httpStatus:GetConnectionsResponse' :: GetConnectionsResponse -> Int
$sel:nextToken:GetConnectionsResponse' :: GetConnectionsResponse -> Maybe Text
$sel:connections:GetConnectionsResponse' :: GetConnectionsResponse -> Maybe [Connection]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Connection]
connections
      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