{-# 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.MGN.DescribeSourceServers
-- 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 all SourceServers or multiple SourceServers by ID.
--
-- This operation returns paginated results.
module Amazonka.MGN.DescribeSourceServers
  ( -- * Creating a Request
    DescribeSourceServers (..),
    newDescribeSourceServers,

    -- * Request Lenses
    describeSourceServers_nextToken,
    describeSourceServers_maxResults,
    describeSourceServers_filters,

    -- * Destructuring the Response
    DescribeSourceServersResponse (..),
    newDescribeSourceServersResponse,

    -- * Response Lenses
    describeSourceServersResponse_items,
    describeSourceServersResponse_nextToken,
    describeSourceServersResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MGN.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDescribeSourceServers' smart constructor.
data DescribeSourceServers = DescribeSourceServers'
  { -- | Request to filter Source Servers list by next token.
    DescribeSourceServers -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Request to filter Source Servers list by maximum results.
    DescribeSourceServers -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | Request to filter Source Servers list.
    DescribeSourceServers -> DescribeSourceServersRequestFilters
filters :: DescribeSourceServersRequestFilters
  }
  deriving (DescribeSourceServers -> DescribeSourceServers -> Bool
(DescribeSourceServers -> DescribeSourceServers -> Bool)
-> (DescribeSourceServers -> DescribeSourceServers -> Bool)
-> Eq DescribeSourceServers
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeSourceServers -> DescribeSourceServers -> Bool
$c/= :: DescribeSourceServers -> DescribeSourceServers -> Bool
== :: DescribeSourceServers -> DescribeSourceServers -> Bool
$c== :: DescribeSourceServers -> DescribeSourceServers -> Bool
Prelude.Eq, ReadPrec [DescribeSourceServers]
ReadPrec DescribeSourceServers
Int -> ReadS DescribeSourceServers
ReadS [DescribeSourceServers]
(Int -> ReadS DescribeSourceServers)
-> ReadS [DescribeSourceServers]
-> ReadPrec DescribeSourceServers
-> ReadPrec [DescribeSourceServers]
-> Read DescribeSourceServers
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeSourceServers]
$creadListPrec :: ReadPrec [DescribeSourceServers]
readPrec :: ReadPrec DescribeSourceServers
$creadPrec :: ReadPrec DescribeSourceServers
readList :: ReadS [DescribeSourceServers]
$creadList :: ReadS [DescribeSourceServers]
readsPrec :: Int -> ReadS DescribeSourceServers
$creadsPrec :: Int -> ReadS DescribeSourceServers
Prelude.Read, Int -> DescribeSourceServers -> ShowS
[DescribeSourceServers] -> ShowS
DescribeSourceServers -> String
(Int -> DescribeSourceServers -> ShowS)
-> (DescribeSourceServers -> String)
-> ([DescribeSourceServers] -> ShowS)
-> Show DescribeSourceServers
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeSourceServers] -> ShowS
$cshowList :: [DescribeSourceServers] -> ShowS
show :: DescribeSourceServers -> String
$cshow :: DescribeSourceServers -> String
showsPrec :: Int -> DescribeSourceServers -> ShowS
$cshowsPrec :: Int -> DescribeSourceServers -> ShowS
Prelude.Show, (forall x. DescribeSourceServers -> Rep DescribeSourceServers x)
-> (forall x. Rep DescribeSourceServers x -> DescribeSourceServers)
-> Generic DescribeSourceServers
forall x. Rep DescribeSourceServers x -> DescribeSourceServers
forall x. DescribeSourceServers -> Rep DescribeSourceServers x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeSourceServers x -> DescribeSourceServers
$cfrom :: forall x. DescribeSourceServers -> Rep DescribeSourceServers x
Prelude.Generic)

