{-# 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.CloudWatchLogs.DescribeDestinations
-- 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)
--
-- Lists all your destinations. The results are ASCII-sorted by destination
-- name.
--
-- This operation returns paginated results.
module Amazonka.CloudWatchLogs.DescribeDestinations
  ( -- * Creating a Request
    DescribeDestinations (..),
    newDescribeDestinations,

    -- * Request Lenses
    describeDestinations_nextToken,
    describeDestinations_limit,
    describeDestinations_destinationNamePrefix,

    -- * Destructuring the Response
    DescribeDestinationsResponse (..),
    newDescribeDestinationsResponse,

    -- * Response Lenses
    describeDestinationsResponse_nextToken,
    describeDestinationsResponse_destinations,
    describeDestinationsResponse_httpStatus,
  )
where

import Amazonka.CloudWatchLogs.Types
import qualified Amazonka.Core as Core
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:/ 'newDescribeDestinations' smart constructor.
data DescribeDestinations = DescribeDestinations'
  { -- | The token for the next set of items to return. (You received this token
    -- from a previous call.)
    DescribeDestinations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of items returned. If you don\'t specify a value, the
    -- default is up to 50 items.
    DescribeDestinations -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
    -- | The prefix to match. If you don\'t specify a value, no prefix filter is
    -- applied.
    DescribeDestinations -> Maybe Text
destinationNamePrefix :: Prelude.Maybe Prelude.Text
  }
  deriving (DescribeDestinations -> DescribeDestinations -> Bool
(DescribeDestinations -> DescribeDestinations -> Bool)
-> (DescribeDestinations -> DescribeDestinations -> Bool)
-> Eq DescribeDestinations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDestinations -> DescribeDestinations -> Bool
$c/= :: DescribeDestinations -> DescribeDestinations -> Bool
== :: DescribeDestinations -> DescribeDestinations -> Bool
$c== :: DescribeDestinations -> DescribeDestinations -> Bool
Prelude.Eq, ReadPrec [DescribeDestinations]
ReadPrec DescribeDestinations
Int -> ReadS DescribeDestinations
ReadS [DescribeDestinations]
(Int -> ReadS DescribeDestinations)
-> ReadS [DescribeDestinations]
-> ReadPrec DescribeDestinations
-> ReadPrec [DescribeDestinations]
-> Read DescribeDestinations
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDestinations]
$creadListPrec :: ReadPrec [DescribeDestinations]
readPrec :: ReadPrec DescribeDestinations
$creadPrec :: ReadPrec DescribeDestinations
readList :: ReadS [DescribeDestinations]
$creadList :: ReadS [DescribeDestinations]
readsPrec :: Int -> ReadS DescribeDestinations
$creadsPrec :: Int -> ReadS DescribeDestinations
Prelude.Read, Int -> DescribeDestinations -> ShowS
[DescribeDestinations] -> ShowS
DescribeDestinations -> String
(Int -> DescribeDestinations -> ShowS)
-> (DescribeDestinations -> String)
-> ([DescribeDestinations] -> ShowS)
-> Show DescribeDestinations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDestinations] -> ShowS
$cshowList :: [DescribeDestinations] -> ShowS
show :: DescribeDestinations -> String
$cshow :: DescribeDestinations -> String
showsPrec :: Int -> DescribeDestinations -> ShowS
$cshowsPrec :: Int -> DescribeDestinations -> ShowS
Prelude.Show, (forall x. DescribeDestinations -> Rep DescribeDestinations x)
-> (forall x. Rep DescribeDestinations x -> DescribeDestinations)
-> Generic DescribeDestinations
forall x. Rep DescribeDestinations x -> DescribeDestinations
forall x. DescribeDestinations -> Rep DescribeDestinations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeDestinations x -> DescribeDestinations
$cfrom :: forall x. DescribeDestinations -> Rep DescribeDestinations x
Prelude.Generic)

-- |
-- Create a value of 'DescribeDestinations' 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', 'describeDestinations_nextToken' - The token for the next set of items to return. (You received this token
-- from a previous call.)
--
-- 'limit', 'describeDestinations_limit' - The maximum number of items returned. If you don\'t specify a value, the
-- default is up to 50 items.
--
-- 'destinationNamePrefix', 'describeDestinations_destinationNamePrefix' - The prefix to match. If you don\'t specify a value, no prefix filter is
-- applied.
newDescribeDestinations ::
  DescribeDestinations
newDescribeDestinations :: DescribeDestinations
newDescribeDestinations =
  DescribeDestinations' :: Maybe Text -> Maybe Natural -> Maybe Text -> DescribeDestinations
