{-# 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.DMS.DescribeConnections
-- 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)
--
-- Describes the status of the connections that have been made between the
-- replication instance and an endpoint. Connections are created when you
-- test an endpoint.
--
-- This operation returns paginated results.
module Amazonka.DMS.DescribeConnections
  ( -- * Creating a Request
    DescribeConnections (..),
    newDescribeConnections,

    -- * Request Lenses
    describeConnections_filters,
    describeConnections_marker,
    describeConnections_maxRecords,

    -- * Destructuring the Response
    DescribeConnectionsResponse (..),
    newDescribeConnectionsResponse,

    -- * Response Lenses
    describeConnectionsResponse_connections,
    describeConnectionsResponse_marker,
    describeConnectionsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.DMS.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:/ 'newDescribeConnections' smart constructor.
data DescribeConnections = DescribeConnections'
  { -- | The filters applied to the connection.
    --
    -- Valid filter names: endpoint-arn | replication-instance-arn
    DescribeConnections -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | An optional pagination token provided by a previous request. If this
    -- parameter is specified, the response includes only records beyond the
    -- marker, up to the value specified by @MaxRecords@.
    DescribeConnections -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of records to include in the response. If more
    -- records exist than the specified @MaxRecords@ value, a pagination token
    -- called a marker is included in the response so that the remaining
    -- results can be retrieved.
    --
    -- Default: 100
    --
    -- Constraints: Minimum 20, maximum 100.
    DescribeConnections -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int
  }
  deriving (DescribeConnections -> DescribeConnections -> Bool
(DescribeConnections -> DescribeConnections -> Bool)
-> (DescribeConnections -> DescribeConnections -> Bool)
-> Eq DescribeConnections
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeConnections -> DescribeConnections -> Bool
$c/= :: DescribeConnections -> DescribeConnections -> Bool
== :: DescribeConnections -> DescribeConnections -> Bool
$c== :: DescribeConnections -> DescribeConnections -> Bool
Prelude.Eq, ReadPrec [DescribeConnections]
ReadPrec DescribeConnections
Int -> ReadS DescribeConnections
ReadS [DescribeConnections]
(Int -> ReadS DescribeConnections)
-> ReadS [DescribeConnections]
-> ReadPrec DescribeConnections
-> ReadPrec [DescribeConnections]
-> Read DescribeConnections
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeConnections]
$creadListPrec :: ReadPrec [DescribeConnections]
readPrec :: ReadPrec DescribeConnections
$creadPrec :: ReadPrec DescribeConnections
readList :: ReadS [DescribeConnections]
$creadList :: ReadS [DescribeConnections]
readsPrec :: Int -> ReadS DescribeConnections
$creadsPrec :: Int -> ReadS DescribeConnections
Prelude.Read, Int -> DescribeConnections -> ShowS
[DescribeConnections] -> ShowS
DescribeConnections -> String
(Int -> DescribeConnections -> ShowS)
-> (DescribeConnections -> String)
-> ([DescribeConnections] -> ShowS)
-> Show DescribeConnections
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeConnections] -> ShowS
$cshowList :: [DescribeConnections] -> ShowS
show :: DescribeConnections -> String
$cshow :: DescribeConnections -> String
showsPrec :: Int -> DescribeConnections -> ShowS
$cshowsPrec :: Int -> DescribeConnections -> ShowS
Prelude.Show, (forall x. DescribeConnections -> Rep DescribeConnections x)
-> (forall x. Rep DescribeConnections x -> DescribeConnections)
-> Generic DescribeConnections
forall x. Rep DescribeConnections x -> DescribeConnections
forall x. DescribeConnections -> Rep DescribeConnections x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeConnections x -> DescribeConnections
$cfrom :: forall x. DescribeConnections -> Rep DescribeConnections x
Prelude.Generic)

