{-# 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.Glue.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)
--
-- Retrieves a list of connection definitions from the Data Catalog.
--
-- This operation returns paginated results.
module Amazonka.Glue.GetConnections
  ( -- * Creating a Request
    GetConnections (..),
    newGetConnections,

    -- * Request Lenses
    getConnections_catalogId,
    getConnections_nextToken,
    getConnections_hidePassword,
    getConnections_filter,
    getConnections_maxResults,

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

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

import qualified Amazonka.Core as Core
import Amazonka.Glue.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:/ 'newGetConnections' smart constructor.
data GetConnections = GetConnections'
  { -- | The ID of the Data Catalog in which the connections reside. If none is
    -- provided, the Amazon Web Services account ID is used by default.
    GetConnections -> Maybe Text
catalogId :: Prelude.Maybe Prelude.Text,
    -- | A continuation token, if this is a continuation call.
    GetConnections -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Allows you to retrieve the connection metadata without returning the
    -- password. For instance, the AWS Glue console uses this flag to retrieve
    -- the connection, and does not display the password. Set this parameter
    -- when the caller might not have permission to use the KMS key to decrypt
    -- the password, but it does have permission to access the rest of the
    -- connection properties.
    GetConnections -> Maybe Bool
hidePassword :: Prelude.Maybe Prelude.Bool,
    -- | A filter that controls which connections are returned.
    GetConnections -> Maybe GetConnectionsFilter
filter' :: Prelude.Maybe GetConnectionsFilter,
    -- | The maximum number of connections to return in one response.
    GetConnections -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  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:
--
-- 'catalogId', 'getConnections_catalogId' - The ID of the Data Catalog in which the connections reside. If none is
-- provided, the Amazon Web Services account ID is used by default.
--
-- 'nextToken', 'getConnections_nextToken' - A continuation token, if this is a continuation call.
--
-- 'hidePassword', 'getConnections_hidePassword' - Allows you to retrieve the connection metadata without returning the
-- password. For instance, the AWS Glue console uses this flag to retrieve
-- the connection, and does not display the password. Set this parameter
-- when the caller might not have permission to use the KMS key to decrypt
-- the password, but it does have permission to access the rest of the
-- connection properties.
--
-- 'filter'', 'getConnections_filter' - A filter that controls which connections are returned.
--
-- 'maxResults', 'getConnections_maxResults' - The maximum number of connections to return in one response.
newGetConnections ::
  GetConnections
newGetConnections :: GetConnections
newGetConnections =
  GetConnections' :: Maybe Text
-> Maybe Text
-> Maybe Bool
-> Maybe GetConnectionsFilter
-> Maybe Natural
-> GetConnections
GetConnections'
    { $sel:catalogId:GetConnections' :: Maybe Text
catalogId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:GetConnections' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:hidePassword:GetConnections' :: Maybe Bool
hidePassword = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:filter':GetConnections' :: Maybe GetConnectionsFilter
filter' = Maybe GetConnectionsFilter
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:GetConnections' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the Data Catalog in which the connections reside. If none is
-- provided, the Amazon Web Services account ID is used by default.
getConnections_catalogId :: Lens.Lens' GetConnections (Prelude.Maybe Prelude.Text)
getConnections_catalogId :: (Maybe Text -> f (Maybe Text))
-> GetConnections -> f GetConnections
getConnections_catalogId = (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
catalogId :: Maybe Text
$sel:catalogId:GetConnections' :: GetConnections -> Maybe Text
catalogId} -> Maybe Text
catalogId) (\s :: GetConnections
s@GetConnections' {} Maybe Text
a -> GetConnections
s {$sel:catalogId:GetConnections' :: Maybe Text
catalogId = Maybe Text
a} :: GetConnections)

-- | A continuation token, if this is a continuation call.
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)

-- | Allows you to retrieve the connection metadata without returning the
-- password. For instance, the AWS Glue console uses this flag to retrieve
-- the connection, and does not display the password. Set this parameter
-- when the caller might not have permission to use the KMS key to decrypt
-- the password, but it does have permission to access the rest of the
-- connection properties.
getConnections_hidePassword :: Lens.Lens' GetConnections (Prelude.Maybe Prelude.Bool)
getConnections_hidePassword :: (Maybe Bool -> f (Maybe Bool))
-> GetConnections -> f GetConnections
getConnections_hidePassword = (GetConnections -> Maybe Bool)
-> (GetConnections -> Maybe Bool -> GetConnections)
-> Lens GetConnections GetConnections (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetConnections' {Maybe Bool
hidePassword :: Maybe Bool
$sel:hidePassword:GetConnections' :: GetConnections -> Maybe Bool
hidePassword} -> Maybe Bool
hidePassword) (\s :: GetConnections
s@GetConnections' {} Maybe Bool
a -> GetConnections
s {$sel:hidePassword:GetConnections' :: Maybe Bool
hidePassword = Maybe Bool
a} :: GetConnections)

-- | A filter that controls which connections are returned.
getConnections_filter :: Lens.Lens' GetConnections (Prelude.Maybe GetConnectionsFilter)
getConnections_filter :: (Maybe GetConnectionsFilter -> f (Maybe GetConnectionsFilter))
-> GetConnections -> f GetConnections
getConnections_filter = (GetConnections -> Maybe GetConnectionsFilter)
-> (GetConnections -> Maybe GetConnectionsFilter -> GetConnections)
-> Lens
     GetConnections
     GetConnections
     (Maybe GetConnectionsFilter)
     (Maybe GetConnectionsFilter)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetConnections' {Maybe GetConnectionsFilter
filter' :: Maybe GetConnectionsFilter
$sel:filter':GetConnections' :: GetConnections -> Maybe GetConnectionsFilter
filter'} -> Maybe GetConnectionsFilter
filter') (\s :: GetConnections
s@GetConnections' {} Maybe GetConnectionsFilter
a -> GetConnections
s {$sel:filter':GetConnections' :: Maybe GetConnectionsFilter
filter' = Maybe GetConnectionsFilter
a} :: GetConnections)