DescribeDestinations'
    { $sel:nextToken:DescribeDestinations' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:DescribeDestinations' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:destinationNamePrefix:DescribeDestinations' :: Maybe Text
destinationNamePrefix = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The token for the next set of items to return. (You received this token
-- from a previous call.)
describeDestinations_nextToken :: Lens.Lens' DescribeDestinations (Prelude.Maybe Prelude.Text)
describeDestinations_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeDestinations -> f DescribeDestinations
describeDestinations_nextToken = (DescribeDestinations -> Maybe Text)
-> (DescribeDestinations -> Maybe Text -> DescribeDestinations)
-> Lens
     DescribeDestinations DescribeDestinations (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDestinations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeDestinations' :: DescribeDestinations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeDestinations
s@DescribeDestinations' {} Maybe Text
a -> DescribeDestinations
s {$sel:nextToken:DescribeDestinations' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeDestinations)

-- | The maximum number of items returned. If you don\'t specify a value, the
-- default is up to 50 items.
describeDestinations_limit :: Lens.Lens' DescribeDestinations (Prelude.Maybe Prelude.Natural)
describeDestinations_limit :: (Maybe Natural -> f (Maybe Natural))
-> DescribeDestinations -> f DescribeDestinations
describeDestinations_limit = (DescribeDestinations -> Maybe Natural)
-> (DescribeDestinations -> Maybe Natural -> DescribeDestinations)
-> Lens
     DescribeDestinations
     DescribeDestinations
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDestinations' {Maybe Natural
limit :: Maybe Natural
$sel:limit:DescribeDestinations' :: DescribeDestinations -> Maybe Natural
limit} -> Maybe Natural
limit) (\s :: DescribeDestinations
s@DescribeDestinations' {} Maybe Natural
a -> DescribeDestinations
s {$sel:limit:DescribeDestinations' :: Maybe Natural
limit = Maybe Natural
a} :: DescribeDestinations)

-- | The prefix to match. If you don\'t specify a value, no prefix filter is
-- applied.
describeDestinations_destinationNamePrefix :: Lens.Lens' DescribeDestinations (Prelude.Maybe Prelude.Text)
describeDestinations_destinationNamePrefix :: (Maybe Text -> f (Maybe Text))
-> DescribeDestinations -> f DescribeDestinations
describeDestinations_destinationNamePrefix = (DescribeDestinations -> Maybe Text)
-> (DescribeDestinations -> Maybe Text -> DescribeDestinations)
-> Lens
     DescribeDestinations DescribeDestinations (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDestinations' {Maybe Text
destinationNamePrefix :: Maybe Text
$sel:destinationNamePrefix:DescribeDestinations' :: DescribeDestinations -> Maybe Text
destinationNamePrefix} -> Maybe Text
destinationNamePrefix) (\s :: DescribeDestinations
s@DescribeDestinations' {} Maybe Text
a -> DescribeDestinations
s {$sel:destinationNamePrefix:DescribeDestinations' :: Maybe Text
destinationNamePrefix = Maybe Text
a} :: DescribeDestinations)

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

instance Prelude.NFData DescribeDestinations

instance Core.ToHeaders DescribeDestinations where
  toHeaders :: DescribeDestinations -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DescribeDestinations -> 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
"Logs_20140328.DescribeDestinations" ::
                          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 DescribeDestinations where
  toJSON :: DescribeDestinations -> Value
toJSON DescribeDestinations' {Maybe Natural
Maybe Text
destinationNamePrefix :: Maybe Text
limit :: Maybe Natural
nextToken :: Maybe Text
$sel:destinationNamePrefix:DescribeDestinations' :: DescribeDestinations -> Maybe Text
$sel:limit:DescribeDestinations' :: DescribeDestinations -> Maybe Natural
$sel:nextToken:DescribeDestinations' :: DescribeDestinations -> 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
"limit" 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
limit,
            (Text
"DestinationNamePrefix" 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
destinationNamePrefix
          ]
      )

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

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

-- | /See:/ 'newDescribeDestinationsResponse' smart constructor.
data DescribeDestinationsResponse = DescribeDestinationsResponse'
  { DescribeDestinationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The destinations.
    DescribeDestinationsResponse -> Maybe [Destination]
destinations :: Prelude.Maybe [Destination],
    -- | The response's http status code.
    DescribeDestinationsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeDestinationsResponse
-> DescribeDestinationsResponse -> Bool
(DescribeDestinationsResponse
 -> DescribeDestinationsResponse -> Bool)
-> (DescribeDestinationsResponse
    -> DescribeDestinationsResponse -> Bool)
-> Eq DescribeDestinationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeDestinationsResponse
-> DescribeDestinationsResponse -> Bool
$c/= :: DescribeDestinationsResponse
-> DescribeDestinationsResponse -> Bool
== :: DescribeDestinationsResponse
-> DescribeDestinationsResponse -> Bool
$c== :: DescribeDestinationsResponse
-> DescribeDestinationsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeDestinationsResponse]
ReadPrec DescribeDestinationsResponse
Int -> ReadS DescribeDestinationsResponse
ReadS [DescribeDestinationsResponse]
(Int -> ReadS DescribeDestinationsResponse)
-> ReadS [DescribeDestinationsResponse]
-> ReadPrec DescribeDestinationsResponse
-> ReadPrec [DescribeDestinationsResponse]
-> Read DescribeDestinationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeDestinationsResponse]
$creadListPrec :: ReadPrec [DescribeDestinationsResponse]
readPrec :: ReadPrec DescribeDestinationsResponse
$creadPrec :: ReadPrec DescribeDestinationsResponse
readList :: ReadS [DescribeDestinationsResponse]
$creadList :: ReadS [DescribeDestinationsResponse]
readsPrec :: Int -> ReadS DescribeDestinationsResponse
$creadsPrec :: Int -> ReadS DescribeDestinationsResponse
Prelude.Read, Int -> DescribeDestinationsResponse -> ShowS
[DescribeDestinationsResponse] -> ShowS
DescribeDestinationsResponse -> String
(Int -> DescribeDestinationsResponse -> ShowS)
-> (DescribeDestinationsResponse -> String)
-> ([DescribeDestinationsResponse] -> ShowS)
-> Show DescribeDestinationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeDestinationsResponse] -> ShowS
$cshowList :: [DescribeDestinationsResponse] -> ShowS
show :: DescribeDestinationsResponse -> String
$cshow :: DescribeDestinationsResponse -> String
showsPrec :: Int -> DescribeDestinationsResponse -> ShowS
$cshowsPrec :: Int -> DescribeDestinationsResponse -> ShowS
Prelude.Show, (forall x.
 DescribeDestinationsResponse -> Rep DescribeDestinationsResponse x)
