{-# 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.ELBV2.DescribeListeners
-- 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 specified listeners or the listeners for the specified
-- Application Load Balancer, Network Load Balancer, or Gateway Load
-- Balancer. You must specify either a load balancer or one or more
-- listeners.
--
-- This operation returns paginated results.
module Amazonka.ELBV2.DescribeListeners
  ( -- * Creating a Request
    DescribeListeners (..),
    newDescribeListeners,

    -- * Request Lenses
    describeListeners_listenerArns,
    describeListeners_loadBalancerArn,
    describeListeners_marker,
    describeListeners_pageSize,

    -- * Destructuring the Response
    DescribeListenersResponse (..),
    newDescribeListenersResponse,

    -- * Response Lenses
    describeListenersResponse_nextMarker,
    describeListenersResponse_listeners,
    describeListenersResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.ELBV2.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:/ 'newDescribeListeners' smart constructor.
data DescribeListeners = DescribeListeners'
  { -- | The Amazon Resource Names (ARN) of the listeners.
    DescribeListeners -> Maybe [Text]
listenerArns :: Prelude.Maybe [Prelude.Text],
    -- | The Amazon Resource Name (ARN) of the load balancer.
    DescribeListeners -> Maybe Text
loadBalancerArn :: Prelude.Maybe Prelude.Text,
    -- | The marker for the next set of results. (You received this marker from a
    -- previous call.)
    DescribeListeners -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of results to return with this call.
    DescribeListeners -> Maybe Natural
pageSize :: Prelude.Maybe Prelude.Natural
  }
  deriving (DescribeListeners -> DescribeListeners -> Bool
(DescribeListeners -> DescribeListeners -> Bool)
-> (DescribeListeners -> DescribeListeners -> Bool)
-> Eq DescribeListeners
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeListeners -> DescribeListeners -> Bool
$c/= :: DescribeListeners -> DescribeListeners -> Bool
== :: DescribeListeners -> DescribeListeners -> Bool
$c== :: DescribeListeners -> DescribeListeners -> Bool
Prelude.Eq, ReadPrec [DescribeListeners]
ReadPrec DescribeListeners
Int -> ReadS DescribeListeners
ReadS [DescribeListeners]
(Int -> ReadS DescribeListeners)
-> ReadS [DescribeListeners]
-> ReadPrec DescribeListeners
-> ReadPrec [DescribeListeners]
-> Read DescribeListeners
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeListeners]
$creadListPrec :: ReadPrec [DescribeListeners]
readPrec :: ReadPrec DescribeListeners
$creadPrec :: ReadPrec DescribeListeners
readList :: ReadS [DescribeListeners]
$creadList :: ReadS [DescribeListeners]
readsPrec :: Int -> ReadS DescribeListeners
$creadsPrec :: Int -> ReadS DescribeListeners
Prelude.Read, Int -> DescribeListeners -> ShowS
[DescribeListeners] -> ShowS
DescribeListeners -> String
(Int -> DescribeListeners -> ShowS)
-> (DescribeListeners -> String)
-> ([DescribeListeners] -> ShowS)
-> Show DescribeListeners
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeListeners] -> ShowS
$cshowList :: [DescribeListeners] -> ShowS
show :: DescribeListeners -> String
$cshow :: DescribeListeners -> String
showsPrec :: Int -> DescribeListeners -> ShowS
$cshowsPrec :: Int -> DescribeListeners -> ShowS
Prelude.Show, (forall x. DescribeListeners -> Rep DescribeListeners x)
-> (forall x. Rep DescribeListeners x -> DescribeListeners)
-> Generic DescribeListeners
forall x. Rep DescribeListeners x -> DescribeListeners
forall x. DescribeListeners -> Rep DescribeListeners x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeListeners x -> DescribeListeners
$cfrom :: forall x. DescribeListeners -> Rep DescribeListeners x
Prelude.Generic)

-- |
-- Create a value of 'DescribeListeners' 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:
--
-- 'listenerArns', 'describeListeners_listenerArns' - The Amazon Resource Names (ARN) of the listeners.
--
-- 'loadBalancerArn', 'describeListeners_loadBalancerArn' - The Amazon Resource Name (ARN) of the load balancer.
--
-- 'marker', 'describeListeners_marker' - The marker for the next set of results. (You received this marker from a
-- previous call.)
--
-- 'pageSize', 'describeListeners_pageSize' - The maximum number of results to return with this call.
newDescribeListeners ::
  DescribeListeners