-- | The maximum number of connections to return in one response.
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)

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_connectionList
              ((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, ToJSON a) => Service -> a -> Request a
Request.postJSON 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 Text -> Maybe [Connection] -> Int -> GetConnectionsResponse
GetConnectionsResponse'
            (Maybe Text -> Maybe [Connection] -> Int -> GetConnectionsResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe [Connection] -> Int -> GetConnectionsResponse)
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 [Connection] -> Int -> GetConnectionsResponse)
-> Either String (Maybe [Connection])
-> 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 (Maybe [Connection]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ConnectionList" 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 (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
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# (ByteString
"AWSGlue.GetConnections" :: 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 GetConnections where
  toJSON :: GetConnections -> Value
toJSON GetConnections' {Maybe Bool
Maybe Natural
Maybe Text
Maybe GetConnectionsFilter
maxResults :: Maybe Natural
filter' :: Maybe GetConnectionsFilter
hidePassword :: Maybe Bool
nextToken :: Maybe Text
catalogId :: Maybe Text
$sel:maxResults:GetConnections' :: GetConnections -> Maybe Natural
$sel:filter':GetConnections' :: GetConnections -> Maybe GetConnectionsFilter
$sel:hidePassword:GetConnections' :: GetConnections -> Maybe Bool
$sel:nextToken:GetConnections' :: GetConnections -> Maybe Text
$sel:catalogId:GetConnections' :: GetConnections -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"CatalogId" 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
catalogId,
            (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
"HidePassword" 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
hidePassword,
            (Text
"Filter" Text -> GetConnectionsFilter -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (GetConnectionsFilter -> Pair)
-> Maybe GetConnectionsFilter -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe GetConnectionsFilter
filter',
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults
          ]
      )

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

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

-- | /See:/ 'newGetConnectionsResponse' smart constructor.
data GetConnectionsResponse = GetConnectionsResponse'
  { -- | A continuation token, if the list of connections returned does not
    -- include the last of the filtered connections.
    GetConnectionsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list of requested connection definitions.
    GetConnectionsResponse -> Maybe [Connection]
connectionList :: Prelude.Maybe [Connection],
    -- | 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:
--
-- 'nextToken', 'getConnectionsResponse_nextToken' - A continuation token, if the list of connections returned does not
-- include the last of the filtered connections.
--
-- 'connectionList', 'getConnectionsResponse_connectionList' - A list of requested connection definitions.
--
-- 'httpStatus', 'getConnectionsResponse_httpStatus' - The response's http status code.
newGetConnectionsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetConnectionsResponse
newGetConnectionsResponse :: Int -> GetConnectionsResponse
newGetConnectionsResponse Int
pHttpStatus_ =
  GetConnectionsResponse' :: Maybe Text -> Maybe [Connection] -> Int -> GetConnectionsResponse
GetConnectionsResponse'
    { $sel:nextToken:GetConnectionsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:connectionList:GetConnectionsResponse' :: Maybe [Connection]
connectionList = Maybe [Connection]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetConnectionsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A continuation token, if the list of connections returned does not
-- include the last of the filtered connections.
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)

-- | A list of requested connection definitions.
getConnectionsResponse_connectionList :: Lens.Lens' GetConnectionsResponse (Prelude.Maybe [Connection])
getConnectionsResponse_connectionList :: (Maybe [Connection] -> f (Maybe [Connection]))
-> GetConnectionsResponse -> f GetConnectionsResponse
getConnectionsResponse_connectionList = (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]
connectionList :: Maybe [Connection]
$sel:connectionList:GetConnectionsResponse' :: GetConnectionsResponse -> Maybe [Connection]
connectionList} -> Maybe [Connection]
connectionList) (\s :: GetConnectionsResponse
s@GetConnectionsResponse' {} Maybe [Connection]
a -> GetConnectionsResponse
s {$sel:connectionList:GetConnectionsResponse' :: Maybe [Connection]
connectionList = 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 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