{-# 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-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)
--
-- 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_nextToken,
    getConnections_deviceId,
    getConnections_maxResults,
    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.Lens as Lens
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 token for the next page of results.
    GetConnections -> Maybe Text
nextToken :: 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 ID of the global network.
    GetConnections -> Text
globalNetworkId :: Prelude.Text
  }
  deriving (GetConnections -> GetConnections -> Bool
(GetConnections -> GetConnections -> Bool)
-> (GetConnections -> GetConnections -> Bool) -> Eq GetConnections
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]
(Int -> ReadS GetConnections)
-> ReadS [GetConnections]
-> ReadPrec GetConnections
-> ReadPrec [GetConnections]
-> Read 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
(Int -> GetConnections -> ShowS)
-> (GetConnections -> String)
-> ([GetConnections] -> ShowS)
-> Show GetConnections
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. GetConnections -> Rep GetConnections x)
-> (forall x. Rep GetConnections x -> GetConnections)
-> Generic GetConnections
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.
--
-- 'nextToken', 'getConnections_nextToken' - The token for the next page of results.
--
-- 'deviceId', 'getConnections_deviceId' - The ID of the device.
--
-- 'maxResults', 'getConnections_maxResults' - The maximum number of results to return.
--
-- 'globalNetworkId', 'getConnections_globalNetworkId' - The ID of the global network.
newGetConnections ::
  -- | 'globalNetworkId'
  Prelude.Text ->
  GetConnections
newGetConnections :: Text -> GetConnections
newGetConnections Text
pGlobalNetworkId_ =
  GetConnections' :: Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Text
-> GetConnections
GetConnections'
    { $sel:connectionIds:GetConnections' :: Maybe [Text]
connectionIds = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetConnections' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:deviceId:GetConnections' :: Maybe Text
deviceId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetConnections' :: Maybe Natural
maxResults = Maybe Natural
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 :: (Maybe [Text] -> f (Maybe [Text]))
-> GetConnections -> f GetConnections
getConnections_connectionIds = (GetConnections -> Maybe [Text])
-> (GetConnections -> Maybe [Text] -> GetConnections)
-> Lens GetConnections GetConnections (Maybe [Text]) (Maybe [Text])
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) ((Maybe [Text] -> f (Maybe [Text]))
 -> GetConnections -> f GetConnections)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> GetConnections
-> f GetConnections
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

-- | The token for the next page of results.
getConnections_nextToken :: Lens.Lens' GetConnections (Prelude.Maybe Prelude.Text)
getConnections_nextToken :: (Maybe Text -> f (Maybe Text))
-> GetConnections -> f GetConnections
getConnections_nextToken = (GetConnections -> Maybe Text)
-> (GetConnections -> Maybe Text -> GetConnections)
-> Lens GetConnections GetConnections (Maybe Text) (Maybe Text)
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 device.
getConnections_deviceId :: Lens.Lens' GetConnections (Prelude.Maybe Prelude.Text)
getConnections_deviceId :: (Maybe Text -> f (Maybe Text))
-> GetConnections -> f GetConnections
getConnections_deviceId = (GetConnections -> Maybe Text)
-> (GetConnections -> Maybe Text -> GetConnections)
-> Lens GetConnections GetConnections (Maybe Text) (Maybe Text)
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 :: (Maybe Natural -> f (Maybe Natural))
-> GetConnections -> f GetConnections
getConnections_maxResults = (GetConnections -> Maybe Natural)
-> (GetConnections -> Maybe Natural -> GetConnections)
-> Lens
     GetConnections GetConnections (Maybe Natural) (Maybe Natural)
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 ID of the global network.
getConnections_globalNetworkId :: Lens.Lens' GetConnections Prelude.Text
getConnections_globalNetworkId :: (Text -> f Text) -> GetConnections -> f GetConnections
getConnections_globalNetworkId = (GetConnections -> Text)
-> (GetConnections -> Text -> GetConnections)
-> Lens GetConnections GetConnections Text Text
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
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetConnections
GetConnectionsResponse
rs
            GetConnectionsResponse
-> Getting (First Text) GetConnectionsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetConnectionsResponse
-> Const (First Text) GetConnectionsResponse
Lens' GetConnectionsResponse (Maybe Text)
getConnectionsResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetConnectionsResponse
 -> Const (First Text) GetConnectionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetConnectionsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe GetConnections
forall a. Maybe a
Prelude.Nothing
    | Maybe [Connection] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetConnections
GetConnectionsResponse
rs
            GetConnectionsResponse
-> Getting (First [Connection]) GetConnectionsResponse [Connection]
-> Maybe [Connection]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Connection]
 -> Const (First [Connection]) (Maybe [Connection]))
-> GetConnectionsResponse
-> Const (First [Connection]) GetConnectionsResponse
Lens' GetConnectionsResponse (Maybe [Connection])
getConnectionsResponse_connections
              ((Maybe [Connection]
  -> Const (First [Connection]) (Maybe [Connection]))
 -> GetConnectionsResponse
 -> Const (First [Connection]) GetConnectionsResponse)
-> (([Connection] -> Const (First [Connection]) [Connection])
    -> Maybe [Connection]
    -> Const (First [Connection]) (Maybe [Connection]))
-> Getting (First [Connection]) GetConnectionsResponse [Connection]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Connection] -> Const (First [Connection]) [Connection])
-> Maybe [Connection]
-> Const (First [Connection]) (Maybe [Connection])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe GetConnections
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      GetConnections -> Maybe GetConnections
forall a. a -> Maybe a
Prelude.Just (GetConnections -> Maybe GetConnections)
-> GetConnections -> Maybe GetConnections
forall a b. (a -> b) -> a -> b
Prelude.$
        GetConnections