newDescribeListeners :: DescribeListeners
newDescribeListeners =
  DescribeListeners' :: Maybe [Text]
-> Maybe Text -> Maybe Text -> Maybe Natural -> DescribeListeners
DescribeListeners'
    { $sel:listenerArns:DescribeListeners' :: Maybe [Text]
listenerArns = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:loadBalancerArn:DescribeListeners' :: Maybe Text
loadBalancerArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeListeners' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:pageSize:DescribeListeners' :: Maybe Natural
pageSize = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Names (ARN) of the listeners.
describeListeners_listenerArns :: Lens.Lens' DescribeListeners (Prelude.Maybe [Prelude.Text])
describeListeners_listenerArns :: (Maybe [Text] -> f (Maybe [Text]))
-> DescribeListeners -> f DescribeListeners
describeListeners_listenerArns = (DescribeListeners -> Maybe [Text])
-> (DescribeListeners -> Maybe [Text] -> DescribeListeners)
-> Lens
     DescribeListeners DescribeListeners (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeListeners' {Maybe [Text]
listenerArns :: Maybe [Text]
$sel:listenerArns:DescribeListeners' :: DescribeListeners -> Maybe [Text]
listenerArns} -> Maybe [Text]
listenerArns) (\s :: DescribeListeners
s@DescribeListeners' {} Maybe [Text]
a -> DescribeListeners
s {$sel:listenerArns:DescribeListeners' :: Maybe [Text]
listenerArns = Maybe [Text]
a} :: DescribeListeners) ((Maybe [Text] -> f (Maybe [Text]))
 -> DescribeListeners -> f DescribeListeners)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> DescribeListeners
-> f DescribeListeners
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 Amazon Resource Name (ARN) of the load balancer.
describeListeners_loadBalancerArn :: Lens.Lens' DescribeListeners (Prelude.Maybe Prelude.Text)
describeListeners_loadBalancerArn :: (Maybe Text -> f (Maybe Text))
-> DescribeListeners -> f DescribeListeners
describeListeners_loadBalancerArn = (DescribeListeners -> Maybe Text)
-> (DescribeListeners -> Maybe Text -> DescribeListeners)
-> Lens
     DescribeListeners DescribeListeners (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeListeners' {Maybe Text
loadBalancerArn :: Maybe Text
$sel:loadBalancerArn:DescribeListeners' :: DescribeListeners -> Maybe Text
loadBalancerArn} -> Maybe Text
loadBalancerArn) (\s :: DescribeListeners
s@DescribeListeners' {} Maybe Text
a -> DescribeListeners
s {$sel:loadBalancerArn:DescribeListeners' :: Maybe Text
loadBalancerArn = Maybe Text
a} :: DescribeListeners)

-- | The marker for the next set of results. (You received this marker from a
-- previous call.)
describeListeners_marker :: Lens.Lens' DescribeListeners (Prelude.Maybe Prelude.Text)
describeListeners_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeListeners -> f DescribeListeners
describeListeners_marker = (DescribeListeners -> Maybe Text)
-> (DescribeListeners -> Maybe Text -> DescribeListeners)
-> Lens
     DescribeListeners DescribeListeners (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeListeners' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeListeners' :: DescribeListeners -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeListeners
s@DescribeListeners' {} Maybe Text
a -> DescribeListeners
s {$sel:marker:DescribeListeners' :: Maybe Text
marker = Maybe Text
a} :: DescribeListeners)

-- | The maximum number of results to return with this call.
describeListeners_pageSize :: Lens.Lens' DescribeListeners (Prelude.Maybe Prelude.Natural)
describeListeners_pageSize :: (Maybe Natural -> f (Maybe Natural))
-> DescribeListeners -> f DescribeListeners
describeListeners_pageSize = (DescribeListeners -> Maybe Natural)
-> (DescribeListeners -> Maybe Natural -> DescribeListeners)
-> Lens
     DescribeListeners DescribeListeners (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeListeners' {Maybe Natural
pageSize :: Maybe Natural
$sel:pageSize:DescribeListeners' :: DescribeListeners -> Maybe Natural
pageSize} -> Maybe Natural
pageSize) (\s :: DescribeListeners
s@DescribeListeners' {} Maybe Natural
a -> DescribeListeners
s {$sel:pageSize:DescribeListeners' :: Maybe Natural
pageSize = Maybe Natural
a} :: DescribeListeners)

