{-# 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.ElastiCache.DescribeUsers
-- 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)
--
-- Returns a list of users.
--
-- This operation returns paginated results.
module Amazonka.ElastiCache.DescribeUsers
  ( -- * Creating a Request
    DescribeUsers (..),
    newDescribeUsers,

    -- * Request Lenses
    describeUsers_filters,
    describeUsers_engine,
    describeUsers_userId,
    describeUsers_marker,
    describeUsers_maxRecords,

    -- * Destructuring the Response
    DescribeUsersResponse (..),
    newDescribeUsersResponse,

    -- * Response Lenses
    describeUsersResponse_users,
    describeUsersResponse_marker,
    describeUsersResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.ElastiCache.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:/ 'newDescribeUsers' smart constructor.
data DescribeUsers = DescribeUsers'
  { -- | Filter to determine the list of User IDs to return.
    DescribeUsers -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | The Redis engine.
    DescribeUsers -> Maybe Text
engine :: Prelude.Maybe Prelude.Text,
    -- | The ID of the user.
    DescribeUsers -> Maybe Text
userId :: Prelude.Maybe Prelude.Text,
    -- | An optional marker returned from a prior request. Use this marker for
    -- pagination of results from this operation. If this parameter is
    -- specified, the response includes only records beyond the marker, up to
    -- the value specified by MaxRecords. >
    DescribeUsers -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of records to include in the response. If more
    -- records exist than the specified MaxRecords value, a marker is included
    -- in the response so that the remaining results can be retrieved.
    DescribeUsers -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int
  }
  deriving (DescribeUsers -> DescribeUsers -> Bool
(DescribeUsers -> DescribeUsers -> Bool)
-> (DescribeUsers -> DescribeUsers -> Bool) -> Eq DescribeUsers
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeUsers -> DescribeUsers -> Bool
$c/= :: DescribeUsers -> DescribeUsers -> Bool
== :: DescribeUsers -> DescribeUsers -> Bool
$c== :: DescribeUsers -> DescribeUsers -> Bool
Prelude.Eq, ReadPrec [DescribeUsers]
ReadPrec DescribeUsers
Int -> ReadS DescribeUsers
ReadS [DescribeUsers]
(Int -> ReadS DescribeUsers)
-> ReadS [DescribeUsers]
-> ReadPrec DescribeUsers
-> ReadPrec [DescribeUsers]
-> Read DescribeUsers
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeUsers]
$creadListPrec :: ReadPrec [DescribeUsers]
readPrec :: ReadPrec DescribeUsers
$creadPrec :: ReadPrec DescribeUsers
readList :: ReadS [DescribeUsers]
$creadList :: ReadS [DescribeUsers]
readsPrec :: Int -> ReadS DescribeUsers
$creadsPrec :: Int -> ReadS DescribeUsers
Prelude.Read, Int -> DescribeUsers -> ShowS
[DescribeUsers] -> ShowS
DescribeUsers -> String
(Int -> DescribeUsers -> ShowS)
-> (DescribeUsers -> String)
-> ([DescribeUsers] -> ShowS)
-> Show DescribeUsers
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeUsers] -> ShowS
$cshowList :: [DescribeUsers] -> ShowS
show :: DescribeUsers -> String
$cshow :: DescribeUsers -> String
showsPrec :: Int -> DescribeUsers -> ShowS
$cshowsPrec :: Int -> DescribeUsers -> ShowS
Prelude.Show, (forall x. DescribeUsers -> Rep DescribeUsers x)
-> (forall x. Rep DescribeUsers x -> DescribeUsers)
-> Generic DescribeUsers
forall x. Rep DescribeUsers x -> DescribeUsers
forall x. DescribeUsers -> Rep DescribeUsers x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeUsers x -> DescribeUsers
$cfrom :: forall x. DescribeUsers -> Rep DescribeUsers x
Prelude.Generic)

-- |
-- Create a value of 'DescribeUsers' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'filters', 'describeUsers_filters' - Filter to determine the list of User IDs to return.
--
-- 'engine', 'describeUsers_engine' - The Redis engine.
--
-- 'userId', 'describeUsers_userId' - The ID of the user.
--
-- 'marker', 'describeUsers_marker' - An optional marker returned from a prior request. Use this marker for
-- pagination of results from this operation. If this parameter is
-- specified, the response includes only records beyond the marker, up to
-- the value specified by MaxRecords. >
--
-- 'maxRecords', 'describeUsers_maxRecords' - The maximum number of records to include in the response. If more
-- records exist than the specified MaxRecords value, a marker is included
-- in the response so that the remaining results can be retrieved.
newDescribeUsers ::
  DescribeUsers