-- |
-- Create a value of 'DescribeSourceServers' 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', 'describeSourceServers_nextToken' - Request to filter Source Servers list by next token.
--
-- 'maxResults', 'describeSourceServers_maxResults' - Request to filter Source Servers list by maximum results.
--
-- 'filters', 'describeSourceServers_filters' - Request to filter Source Servers list.
newDescribeSourceServers ::
  -- | 'filters'
  DescribeSourceServersRequestFilters ->
  DescribeSourceServers
newDescribeSourceServers :: DescribeSourceServersRequestFilters -> DescribeSourceServers
newDescribeSourceServers DescribeSourceServersRequestFilters
pFilters_ =
  DescribeSourceServers' :: Maybe Text
-> Maybe Natural
-> DescribeSourceServersRequestFilters
-> DescribeSourceServers
DescribeSourceServers'
    { $sel:nextToken:DescribeSourceServers' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:DescribeSourceServers' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:filters:DescribeSourceServers' :: DescribeSourceServersRequestFilters
filters = DescribeSourceServersRequestFilters
pFilters_
    }

-- | Request to filter Source Servers list by next token.
describeSourceServers_nextToken :: Lens.Lens' DescribeSourceServers (Prelude.Maybe Prelude.Text)
describeSourceServers_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeSourceServers -> f DescribeSourceServers
describeSourceServers_nextToken = (DescribeSourceServers -> Maybe Text)
-> (DescribeSourceServers -> Maybe Text -> DescribeSourceServers)
-> Lens
     DescribeSourceServers
     DescribeSourceServers
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSourceServers' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeSourceServers' :: DescribeSourceServers -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeSourceServers
s@DescribeSourceServers' {} Maybe Text
a -> DescribeSourceServers
s {$sel:nextToken:DescribeSourceServers' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeSourceServers)

-- | Request to filter Source Servers list by maximum results.
describeSourceServers_maxResults :: Lens.Lens' DescribeSourceServers (Prelude.Maybe Prelude.Natural)
describeSourceServers_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> DescribeSourceServers -> f DescribeSourceServers
describeSourceServers_maxResults = (DescribeSourceServers -> Maybe Natural)
-> (DescribeSourceServers
    -> Maybe Natural -> DescribeSourceServers)
-> Lens
     DescribeSourceServers
     DescribeSourceServers
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSourceServers' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:DescribeSourceServers' :: DescribeSourceServers -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: DescribeSourceServers
s@DescribeSourceServers' {} Maybe Natural
a -> DescribeSourceServers
s {$sel:maxResults:DescribeSourceServers' :: Maybe Natural
maxResults = Maybe Natural
a} :: DescribeSourceServers)

-- | Request to filter Source Servers list.
describeSourceServers_filters :: Lens.Lens' DescribeSourceServers DescribeSourceServersRequestFilters
describeSourceServers_filters :: (DescribeSourceServersRequestFilters
 -> f DescribeSourceServersRequestFilters)
-> DescribeSourceServers -> f DescribeSourceServers
describeSourceServers_filters = (DescribeSourceServers -> DescribeSourceServersRequestFilters)
-> (DescribeSourceServers
    -> DescribeSourceServersRequestFilters -> DescribeSourceServers)
-> Lens
     DescribeSourceServers
     DescribeSourceServers
     DescribeSourceServersRequestFilters
     DescribeSourceServersRequestFilters
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSourceServers' {DescribeSourceServersRequestFilters
filters :: DescribeSourceServersRequestFilters
$sel:filters:DescribeSourceServers' :: DescribeSourceServers -> DescribeSourceServersRequestFilters
filters} -> DescribeSourceServersRequestFilters
filters) (\s :: DescribeSourceServers
s@DescribeSourceServers' {} DescribeSourceServersRequestFilters
a -> DescribeSourceServers
s {$sel:filters:DescribeSourceServers' :: DescribeSourceServersRequestFilters
filters = DescribeSourceServersRequestFilters
a} :: DescribeSourceServers)

instance Core.AWSPager DescribeSourceServers where
  page :: DescribeSourceServers