-- |
-- Create a value of 'DescribeConnections' 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:
--
-- 'filters', 'describeConnections_filters' - The filters applied to the connection.
--
-- Valid filter names: endpoint-arn | replication-instance-arn
--
-- 'marker', 'describeConnections_marker' - An optional pagination token provided by a previous request. If this
-- parameter is specified, the response includes only records beyond the
-- marker, up to the value specified by @MaxRecords@.
--
-- 'maxRecords', 'describeConnections_maxRecords' - The maximum number of records to include in the response. If more
-- records exist than the specified @MaxRecords@ value, a pagination token
-- called a marker is included in the response so that the remaining
-- results can be retrieved.
--
-- Default: 100
--
-- Constraints: Minimum 20, maximum 100.
newDescribeConnections ::
  DescribeConnections
newDescribeConnections :: DescribeConnections
newDescribeConnections =
  DescribeConnections' :: Maybe [Filter] -> Maybe Text -> Maybe Int -> DescribeConnections
DescribeConnections'
    { $sel:filters:DescribeConnections' :: Maybe [Filter]
filters = Maybe [Filter]
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeConnections' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeConnections' :: Maybe Int
maxRecords = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | The filters applied to the connection.
--
-- Valid filter names: endpoint-arn | replication-instance-arn
describeConnections_filters :: Lens.Lens' DescribeConnections (Prelude.Maybe [Filter])
describeConnections_filters :: (Maybe [Filter] -> f (Maybe [Filter]))
-> DescribeConnections -> f DescribeConnections
describeConnections_filters = (DescribeConnections -> Maybe [Filter])
-> (DescribeConnections -> Maybe [Filter] -> DescribeConnections)
-> Lens
     DescribeConnections
     DescribeConnections
     (Maybe [Filter])
     (Maybe [Filter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeConnections' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeConnections' :: DescribeConnections -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeConnections
s@DescribeConnections' {} Maybe [Filter]
a -> DescribeConnections
s {$sel:filters:DescribeConnections' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeConnections) ((Maybe [Filter] -> f (Maybe [Filter]))
 -> DescribeConnections -> f DescribeConnections)
-> ((Maybe [Filter] -> f (Maybe [Filter]))
    -> Maybe [Filter] -> f (Maybe [Filter]))
-> (Maybe [Filter] -> f (Maybe [Filter]))
-> DescribeConnections
-> f DescribeConnections
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Filter] [Filter] [Filter] [Filter]
-> Iso
     (Maybe [Filter]) (Maybe [Filter]) (Maybe [Filter]) (Maybe [Filter])
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 [Filter] [Filter] [Filter] [Filter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An optional pagination token provided by a previous request. If this
-- parameter is specified, the response includes only records beyond the
-- marker, up to the value specified by @MaxRecords@.
describeConnections_marker :: Lens.Lens' DescribeConnections (Prelude.Maybe Prelude.Text)
describeConnections_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeConnections -> f DescribeConnections
describeConnections_marker = (DescribeConnections -> Maybe Text)
-> (DescribeConnections -> Maybe Text -> DescribeConnections)
-> Lens
     DescribeConnections DescribeConnections (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeConnections' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeConnections' :: DescribeConnections -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeConnections
s@DescribeConnections' {} Maybe Text
a -> DescribeConnections
s {$sel:marker:DescribeConnections' :: Maybe Text
marker = Maybe Text
a} :: DescribeConnections)

-- | The maximum number of records to include in the response. If more
-- records exist than the specified @MaxRecords@ value, a pagination token
-- called a marker is included in the response so that the remaining
-- results can be retrieved.
--
-- Default: 100
--
-- Constraints: Minimum 20, maximum 100.
describeConnections_maxRecords :: Lens.Lens' DescribeConnections (Prelude.Maybe Prelude.Int)
describeConnections_maxRecords :: (Maybe Int -> f (Maybe Int))
-> DescribeConnections -> f DescribeConnections
describeConnections_maxRecords = (DescribeConnections -> Maybe Int)
-> (DescribeConnections -> Maybe Int -> DescribeConnections)
-> Lens
     DescribeConnections DescribeConnections (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeConnections' {Maybe Int
maxRecords :: Maybe Int
$sel:maxRecords:DescribeConnections' :: DescribeConnections -> Maybe Int
maxRecords} -> Maybe Int
maxRecords) (\s :: DescribeConnections
s@DescribeConnections' {} Maybe Int
a -> DescribeConnections
s {$sel:maxRecords:DescribeConnections' :: Maybe Int
maxRecords = Maybe Int
a} :: DescribeConnections)

instance Core.AWSPager DescribeConnections where
  page :: DescribeConnections
-> AWSResponse DescribeConnections -> Maybe DescribeConnections
page DescribeConnections
rq AWSResponse DescribeConnections
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeConnections
DescribeConnectionsResponse
rs
            DescribeConnectionsResponse
-> Getting (First Text) DescribeConnectionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeConnectionsResponse
-> Const (First Text) DescribeConnectionsResponse
Lens' DescribeConnectionsResponse (Maybe Text)
describeConnectionsResponse_marker
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeConnectionsResponse
 -> Const (First Text) DescribeConnectionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeConnectionsResponse 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 DescribeConnections
forall a. Maybe a
Prelude.Nothing
    | Maybe [Connection] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeConnections
DescribeConnectionsResponse
rs
            DescribeConnectionsResponse
-> Getting
     (First [Connection]) DescribeConnectionsResponse [Connection]
-> Maybe [Connection]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Connection]
 -> Const (First [Connection]) (Maybe [Connection]))