newDescribeUsers :: DescribeUsers
newDescribeUsers =
  DescribeUsers' :: Maybe [Filter]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Int
-> DescribeUsers
DescribeUsers'
    { $sel:filters:DescribeUsers' :: Maybe [Filter]
filters = Maybe [Filter]
forall a. Maybe a
Prelude.Nothing,
      $sel:engine:DescribeUsers' :: Maybe Text
engine = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:userId:DescribeUsers' :: Maybe Text
userId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeUsers' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeUsers' :: Maybe Int
maxRecords = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | Filter to determine the list of User IDs to return.
describeUsers_filters :: Lens.Lens' DescribeUsers (Prelude.Maybe [Filter])
describeUsers_filters :: (Maybe [Filter] -> f (Maybe [Filter]))
-> DescribeUsers -> f DescribeUsers
describeUsers_filters = (DescribeUsers -> Maybe [Filter])
-> (DescribeUsers -> Maybe [Filter] -> DescribeUsers)
-> Lens
     DescribeUsers DescribeUsers (Maybe [Filter]) (Maybe [Filter])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUsers' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:DescribeUsers' :: DescribeUsers -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: DescribeUsers
s@DescribeUsers' {} Maybe [Filter]
a -> DescribeUsers
s {$sel:filters:DescribeUsers' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: DescribeUsers) ((Maybe [Filter] -> f (Maybe [Filter]))
 -> DescribeUsers -> f DescribeUsers)
-> ((Maybe [Filter] -> f (Maybe [Filter]))
    -> Maybe [Filter] -> f (Maybe [Filter]))
-> (Maybe [Filter] -> f (Maybe [Filter]))
-> DescribeUsers
-> f DescribeUsers
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Filter] [Filter] [Filter] [Filter]
-> Iso
     (Maybe [Filter]) (Maybe [Filter]) (Maybe [Filter]) (Maybe [Filter])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Filter] [Filter] [Filter] [Filter]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The Redis engine.
describeUsers_engine :: Lens.Lens' DescribeUsers (Prelude.Maybe Prelude.Text)
describeUsers_engine :: (Maybe Text -> f (Maybe Text)) -> DescribeUsers -> f DescribeUsers
describeUsers_engine = (DescribeUsers -> Maybe Text)
-> (DescribeUsers -> Maybe Text -> DescribeUsers)
-> Lens DescribeUsers DescribeUsers (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUsers' {Maybe Text
engine :: Maybe Text
$sel:engine:DescribeUsers' :: DescribeUsers -> Maybe Text
engine} -> Maybe Text
engine) (\s :: DescribeUsers
s@DescribeUsers' {} Maybe Text
a -> DescribeUsers
s {$sel:engine:DescribeUsers' :: Maybe Text
engine = Maybe Text
a} :: DescribeUsers)

-- | The ID of the user.
describeUsers_userId :: Lens.Lens' DescribeUsers (Prelude.Maybe Prelude.Text)
describeUsers_userId :: (Maybe Text -> f (Maybe Text)) -> DescribeUsers -> f DescribeUsers
describeUsers_userId = (DescribeUsers -> Maybe Text)
-> (DescribeUsers -> Maybe Text -> DescribeUsers)
-> Lens DescribeUsers DescribeUsers (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUsers' {Maybe Text
userId :: Maybe Text
$sel:userId:DescribeUsers' :: DescribeUsers -> Maybe Text
userId} -> Maybe Text
userId) (\s :: DescribeUsers
s@DescribeUsers' {} Maybe Text
a -> DescribeUsers
s {$sel:userId:DescribeUsers' :: Maybe Text
userId = Maybe Text
a} :: DescribeUsers)

-- | An optional marker returned from a prior request. Use this marker for
-- pagination of results from this operation. If this parameter is
-- specified, the response includes only records beyond the marker, up to
-- the value specified by MaxRecords. >
describeUsers_marker :: Lens.Lens' DescribeUsers (Prelude.Maybe Prelude.Text)
describeUsers_marker :: (Maybe Text -> f (Maybe Text)) -> DescribeUsers -> f DescribeUsers
describeUsers_marker = (DescribeUsers -> Maybe Text)
-> (DescribeUsers -> Maybe Text -> DescribeUsers)
-> Lens DescribeUsers DescribeUsers (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUsers' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeUsers' :: DescribeUsers -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeUsers
s@DescribeUsers' {} Maybe Text
a -> DescribeUsers
s {$sel:marker:DescribeUsers' :: Maybe Text
marker = Maybe Text
a} :: DescribeUsers)

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