-> AWSResponse DescribeSourceServers -> Maybe DescribeSourceServers
page DescribeSourceServers
rq AWSResponse DescribeSourceServers
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeSourceServers
DescribeSourceServersResponse
rs
            DescribeSourceServersResponse
-> Getting (First Text) DescribeSourceServersResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeSourceServersResponse
-> Const (First Text) DescribeSourceServersResponse
Lens' DescribeSourceServersResponse (Maybe Text)
describeSourceServersResponse_nextToken
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeSourceServersResponse
 -> Const (First Text) DescribeSourceServersResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeSourceServersResponse 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 DescribeSourceServers
forall a. Maybe a
Prelude.Nothing
    | Maybe [SourceServer] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeSourceServers
DescribeSourceServersResponse
rs
            DescribeSourceServersResponse
-> Getting
     (First [SourceServer]) DescribeSourceServersResponse [SourceServer]
-> Maybe [SourceServer]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [SourceServer]
 -> Const (First [SourceServer]) (Maybe [SourceServer]))
-> DescribeSourceServersResponse
-> Const (First [SourceServer]) DescribeSourceServersResponse
Lens' DescribeSourceServersResponse (Maybe [SourceServer])
describeSourceServersResponse_items
              ((Maybe [SourceServer]
  -> Const (First [SourceServer]) (Maybe [SourceServer]))
 -> DescribeSourceServersResponse
 -> Const (First [SourceServer]) DescribeSourceServersResponse)
-> (([SourceServer] -> Const (First [SourceServer]) [SourceServer])
    -> Maybe [SourceServer]
    -> Const (First [SourceServer]) (Maybe [SourceServer]))
-> Getting
     (First [SourceServer]) DescribeSourceServersResponse [SourceServer]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([SourceServer] -> Const (First [SourceServer]) [SourceServer])
-> Maybe [SourceServer]
-> Const (First [SourceServer]) (Maybe [SourceServer])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeSourceServers
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeSourceServers -> Maybe DescribeSourceServers
forall a. a -> Maybe a
Prelude.Just (DescribeSourceServers -> Maybe DescribeSourceServers)
-> DescribeSourceServers -> Maybe DescribeSourceServers
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeSourceServers
rq
          DescribeSourceServers
-> (DescribeSourceServers -> DescribeSourceServers)
-> DescribeSourceServers
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeSourceServers -> Identity DescribeSourceServers
Lens
  DescribeSourceServers
  DescribeSourceServers
  (Maybe Text)
  (Maybe Text)
describeSourceServers_nextToken
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeSourceServers -> Identity DescribeSourceServers)
-> Maybe Text -> DescribeSourceServers -> DescribeSourceServers
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeSourceServers
DescribeSourceServersResponse
rs
          DescribeSourceServersResponse
-> Getting (First Text) DescribeSourceServersResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeSourceServersResponse
-> Const (First Text) DescribeSourceServersResponse
Lens' DescribeSourceServersResponse (Maybe Text)
describeSourceServersResponse_nextToken
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeSourceServersResponse
 -> Const (First Text) DescribeSourceServersResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeSourceServersResponse 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 DescribeSourceServers where
  type
    AWSResponse DescribeSourceServers =
      DescribeSourceServersResponse
  request :: DescribeSourceServers -> Request DescribeSourceServers
request = Service -> DescribeSourceServers -> Request DescribeSourceServers
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeSourceServers
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeSourceServers)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse DescribeSourceServers))
-> Logger
-> Service
-> Proxy DescribeSourceServers
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeSourceServers)))
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 [SourceServer]
-> Maybe Text -> Int -> DescribeSourceServersResponse
DescribeSourceServersResponse'
            (Maybe [SourceServer]
 -> Maybe Text -> Int -> DescribeSourceServersResponse)