-> DescribeConnectionsResponse
-> Const (First [Connection]) DescribeConnectionsResponse
Lens' DescribeConnectionsResponse (Maybe [Connection])
describeConnectionsResponse_connections
              ((Maybe [Connection]
  -> Const (First [Connection]) (Maybe [Connection]))
 -> DescribeConnectionsResponse
 -> Const (First [Connection]) DescribeConnectionsResponse)
-> (([Connection] -> Const (First [Connection]) [Connection])
    -> Maybe [Connection]
    -> Const (First [Connection]) (Maybe [Connection]))
-> Getting
     (First [Connection]) DescribeConnectionsResponse [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 DescribeConnections
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeConnections -> Maybe DescribeConnections
forall a. a -> Maybe a
Prelude.Just (DescribeConnections -> Maybe DescribeConnections)
-> DescribeConnections -> Maybe DescribeConnections
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeConnections
rq
          DescribeConnections
-> (DescribeConnections -> DescribeConnections)
-> DescribeConnections
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeConnections -> Identity DescribeConnections
Lens
  DescribeConnections DescribeConnections (Maybe Text) (Maybe Text)
describeConnections_marker
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeConnections -> Identity DescribeConnections)
-> Maybe Text -> DescribeConnections -> DescribeConnections
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeConnections
DescribeConnectionsResponse
rs
          DescribeConnectionsResponse
-> Getting (First Text) DescribeConnectionsResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeConnectionsResponse
-> Const (First Text) DescribeConnectionsResponse
Lens' DescribeConnectionsResponse (Maybe Text)
describeConnectionsResponse_marker
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeConnectionsResponse
 -> Const (First Text) DescribeConnectionsResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeConnectionsResponse 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 DescribeConnections where
  type
    AWSResponse DescribeConnections =
      DescribeConnectionsResponse
  request :: DescribeConnections -> Request DescribeConnections
request = Service -> DescribeConnections -> Request DescribeConnections
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeConnections
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeConnections)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeConnections))
-> Logger
-> Service
-> Proxy DescribeConnections
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeConnections)))
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 -> DescribeConnectionsResponse
DescribeConnectionsResponse'
            (Maybe [Connection]
 -> Maybe Text -> Int -> DescribeConnectionsResponse)
-> Either String (Maybe [Connection])
-> Either String (Maybe Text -> Int -> DescribeConnectionsResponse)
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 -> DescribeConnectionsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeConnectionsResponse)
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
"Marker")
            Either String (Int -> DescribeConnectionsResponse)