instance Core.AWSPager DescribeUsers where
  page :: DescribeUsers -> AWSResponse DescribeUsers -> Maybe DescribeUsers
page DescribeUsers
rq AWSResponse DescribeUsers
rs
    | Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeUsers
DescribeUsersResponse
rs
            DescribeUsersResponse
-> Getting (First Text) DescribeUsersResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeUsersResponse
-> Const (First Text) DescribeUsersResponse
Lens' DescribeUsersResponse (Maybe Text)
describeUsersResponse_marker ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeUsersResponse
 -> Const (First Text) DescribeUsersResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeUsersResponse 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 DescribeUsers
forall a. Maybe a
Prelude.Nothing
    | Maybe [User] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse DescribeUsers
DescribeUsersResponse
rs
            DescribeUsersResponse
-> Getting (First [User]) DescribeUsersResponse [User]
-> Maybe [User]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [User] -> Const (First [User]) (Maybe [User]))
-> DescribeUsersResponse
-> Const (First [User]) DescribeUsersResponse
Lens' DescribeUsersResponse (Maybe [User])
describeUsersResponse_users ((Maybe [User] -> Const (First [User]) (Maybe [User]))
 -> DescribeUsersResponse
 -> Const (First [User]) DescribeUsersResponse)
-> (([User] -> Const (First [User]) [User])
    -> Maybe [User] -> Const (First [User]) (Maybe [User]))
-> Getting (First [User]) DescribeUsersResponse [User]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([User] -> Const (First [User]) [User])
-> Maybe [User] -> Const (First [User]) (Maybe [User])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
      Maybe DescribeUsers
forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
      DescribeUsers -> Maybe DescribeUsers
forall a. a -> Maybe a
Prelude.Just (DescribeUsers -> Maybe DescribeUsers)
-> DescribeUsers -> Maybe DescribeUsers
forall a b. (a -> b) -> a -> b
Prelude.$
        DescribeUsers
rq
          DescribeUsers -> (DescribeUsers -> DescribeUsers) -> DescribeUsers
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> DescribeUsers -> Identity DescribeUsers
Lens DescribeUsers DescribeUsers (Maybe Text) (Maybe Text)
describeUsers_marker
          ((Maybe Text -> Identity (Maybe Text))
 -> DescribeUsers -> Identity DescribeUsers)
-> Maybe Text -> DescribeUsers -> DescribeUsers
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse DescribeUsers
DescribeUsersResponse
rs
          DescribeUsersResponse
-> Getting (First Text) DescribeUsersResponse Text -> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> DescribeUsersResponse
-> Const (First Text) DescribeUsersResponse
Lens' DescribeUsersResponse (Maybe Text)
describeUsersResponse_marker ((Maybe Text -> Const (First Text) (Maybe Text))
 -> DescribeUsersResponse
 -> Const (First Text) DescribeUsersResponse)
-> ((Text -> Const (First Text) Text)
    -> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) DescribeUsersResponse 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 DescribeUsers where
  type
    AWSResponse DescribeUsers =
      DescribeUsersResponse
  request :: DescribeUsers -> Request DescribeUsers
request = Service -> DescribeUsers -> Request DescribeUsers
forall a. ToRequest a => Service -> a -> Request a
Request.postQuery Service
defaultService
  response :: Logger
-> Service
-> Proxy DescribeUsers
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeUsers)))
response =
    Text
-> (Int
    -> ResponseHeaders
    -> [Node]
    -> Either String (AWSResponse DescribeUsers))
-> Logger
-> Service
-> Proxy DescribeUsers
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DescribeUsers)))
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
"DescribeUsersResult"
      ( \Int
s ResponseHeaders
h [Node]
x ->
          Maybe [User] -> Maybe Text -> Int -> DescribeUsersResponse
DescribeUsersResponse'
            (Maybe [User] -> Maybe Text -> Int -> DescribeUsersResponse)
-> Either String (Maybe [User])
-> Either String (Maybe Text -> Int -> DescribeUsersResponse)
forall (f :: * -> *) a b. Functor 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
"Users" 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 [User]))
-> Either String (Maybe [User])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [User])
-> [Node] -> Either String (Maybe [User])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [User]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
                        )
            Either String (Maybe Text -> Int -> DescribeUsersResponse)
-> Either String (Maybe Text)
-> Either String (Int -> DescribeUsersResponse)
forall (f :: * -> *) a b. Applicative f => 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
"Marker")
            Either String (Int -> DescribeUsersResponse)
-> Either String Int -> Either String DescribeUsersResponse
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 DescribeUsers