-> Either String (Maybe [SourceServer])
-> Either
     String (Maybe Text -> Int -> DescribeSourceServersResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe [SourceServer]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"items" Either String (Maybe (Maybe [SourceServer]))
-> Maybe [SourceServer] -> Either String (Maybe [SourceServer])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [SourceServer]
forall a. Monoid a => a
Prelude.mempty)
            Either String (Maybe Text -> Int -> DescribeSourceServersResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeSourceServersResponse)
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 -> DescribeSourceServersResponse)
-> Either String Int -> Either String DescribeSourceServersResponse
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 DescribeSourceServers

instance Prelude.NFData DescribeSourceServers

instance Core.ToHeaders DescribeSourceServers where
  toHeaders :: DescribeSourceServers -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeSourceServers -> 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.ToJSON DescribeSourceServers where
  toJSON :: DescribeSourceServers -> Value
toJSON DescribeSourceServers' {Maybe Natural
Maybe Text
DescribeSourceServersRequestFilters
filters :: DescribeSourceServersRequestFilters
maxResults :: Maybe Natural
nextToken :: Maybe Text
$sel:filters:DescribeSourceServers' :: DescribeSourceServers -> DescribeSourceServersRequestFilters
$sel:maxResults:DescribeSourceServers' :: DescribeSourceServers -> Maybe Natural
$sel:nextToken:DescribeSourceServers' :: DescribeSourceServers -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"nextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"maxResults" Text -> 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,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"filters" Text -> DescribeSourceServersRequestFilters -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DescribeSourceServersRequestFilters
filters)
          ]
      )

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

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

-- | /See:/ 'newDescribeSourceServersResponse' smart constructor.
data DescribeSourceServersResponse = DescribeSourceServersResponse'
  { -- | Request to filter Source Servers list by item.
    DescribeSourceServersResponse -> Maybe [SourceServer]
items :: Prelude.Maybe [SourceServer],
    -- | Request to filter Source Servers next token.
    DescribeSourceServersResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeSourceServersResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeSourceServersResponse
-> DescribeSourceServersResponse -> Bool
(DescribeSourceServersResponse
 -> DescribeSourceServersResponse -> Bool)
-> (DescribeSourceServersResponse
    -> DescribeSourceServersResponse -> Bool)
-> Eq DescribeSourceServersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeSourceServersResponse
-> DescribeSourceServersResponse -> Bool
$c/= :: DescribeSourceServersResponse
-> DescribeSourceServersResponse -> Bool
== :: DescribeSourceServersResponse
-> DescribeSourceServersResponse -> Bool
$c== :: DescribeSourceServersResponse
-> DescribeSourceServersResponse -> Bool
Prelude.Eq, Int -> DescribeSourceServersResponse -> ShowS
[DescribeSourceServersResponse] -> ShowS
DescribeSourceServersResponse -> String
(Int -> DescribeSourceServersResponse -> ShowS)
-> (DescribeSourceServersResponse -> String)
-> ([DescribeSourceServersResponse] -> ShowS)
-> Show DescribeSourceServersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeSourceServersResponse] -> ShowS
$cshowList :: [DescribeSourceServersResponse] -> ShowS
show :: DescribeSourceServersResponse -> String
$cshow :: DescribeSourceServersResponse -> String
showsPrec :: Int -> DescribeSourceServersResponse -> ShowS
$cshowsPrec :: Int -> DescribeSourceServersResponse -> ShowS
Prelude.Show, (forall x.
 DescribeSourceServersResponse
 -> Rep DescribeSourceServersResponse x)
-> (forall x.
    Rep DescribeSourceServersResponse x
    -> DescribeSourceServersResponse)