rq
          GetConnections
-> (GetConnections -> GetConnections) -> GetConnections
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> GetConnections -> Identity GetConnections
Lens GetConnections GetConnections (Maybe Text) (Maybe Text)
getConnections_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> GetConnections -> Identity GetConnections)
-> Maybe Text -> GetConnections -> GetConnections
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetConnections
GetConnectionsResponse
rs
          GetConnectionsResponse
-> Getting (First Text) GetConnectionsResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> GetConnectionsResponse
-> Const (First Text) GetConnectionsResponse
Lens' GetConnectionsResponse (Maybe Text)
getConnectionsResponse_nextToken ((Maybe Text -> Const (First Text) (Maybe Text))
 -> GetConnectionsResponse
 -> Const (First Text) GetConnectionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) GetConnectionsResponse Text
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text)
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest GetConnections where
  type
    AWSResponse GetConnections =
      GetConnectionsResponse
  request :: GetConnections -> Request GetConnections
request = Service -> GetConnections -> Request GetConnections
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy GetConnections
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetConnections)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetConnections))
-> Logger
-> Service
-> Proxy GetConnections
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetConnections)))
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 [Connection] -> Maybe Text -> Int -> GetConnectionsResponse
GetConnectionsResponse'
            (Maybe [Connection] -> Maybe Text -> Int -> GetConnectionsResponse)
-> Either String (Maybe [Connection])
-> Either String (Maybe Text -> Int -> GetConnectionsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [Connection]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Connections" Either String (Maybe (Maybe [Connection]))
-> Maybe [Connection] -> Either String (Maybe [Connection])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [Connection]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> GetConnectionsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> GetConnectionsResponse)
forall (f :: * -> *) a b. Applicative f => 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 (Int -> GetConnectionsResponse)
-> Either String Int -> Either String GetConnectionsResponse
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))
      )

instance Prelude.Hashable GetConnections

instance Prelude.NFData GetConnections

instance Core.ToHeaders GetConnections where
  toHeaders :: GetConnections -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetConnections -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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.ToPath GetConnections where
  toPath :: GetConnections -> ByteString
toPath GetConnections' {Maybe Natural
Maybe [Text]
Maybe Text
Text
globalNetworkId :: Text
maxResults :: Maybe Natural
deviceId :: Maybe Text
nextToken :: Maybe Text
connectionIds :: Maybe [Text]
$sel:globalNetworkId:GetConnections' :: GetConnections -> Text
$sel:maxResults:GetConnections' :: GetConnections -> Maybe Natural
$sel:deviceId:GetConnections' :: GetConnections -> Maybe Text
$sel:nextToken:GetConnections' :: GetConnections -> Maybe Text
$sel:connectionIds:GetConnections' :: GetConnections -> Maybe [Text]
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/global-networks/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
globalNetworkId,
        ByteString
"/connections"
      ]

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

-- | /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
(GetConnectionsResponse -> GetConnectionsResponse -> Bool)
-> (GetConnectionsResponse -> GetConnectionsResponse -> Bool)
-> Eq GetConnectionsResponse
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]
(Int -> ReadS GetConnectionsResponse)
-> ReadS [GetConnectionsResponse]
-> ReadPrec GetConnectionsResponse
-> ReadPrec [GetConnectionsResponse]
-> Read 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
(Int -> GetConnectionsResponse -> ShowS)
-> (GetConnectionsResponse -> String)
-> ([GetConnectionsResponse] -> ShowS)
-> Show GetConnectionsResponse
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. GetConnectionsResponse -> Rep GetConnectionsResponse x)
-> (forall x.
    Rep GetConnectionsResponse x -> GetConnectionsResponse)
-> Generic GetConnectionsResponse
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' :: Maybe [Connection] -> Maybe Text -> Int -> GetConnectionsResponse
GetConnectionsResponse'
    { $sel:connections:GetConnectionsResponse' :: Maybe [Connection]
connections =
        Maybe [Connection]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetConnectionsResponse' :: Maybe Text
nextToken = Maybe Text
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 :: (Maybe [Connection] -> f (Maybe [Connection]))
-> GetConnectionsResponse -> f GetConnectionsResponse
getConnectionsResponse_connections = (GetConnectionsResponse -> Maybe [Connection])
-> (GetConnectionsResponse
    -> Maybe [Connection] -> GetConnectionsResponse)
-> Lens' GetConnectionsResponse (Maybe [Connection])
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) ((Maybe [Connection] -> f (Maybe [Connection]))
 -> GetConnectionsResponse -> f GetConnectionsResponse)
-> ((Maybe [Connection] -> f (Maybe [Connection]))
    -> Maybe [Connection] -> f (Maybe [Connection]))
-> (Maybe [Connection] -> f (Maybe [Connection]))
-> GetConnectionsResponse
-> f GetConnectionsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Connection] [Connection] [Connection] [Connection]
-> Iso
     (Maybe [Connection])
     (Maybe [Connection])
     (Maybe [Connection])
     (Maybe [Connection])
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 [Connection] [Connection] [Connection] [Connection]
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 :: (Maybe Text -> f (Maybe Text))
-> GetConnectionsResponse -> f GetConnectionsResponse
getConnectionsResponse_nextToken = (GetConnectionsResponse -> Maybe Text)
-> (GetConnectionsResponse -> Maybe Text -> GetConnectionsResponse)
-> Lens' GetConnectionsResponse (Maybe Text)
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 :: (Int -> f Int)
-> GetConnectionsResponse -> f GetConnectionsResponse
getConnectionsResponse_httpStatus = (GetConnectionsResponse -> Int)
-> (GetConnectionsResponse -> Int -> GetConnectionsResponse)
-> Lens GetConnectionsResponse GetConnectionsResponse Int Int
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