instance Core.AWSPager DescribeListeners where
  page :: DescribeListeners
-> AWSResponse DescribeListeners -> Maybe DescribeListeners
page DescribeListeners
rq AWSResponse DescribeListeners
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeListeners
DescribeListenersResponse
rs
            DescribeListenersResponse
-> Getting (First Text) DescribeListenersResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeListenersResponse
-> Const (First Text) DescribeListenersResponse
Lens' DescribeListenersResponse (Maybe Text)
describeListenersResponse_nextMarker
              ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeListenersResponse
 -> Const (First Text) DescribeListenersResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeListenersResponse 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 DescribeListeners
forall a. Maybe a
Prelude.Nothing
    | Maybe [Listener] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeListeners
DescribeListenersResponse
rs
            DescribeListenersResponse
-> Getting (First [Listener]) DescribeListenersResponse [Listener]
-> Maybe [Listener]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [Listener] -> Const (First [Listener]) (Maybe [Listener]))
-> DescribeListenersResponse
-> Const (First [Listener]) DescribeListenersResponse
Lens' DescribeListenersResponse (Maybe [Listener])
describeListenersResponse_listeners
              ((Maybe [Listener] -> Const (First [Listener]) (Maybe [Listener]))
 -> DescribeListenersResponse
 -> Const (First [Listener]) DescribeListenersResponse)
-> (([Listener] -> Const (First [Listener]) [Listener])
    -> Maybe [Listener] -> Const (First [Listener]) (Maybe [Listener]))
-> Getting (First [Listener]) DescribeListenersResponse [Listener]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([Listener] -> Const (First [Listener]) [Listener])
-> Maybe [Listener] -> Const (First [Listener]) (Maybe [Listener])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeListeners
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeListeners -> Maybe DescribeListeners
forall a. a -> Maybe a
Prelude.Just (DescribeListeners -> Maybe DescribeListeners)
-> DescribeListeners -> Maybe DescribeListeners
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeListeners
rq
          DescribeListeners
-> (DescribeListeners -> DescribeListeners) -> DescribeListeners
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeListeners -> Identity DescribeListeners
Lens DescribeListeners DescribeListeners (Maybe Text) (Maybe Text)
describeListeners_marker
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeListeners -> Identity DescribeListeners)
-> Maybe Text -> DescribeListeners -> DescribeListeners
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeListeners
DescribeListenersResponse
rs
          DescribeListenersResponse
-> Getting (First Text) DescribeListenersResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeListenersResponse
-> Const (First Text) DescribeListenersResponse
Lens' DescribeListenersResponse (Maybe Text)
describeListenersResponse_nextMarker
            ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeListenersResponse
 -> Const (First Text) DescribeListenersResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeListenersResponse 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 DescribeListeners where
  type
    AWSResponse DescribeListeners =
      DescribeListenersResponse
  request :: DescribeListeners -> Request DescribeListeners
request = Service -> DescribeListeners -> Request DescribeListeners
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeListeners
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeListeners)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse DescribeListeners))
-> Logger
-> Service
-> Proxy DescribeListeners
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeListeners)))
forall (m :: * -> *) a.
MonadResource m =>
Text
-> (Int
    -> ResponseHeaders -> [Node] -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveXMLWrapper
      Text
"DescribeListenersResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe Text -> Maybe [Listener] -> Int -> DescribeListenersResponse
DescribeListenersResponse'
            (Maybe Text
 -> Maybe [Listener] -> Int -> DescribeListenersResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe [Listener] -> Int -> DescribeListenersResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"NextMarker")
            Either
  String (Maybe [Listener] -> Int -> DescribeListenersResponse)
-> Either String (Maybe [Listener])
-> Either String (Int -> DescribeListenersResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Listeners" Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
                            Either String [Node]
-> ([Node] -> Either String (Maybe [Listener]))
-> Either String (Maybe [Listener])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Listener])
-> [Node] -> Either String (Maybe [Listener])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Listener]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                        )
            Either String (Int -> DescribeListenersResponse)