-> Generic DescribeSourceServersResponse
forall x.
Rep DescribeSourceServersResponse x
-> DescribeSourceServersResponse
forall x.
DescribeSourceServersResponse
-> Rep DescribeSourceServersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeSourceServersResponse x
-> DescribeSourceServersResponse
$cfrom :: forall x.
DescribeSourceServersResponse
-> Rep DescribeSourceServersResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeSourceServersResponse' 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:
--
-- 'items', 'describeSourceServersResponse_items' - Request to filter Source Servers list by item.
--
-- 'nextToken', 'describeSourceServersResponse_nextToken' - Request to filter Source Servers next token.
--
-- 'httpStatus', 'describeSourceServersResponse_httpStatus' - The response's http status code.
newDescribeSourceServersResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeSourceServersResponse
newDescribeSourceServersResponse :: Int -> DescribeSourceServersResponse
newDescribeSourceServersResponse Int
pHttpStatus_ =
  DescribeSourceServersResponse' :: Maybe [SourceServer]
-> Maybe Text -> Int -> DescribeSourceServersResponse
DescribeSourceServersResponse'
    { $sel:items:DescribeSourceServersResponse' :: Maybe [SourceServer]
items =
        Maybe [SourceServer]
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:DescribeSourceServersResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeSourceServersResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Request to filter Source Servers list by item.
describeSourceServersResponse_items :: Lens.Lens' DescribeSourceServersResponse (Prelude.Maybe [SourceServer])
describeSourceServersResponse_items :: (Maybe [SourceServer] -> f (Maybe [SourceServer]))
-> DescribeSourceServersResponse -> f DescribeSourceServersResponse
describeSourceServersResponse_items = (DescribeSourceServersResponse -> Maybe [SourceServer])
-> (DescribeSourceServersResponse
    -> Maybe [SourceServer] -> DescribeSourceServersResponse)
-> Lens' DescribeSourceServersResponse (Maybe [SourceServer])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSourceServersResponse' {Maybe [SourceServer]
items :: Maybe [SourceServer]
$sel:items:DescribeSourceServersResponse' :: DescribeSourceServersResponse -> Maybe [SourceServer]
items} -> Maybe [SourceServer]
items) (\s :: DescribeSourceServersResponse
s@DescribeSourceServersResponse' {} Maybe [SourceServer]
a -> DescribeSourceServersResponse
s {$sel:items:DescribeSourceServersResponse' :: Maybe [SourceServer]
items = Maybe [SourceServer]
a} :: DescribeSourceServersResponse) ((Maybe [SourceServer] -> f (Maybe [SourceServer]))
 -> DescribeSourceServersResponse
 -> f DescribeSourceServersResponse)
-> ((Maybe [SourceServer] -> f (Maybe [SourceServer]))
    -> Maybe [SourceServer] -> f (Maybe [SourceServer]))
-> (Maybe [SourceServer] -> f (Maybe [SourceServer]))
-> DescribeSourceServersResponse
-> f DescribeSourceServersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [SourceServer] [SourceServer] [SourceServer] [SourceServer]
-> Iso
     (Maybe [SourceServer])
     (Maybe [SourceServer])
     (Maybe [SourceServer])
     (Maybe [SourceServer])
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 [SourceServer] [SourceServer] [SourceServer] [SourceServer]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Request to filter Source Servers next token.
describeSourceServersResponse_nextToken :: Lens.Lens' DescribeSourceServersResponse (Prelude.Maybe Prelude.Text)
describeSourceServersResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeSourceServersResponse -> f DescribeSourceServersResponse
describeSourceServersResponse_nextToken = (DescribeSourceServersResponse -> Maybe Text)
-> (DescribeSourceServersResponse
    -> Maybe Text -> DescribeSourceServersResponse)
-> Lens' DescribeSourceServersResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeSourceServersResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeSourceServersResponse' :: DescribeSourceServersResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeSourceServersResponse
s@DescribeSourceServersResponse' {} Maybe Text
a -> DescribeSourceServersResponse
s {$sel:nextToken:DescribeSourceServersResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeSourceServersResponse)

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

instance Prelude.NFData DescribeSourceServersResponse