-> Either String Int -> Either String DescribeConnectionsResponse
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 DescribeConnections

instance Prelude.NFData DescribeConnections

instance Core.ToHeaders DescribeConnections where
  toHeaders :: DescribeConnections -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeConnections -> 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
"AmazonDMSv20160101.DescribeConnections" ::
                          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 DescribeConnections where
  toJSON :: DescribeConnections -> Value
toJSON DescribeConnections' {Maybe Int
Maybe [Filter]
Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
filters :: Maybe [Filter]
$sel:maxRecords:DescribeConnections' :: DescribeConnections -> Maybe Int
$sel:marker:DescribeConnections' :: DescribeConnections -> Maybe Text
$sel:filters:DescribeConnections' :: DescribeConnections -> Maybe [Filter]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Filters" Text -> [Filter] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Filter] -> Pair) -> Maybe [Filter] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters,
            (Text
"Marker" 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
marker,
            (Text
"MaxRecords" 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
maxRecords
          ]
      )

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

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

-- |
--
-- /See:/ 'newDescribeConnectionsResponse' smart constructor.
data DescribeConnectionsResponse = DescribeConnectionsResponse'
  { -- | A description of the connections.
    DescribeConnectionsResponse -> Maybe [Connection]
connections :: Prelude.Maybe [Connection],
    -- | An optional pagination token provided by a previous request. If this
    -- parameter is specified, the response includes only records beyond the
    -- marker, up to the value specified by @MaxRecords@.
    DescribeConnectionsResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeConnectionsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeConnectionsResponse -> DescribeConnectionsResponse -> Bool
(DescribeConnectionsResponse
 -> DescribeConnectionsResponse -> Bool)
-> (DescribeConnectionsResponse
    -> DescribeConnectionsResponse -> Bool)
-> Eq DescribeConnectionsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeConnectionsResponse -> DescribeConnectionsResponse -> Bool
$c/= :: DescribeConnectionsResponse -> DescribeConnectionsResponse -> Bool
== :: DescribeConnectionsResponse -> DescribeConnectionsResponse -> Bool
$c== :: DescribeConnectionsResponse -> DescribeConnectionsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeConnectionsResponse]
ReadPrec DescribeConnectionsResponse
Int -> ReadS DescribeConnectionsResponse
ReadS [DescribeConnectionsResponse]
(Int -> ReadS DescribeConnectionsResponse)
-> ReadS [DescribeConnectionsResponse]
-> ReadPrec DescribeConnectionsResponse
-> ReadPrec [DescribeConnectionsResponse]
-> Read DescribeConnectionsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeConnectionsResponse]
$creadListPrec :: ReadPrec [DescribeConnectionsResponse]
readPrec :: ReadPrec DescribeConnectionsResponse
$creadPrec :: ReadPrec DescribeConnectionsResponse
readList :: ReadS [DescribeConnectionsResponse]
$creadList :: ReadS [DescribeConnectionsResponse]
readsPrec :: Int -> ReadS DescribeConnectionsResponse
$creadsPrec :: Int -> ReadS DescribeConnectionsResponse
Prelude.Read, Int -> DescribeConnectionsResponse -> ShowS
[DescribeConnectionsResponse] -> ShowS
DescribeConnectionsResponse -> String
(Int -> DescribeConnectionsResponse -> ShowS)
-> (DescribeConnectionsResponse -> String)
-> ([DescribeConnectionsResponse] -> ShowS)
-> Show DescribeConnectionsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeConnectionsResponse] -> ShowS
$cshowList :: [DescribeConnectionsResponse] -> ShowS
show :: DescribeConnectionsResponse -> String
$cshow :: DescribeConnectionsResponse -> String
showsPrec :: Int -> DescribeConnectionsResponse -> ShowS
$cshowsPrec :: Int -> DescribeConnectionsResponse -> ShowS
Prelude.Show, (forall x.
 DescribeConnectionsResponse -> Rep DescribeConnectionsResponse x)