-> Either String Int -> Either String DescribeListenersResponse
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 DescribeListeners

instance Prelude.NFData DescribeListeners

instance Core.ToHeaders DescribeListeners where
  toHeaders :: DescribeListeners -> ResponseHeaders
toHeaders = ResponseHeaders -> DescribeListeners -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

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

instance Core.ToQuery DescribeListeners where
  toQuery :: DescribeListeners -> QueryString
toQuery DescribeListeners' {Maybe Natural
Maybe [Text]
Maybe Text
pageSize :: Maybe Natural
marker :: Maybe Text
loadBalancerArn :: Maybe Text
listenerArns :: Maybe [Text]
$sel:pageSize:DescribeListeners' :: DescribeListeners -> Maybe Natural
$sel:marker:DescribeListeners' :: DescribeListeners -> Maybe Text
$sel:loadBalancerArn:DescribeListeners' :: DescribeListeners -> Maybe Text
$sel:listenerArns:DescribeListeners' :: DescribeListeners -> Maybe [Text]
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"DescribeListeners" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2015-12-01" :: Prelude.ByteString),
        ByteString
"ListenerArns"
          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]
listenerArns),
        ByteString
"LoadBalancerArn" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
loadBalancerArn,
        ByteString
"Marker" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
marker,
        ByteString
"PageSize" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
pageSize
      ]

-- | /See:/ 'newDescribeListenersResponse' smart constructor.
data DescribeListenersResponse = DescribeListenersResponse'
  { -- | If there are additional results, this is the marker for the next set of
    -- results. Otherwise, this is null.
    DescribeListenersResponse -> Maybe Text
nextMarker :: Prelude.Maybe Prelude.Text,
    -- | Information about the listeners.
    DescribeListenersResponse -> Maybe [Listener]
listeners :: Prelude.Maybe [Listener],
    -- | The response's http status code.
    DescribeListenersResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeListenersResponse -> DescribeListenersResponse -> Bool
(DescribeListenersResponse -> DescribeListenersResponse -> Bool)
-> (DescribeListenersResponse -> DescribeListenersResponse -> Bool)
-> Eq DescribeListenersResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeListenersResponse -> DescribeListenersResponse -> Bool
$c/= :: DescribeListenersResponse -> DescribeListenersResponse -> Bool
== :: DescribeListenersResponse -> DescribeListenersResponse -> Bool
$c== :: DescribeListenersResponse -> DescribeListenersResponse -> Bool
Prelude.Eq, ReadPrec [DescribeListenersResponse]
ReadPrec DescribeListenersResponse
Int -> ReadS DescribeListenersResponse
ReadS [DescribeListenersResponse]
(Int -> ReadS DescribeListenersResponse)
-> ReadS [DescribeListenersResponse]
-> ReadPrec DescribeListenersResponse
-> ReadPrec [DescribeListenersResponse]
-> Read DescribeListenersResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeListenersResponse]
$creadListPrec :: ReadPrec [DescribeListenersResponse]
readPrec :: ReadPrec DescribeListenersResponse
$creadPrec :: ReadPrec DescribeListenersResponse
readList :: ReadS [DescribeListenersResponse]
$creadList :: ReadS [DescribeListenersResponse]
readsPrec :: Int -> ReadS DescribeListenersResponse
$creadsPrec :: Int -> ReadS DescribeListenersResponse
Prelude.Read, Int -> DescribeListenersResponse -> ShowS
[DescribeListenersResponse] -> ShowS
DescribeListenersResponse -> String
(Int -> DescribeListenersResponse -> ShowS)
-> (DescribeListenersResponse -> String)
-> ([DescribeListenersResponse] -> ShowS)
-> Show DescribeListenersResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeListenersResponse] -> ShowS
$cshowList :: [DescribeListenersResponse] -> ShowS
show :: DescribeListenersResponse -> String
$cshow :: DescribeListenersResponse -> String
showsPrec :: Int -> DescribeListenersResponse -> ShowS
$cshowsPrec :: Int -> DescribeListenersResponse -> ShowS
Prelude.Show, (forall x.
 DescribeListenersResponse -> Rep DescribeListenersResponse x)