instance Prelude.NFData DescribeUsers

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

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

instance Core.ToQuery DescribeUsers where
  toQuery :: DescribeUsers -> QueryString
toQuery DescribeUsers' {Maybe Int
Maybe [Filter]
Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
userId :: Maybe Text
engine :: Maybe Text
filters :: Maybe [Filter]
$sel:maxRecords:DescribeUsers' :: DescribeUsers -> Maybe Int
$sel:marker:DescribeUsers' :: DescribeUsers -> Maybe Text
$sel:userId:DescribeUsers' :: DescribeUsers -> Maybe Text
$sel:engine:DescribeUsers' :: DescribeUsers -> Maybe Text
$sel:filters:DescribeUsers' :: DescribeUsers -> Maybe [Filter]
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"Action"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"DescribeUsers" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2015-02-02" :: Prelude.ByteString),
        ByteString
"Filters"
          ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
            (ByteString -> [Filter] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" ([Filter] -> QueryString) -> Maybe [Filter] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters),
        ByteString
"Engine" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
engine,
        ByteString
"UserId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
userId,
        ByteString
"Marker" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
marker,
        ByteString
"MaxRecords" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
maxRecords
      ]

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

-- |
-- Create a value of 'DescribeUsersResponse' 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:
--
-- 'users', 'describeUsersResponse_users' - A list of users.
--
-- 'marker', 'describeUsersResponse_marker' - An optional marker returned from a prior request. Use this marker for
-- pagination of results from this operation. If this parameter is
-- specified, the response includes only records beyond the marker, up to
-- the value specified by MaxRecords. >
--
-- 'httpStatus', 'describeUsersResponse_httpStatus' - The response's http status code.
newDescribeUsersResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeUsersResponse
newDescribeUsersResponse :: Int -> DescribeUsersResponse
newDescribeUsersResponse Int
pHttpStatus_ =
  DescribeUsersResponse' :: Maybe [User] -> Maybe Text -> Int -> DescribeUsersResponse
DescribeUsersResponse'
    { $sel:users:DescribeUsersResponse' :: Maybe [User]
users = Maybe [User]
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeUsersResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeUsersResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of users.
describeUsersResponse_users :: Lens.Lens' DescribeUsersResponse (Prelude.Maybe [User])
describeUsersResponse_users :: (Maybe [User] -> f (Maybe [User]))
-> DescribeUsersResponse -> f DescribeUsersResponse
describeUsersResponse_users = (DescribeUsersResponse -> Maybe [User])
-> (DescribeUsersResponse -> Maybe [User] -> DescribeUsersResponse)
-> Lens' DescribeUsersResponse (Maybe [User])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUsersResponse' {Maybe [User]
users :: Maybe [User]
$sel:users:DescribeUsersResponse' :: DescribeUsersResponse -> Maybe [User]
users} -> Maybe [User]
users) (\s :: DescribeUsersResponse
s@DescribeUsersResponse' {} Maybe [User]
a -> DescribeUsersResponse
s {$sel:users:DescribeUsersResponse' :: Maybe [User]
users = Maybe [User]
a} :: DescribeUsersResponse) ((Maybe [User] -> f (Maybe [User]))
 -> DescribeUsersResponse -> f DescribeUsersResponse)
-> ((Maybe [User] -> f (Maybe [User]))
    -> Maybe [User] -> f (Maybe [User]))
-> (Maybe [User] -> f (Maybe [User]))
-> DescribeUsersResponse
-> f DescribeUsersResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [User] [User] [User] [User]
-> Iso (Maybe [User]) (Maybe [User]) (Maybe [User]) (Maybe [User])
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 [User] [User] [User] [User]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | An optional marker returned from a prior request. Use this marker for
-- pagination of results from this operation. If this parameter is
-- specified, the response includes only records beyond the marker, up to
-- the value specified by MaxRecords. >
describeUsersResponse_marker :: Lens.Lens' DescribeUsersResponse (Prelude.Maybe Prelude.Text)
describeUsersResponse_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeUsersResponse -> f DescribeUsersResponse
describeUsersResponse_marker = (DescribeUsersResponse -> Maybe Text)
-> (DescribeUsersResponse -> Maybe Text -> DescribeUsersResponse)
-> Lens' DescribeUsersResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUsersResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeUsersResponse' :: DescribeUsersResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeUsersResponse
s@DescribeUsersResponse' {} Maybe Text
a -> DescribeUsersResponse
s {$sel:marker:DescribeUsersResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeUsersResponse)

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

instance Prelude.NFData DescribeUsersResponse