-> (forall x.
    Rep DescribeDestinationsResponse x -> DescribeDestinationsResponse)
-> Generic DescribeDestinationsResponse
forall x.
Rep DescribeDestinationsResponse x -> DescribeDestinationsResponse
forall x.
DescribeDestinationsResponse -> Rep DescribeDestinationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeDestinationsResponse x -> DescribeDestinationsResponse
$cfrom :: forall x.
DescribeDestinationsResponse -> Rep DescribeDestinationsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeDestinationsResponse' 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', 'describeDestinationsResponse_nextToken' - Undocumented member.
--
-- 'destinations', 'describeDestinationsResponse_destinations' - The destinations.
--
-- 'httpStatus', 'describeDestinationsResponse_httpStatus' - The response's http status code.
newDescribeDestinationsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeDestinationsResponse
newDescribeDestinationsResponse :: Int -> DescribeDestinationsResponse
newDescribeDestinationsResponse Int
pHttpStatus_ =
  DescribeDestinationsResponse' :: Maybe Text
-> Maybe [Destination] -> Int -> DescribeDestinationsResponse
DescribeDestinationsResponse'
    { $sel:nextToken:DescribeDestinationsResponse' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:destinations:DescribeDestinationsResponse' :: Maybe [Destination]
destinations = Maybe [Destination]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeDestinationsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Undocumented member.
describeDestinationsResponse_nextToken :: Lens.Lens' DescribeDestinationsResponse (Prelude.Maybe Prelude.Text)
describeDestinationsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> DescribeDestinationsResponse -> f DescribeDestinationsResponse
describeDestinationsResponse_nextToken = (DescribeDestinationsResponse -> Maybe Text)
-> (DescribeDestinationsResponse
    -> Maybe Text -> DescribeDestinationsResponse)
-> Lens' DescribeDestinationsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDestinationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:DescribeDestinationsResponse' :: DescribeDestinationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: DescribeDestinationsResponse
s@DescribeDestinationsResponse' {} Maybe Text
a -> DescribeDestinationsResponse
s {$sel:nextToken:DescribeDestinationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: DescribeDestinationsResponse)

-- | The destinations.
describeDestinationsResponse_destinations :: Lens.Lens' DescribeDestinationsResponse (Prelude.Maybe [Destination])
describeDestinationsResponse_destinations :: (Maybe [Destination] -> f (Maybe [Destination]))
-> DescribeDestinationsResponse -> f DescribeDestinationsResponse
describeDestinationsResponse_destinations = (DescribeDestinationsResponse -> Maybe [Destination])
-> (DescribeDestinationsResponse
    -> Maybe [Destination] -> DescribeDestinationsResponse)
-> Lens' DescribeDestinationsResponse (Maybe [Destination])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeDestinationsResponse' {Maybe [Destination]
destinations :: Maybe [Destination]
$sel:destinations:DescribeDestinationsResponse' :: DescribeDestinationsResponse -> Maybe [Destination]
destinations} -> Maybe [Destination]
destinations) (\s :: DescribeDestinationsResponse
s@DescribeDestinationsResponse' {} Maybe [Destination]
a -> DescribeDestinationsResponse
s {$sel:destinations:DescribeDestinationsResponse' :: Maybe [Destination]
destinations = Maybe [Destination]
a} :: DescribeDestinationsResponse) ((Maybe [Destination] -> f (Maybe [Destination]))
 -> DescribeDestinationsResponse -> f DescribeDestinationsResponse)
-> ((Maybe [Destination] -> f (Maybe [Destination]))
    -> Maybe [Destination] -> f (Maybe [Destination]))
-> (Maybe [Destination] -> f (Maybe [Destination]))
-> DescribeDestinationsResponse
-> f DescribeDestinationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Destination] [Destination] [Destination] [Destination]
-> Iso
     (Maybe [Destination])
     (Maybe [Destination])
     (Maybe [Destination])
     (Maybe [Destination])
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 [Destination] [Destination] [Destination] [Destination]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData DescribeDestinationsResponse