-> (forall x.
    Rep DescribeListenersResponse x -> DescribeListenersResponse)
-> Generic DescribeListenersResponse
forall x.
Rep DescribeListenersResponse x -> DescribeListenersResponse
forall x.
DescribeListenersResponse -> Rep DescribeListenersResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeListenersResponse x -> DescribeListenersResponse
$cfrom :: forall x.
DescribeListenersResponse -> Rep DescribeListenersResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeListenersResponse' 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:
--
-- 'nextMarker', 'describeListenersResponse_nextMarker' - If there are additional results, this is the marker for the next set of
-- results. Otherwise, this is null.
--
-- 'listeners', 'describeListenersResponse_listeners' - Information about the listeners.
--
-- 'httpStatus', 'describeListenersResponse_httpStatus' - The response's http status code.
newDescribeListenersResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeListenersResponse
newDescribeListenersResponse :: Int -> DescribeListenersResponse
newDescribeListenersResponse Int
pHttpStatus_ =
  DescribeListenersResponse' :: Maybe Text -> Maybe [Listener] -> Int -> DescribeListenersResponse
DescribeListenersResponse'
    { $sel:nextMarker:DescribeListenersResponse' :: Maybe Text
nextMarker =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:listeners:DescribeListenersResponse' :: Maybe [Listener]
listeners = Maybe [Listener]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeListenersResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | If there are additional results, this is the marker for the next set of
-- results. Otherwise, this is null.
describeListenersResponse_nextMarker :: Lens.Lens' DescribeListenersResponse (Prelude.Maybe Prelude.Text)
describeListenersResponse_nextMarker :: (Maybe Text -> f (Maybe Text))
-> DescribeListenersResponse -> f DescribeListenersResponse
describeListenersResponse_nextMarker = (DescribeListenersResponse -> Maybe Text)
-> (DescribeListenersResponse
    -> Maybe Text -> DescribeListenersResponse)
-> Lens' DescribeListenersResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeListenersResponse' {Maybe Text
nextMarker :: Maybe Text
$sel:nextMarker:DescribeListenersResponse' :: DescribeListenersResponse -> Maybe Text
nextMarker} -> Maybe Text
nextMarker) (\s :: DescribeListenersResponse
s@DescribeListenersResponse' {} Maybe Text
a -> DescribeListenersResponse
s {$sel:nextMarker:DescribeListenersResponse' :: Maybe Text
nextMarker = Maybe Text
a} :: DescribeListenersResponse)

-- | Information about the listeners.
describeListenersResponse_listeners :: Lens.Lens' DescribeListenersResponse (Prelude.Maybe [Listener])
describeListenersResponse_listeners :: (Maybe [Listener] -> f (Maybe [Listener]))
-> DescribeListenersResponse -> f DescribeListenersResponse
describeListenersResponse_listeners = (DescribeListenersResponse -> Maybe [Listener])
-> (DescribeListenersResponse
    -> Maybe [Listener] -> DescribeListenersResponse)
-> Lens' DescribeListenersResponse (Maybe [Listener])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeListenersResponse' {Maybe [Listener]
listeners :: Maybe [Listener]
$sel:listeners:DescribeListenersResponse' :: DescribeListenersResponse -> Maybe [Listener]
listeners} -> Maybe [Listener]
listeners) (\s :: DescribeListenersResponse
s@DescribeListenersResponse' {} Maybe [Listener]
a -> DescribeListenersResponse
s {$sel:listeners:DescribeListenersResponse' :: Maybe [Listener]
listeners = Maybe [Listener]
a} :: DescribeListenersResponse) ((Maybe [Listener] -> f (Maybe [Listener]))
 -> DescribeListenersResponse -> f DescribeListenersResponse)
-> ((Maybe [Listener] -> f (Maybe [Listener]))
    -> Maybe [Listener] -> f (Maybe [Listener]))
-> (Maybe [Listener] -> f (Maybe [Listener]))
-> DescribeListenersResponse
-> f DescribeListenersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Listener] [Listener] [Listener] [Listener]
-> Iso
     (Maybe [Listener])
     (Maybe [Listener])
     (Maybe [Listener])
     (Maybe [Listener])
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 [Listener] [Listener] [Listener] [Listener]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData DescribeListenersResponse