-> (forall x.
    Rep DescribeConnectionsResponse x -> DescribeConnectionsResponse)
-> Generic DescribeConnectionsResponse
forall x.
Rep DescribeConnectionsResponse x -> DescribeConnectionsResponse
forall x.
DescribeConnectionsResponse -> Rep DescribeConnectionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeConnectionsResponse x -> DescribeConnectionsResponse
$cfrom :: forall x.
DescribeConnectionsResponse -> Rep DescribeConnectionsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeConnectionsResponse' 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', 'describeConnectionsResponse_connections' - A description of the connections.
--
-- 'marker', 'describeConnectionsResponse_marker' - An optional pagination token provided by a previous request. If this
-- parameter is specified, the response includes only records beyond the
-- marker, up to the value specified by @MaxRecords@.
--
-- 'httpStatus', 'describeConnectionsResponse_httpStatus' - The response's http status code.
newDescribeConnectionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeConnectionsResponse
newDescribeConnectionsResponse :: Int -> DescribeConnectionsResponse
newDescribeConnectionsResponse Int
pHttpStatus_ =
  DescribeConnectionsResponse' :: Maybe [Connection]
-> Maybe Text -> Int -> DescribeConnectionsResponse
DescribeConnectionsResponse'
    { $sel:connections:DescribeConnectionsResponse' :: Maybe [Connection]
connections =
        Maybe [Connection]
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeConnectionsResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeConnectionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A description of the connections.
describeConnectionsResponse_connections :: Lens.Lens' DescribeConnectionsResponse (Prelude.Maybe [Connection])
describeConnectionsResponse_connections :: (Maybe [Connection] -> f (Maybe [Connection]))
-> DescribeConnectionsResponse -> f DescribeConnectionsResponse
describeConnectionsResponse_connections = (DescribeConnectionsResponse -> Maybe [Connection])
-> (DescribeConnectionsResponse
    -> Maybe [Connection] -> DescribeConnectionsResponse)
-> Lens' DescribeConnectionsResponse (Maybe [Connection])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeConnectionsResponse' {Maybe [Connection]
connections :: Maybe [Connection]
$sel:connections:DescribeConnectionsResponse' :: DescribeConnectionsResponse -> Maybe [Connection]
connections} -> Maybe [Connection]
connections) (\s :: DescribeConnectionsResponse
s@DescribeConnectionsResponse' {} Maybe [Connection]
a -> DescribeConnectionsResponse
s {$sel:connections:DescribeConnectionsResponse' :: Maybe [Connection]
connections = Maybe [Connection]
a} :: DescribeConnectionsResponse) ((Maybe [Connection] -> f (Maybe [Connection]))
 -> DescribeConnectionsResponse -> f DescribeConnectionsResponse)
-> ((Maybe [Connection] -> f (Maybe [Connection]))
    -> Maybe [Connection] -> f (Maybe [Connection]))
-> (Maybe [Connection] -> f (Maybe [Connection]))
-> DescribeConnectionsResponse
-> f DescribeConnectionsResponse
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

-- | An optional pagination token provided by a previous request. If this
-- parameter is specified, the response includes only records beyond the
-- marker, up to the value specified by @MaxRecords@.
describeConnectionsResponse_marker :: Lens.Lens' DescribeConnectionsResponse (Prelude.Maybe Prelude.Text)
describeConnectionsResponse_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeConnectionsResponse -> f DescribeConnectionsResponse
describeConnectionsResponse_marker = (DescribeConnectionsResponse -> Maybe Text)
-> (DescribeConnectionsResponse
    -> Maybe Text -> DescribeConnectionsResponse)
-> Lens' DescribeConnectionsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeConnectionsResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeConnectionsResponse' :: DescribeConnectionsResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeConnectionsResponse
s@DescribeConnectionsResponse' {} Maybe Text
a -> DescribeConnectionsResponse
s {$sel:marker:DescribeConnectionsResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeConnectionsResponse)

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

instance Prelude.NFData DescribeConnectionsResponse