{-# 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.DescribeUserGroups
-- 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 user groups.
--
-- This operation returns paginated results.
module Amazonka.ElastiCache.DescribeUserGroups
  ( -- * Creating a Request
    DescribeUserGroups (..),
    newDescribeUserGroups,

    -- * Request Lenses
    describeUserGroups_userGroupId,
    describeUserGroups_marker,
    describeUserGroups_maxRecords,

    -- * Destructuring the Response
    DescribeUserGroupsResponse (..),
    newDescribeUserGroupsResponse,

    -- * Response Lenses
    describeUserGroupsResponse_userGroups,
    describeUserGroupsResponse_marker,
    describeUserGroupsResponse_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:/ 'newDescribeUserGroups' smart constructor.
data DescribeUserGroups = DescribeUserGroups'
  { -- | The ID of the user group.
    DescribeUserGroups -> Maybe Text
userGroupId :: 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. >
    DescribeUserGroups -> 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.
    DescribeUserGroups -> Maybe Int
maxRecords :: Prelude.Maybe Prelude.Int
  }
  deriving (DescribeUserGroups -> DescribeUserGroups -> Bool
(DescribeUserGroups -> DescribeUserGroups -> Bool)
-> (DescribeUserGroups -> DescribeUserGroups -> Bool)
-> Eq DescribeUserGroups
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeUserGroups -> DescribeUserGroups -> Bool
$c/= :: DescribeUserGroups -> DescribeUserGroups -> Bool
== :: DescribeUserGroups -> DescribeUserGroups -> Bool
$c== :: DescribeUserGroups -> DescribeUserGroups -> Bool
Prelude.Eq, ReadPrec [DescribeUserGroups]
ReadPrec DescribeUserGroups
Int -> ReadS DescribeUserGroups
ReadS [DescribeUserGroups]
(Int -> ReadS DescribeUserGroups)
-> ReadS [DescribeUserGroups]
-> ReadPrec DescribeUserGroups
-> ReadPrec [DescribeUserGroups]
-> Read DescribeUserGroups
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeUserGroups]
$creadListPrec :: ReadPrec [DescribeUserGroups]
readPrec :: ReadPrec DescribeUserGroups
$creadPrec :: ReadPrec DescribeUserGroups
readList :: ReadS [DescribeUserGroups]
$creadList :: ReadS [DescribeUserGroups]
readsPrec :: Int -> ReadS DescribeUserGroups
$creadsPrec :: Int -> ReadS DescribeUserGroups
Prelude.Read, Int -> DescribeUserGroups -> ShowS
[DescribeUserGroups] -> ShowS
DescribeUserGroups -> String
(Int -> DescribeUserGroups -> ShowS)
-> (DescribeUserGroups -> String)
-> ([DescribeUserGroups] -> ShowS)
-> Show DescribeUserGroups
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeUserGroups] -> ShowS
$cshowList :: [DescribeUserGroups] -> ShowS
show :: DescribeUserGroups -> String
$cshow :: DescribeUserGroups -> String
showsPrec :: Int -> DescribeUserGroups -> ShowS
$cshowsPrec :: Int -> DescribeUserGroups -> ShowS
Prelude.Show, (forall x. DescribeUserGroups -> Rep DescribeUserGroups x)
-> (forall x. Rep DescribeUserGroups x -> DescribeUserGroups)
-> Generic DescribeUserGroups
forall x. Rep DescribeUserGroups x -> DescribeUserGroups
forall x. DescribeUserGroups -> Rep DescribeUserGroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeUserGroups x -> DescribeUserGroups
$cfrom :: forall x. DescribeUserGroups -> Rep DescribeUserGroups x
Prelude.Generic)

-- |
-- Create a value of 'DescribeUserGroups' 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:
--
-- 'userGroupId', 'describeUserGroups_userGroupId' - The ID of the user group.
--
-- 'marker', 'describeUserGroups_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', 'describeUserGroups_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.
newDescribeUserGroups ::
  DescribeUserGroups
newDescribeUserGroups :: DescribeUserGroups
newDescribeUserGroups =
  DescribeUserGroups' :: Maybe Text -> Maybe Text -> Maybe Int -> DescribeUserGroups
DescribeUserGroups'
    { $sel:userGroupId:DescribeUserGroups' :: Maybe Text
userGroupId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeUserGroups' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:maxRecords:DescribeUserGroups' :: Maybe Int
maxRecords = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

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

-- | 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. >
describeUserGroups_marker :: Lens.Lens' DescribeUserGroups (Prelude.Maybe Prelude.Text)
describeUserGroups_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeUserGroups -> f DescribeUserGroups
describeUserGroups_marker = (DescribeUserGroups -> Maybe Text)
-> (DescribeUserGroups -> Maybe Text -> DescribeUserGroups)
-> Lens
     DescribeUserGroups DescribeUserGroups (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUserGroups' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeUserGroups' :: DescribeUserGroups -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeUserGroups
s@DescribeUserGroups' {} Maybe Text
a -> DescribeUserGroups
s {$sel:marker:DescribeUserGroups' :: Maybe Text
marker = Maybe Text
a} :: DescribeUserGroups)

-- | 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.
describeUserGroups_maxRecords :: Lens.Lens' DescribeUserGroups (Prelude.Maybe Prelude.Int)
describeUserGroups_maxRecords :: (Maybe Int -> f (Maybe Int))
-> DescribeUserGroups -> f DescribeUserGroups
describeUserGroups_maxRecords = (DescribeUserGroups -> Maybe Int)
-> (DescribeUserGroups -> Maybe Int -> DescribeUserGroups)
-> Lens
     DescribeUserGroups DescribeUserGroups (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUserGroups' {Maybe Int
maxRecords :: Maybe Int
$sel:maxRecords:DescribeUserGroups' :: DescribeUserGroups -> Maybe Int
maxRecords} -> Maybe Int
maxRecords) (\s :: DescribeUserGroups
s@DescribeUserGroups' {} Maybe Int
a -> DescribeUserGroups
s {$sel:maxRecords:DescribeUserGroups' :: Maybe Int
maxRecords = Maybe Int
a} :: DescribeUserGroups)

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

instance Prelude.NFData DescribeUserGroups

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

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

instance Core.ToQuery DescribeUserGroups where
  toQuery :: DescribeUserGroups -> QueryString
toQuery DescribeUserGroups' {Maybe Int
Maybe Text
maxRecords :: Maybe Int
marker :: Maybe Text
userGroupId :: Maybe Text
$sel:maxRecords:DescribeUserGroups' :: DescribeUserGroups -> Maybe Int
$sel:marker:DescribeUserGroups' :: DescribeUserGroups -> Maybe Text
$sel:userGroupId:DescribeUserGroups' :: DescribeUserGroups -> 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
"DescribeUserGroups" :: Prelude.ByteString),
        ByteString
"Version"
          ByteString -> ByteString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: (ByteString
"2015-02-02" :: Prelude.ByteString),
        ByteString
"UserGroupId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
userGroupId,
        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:/ 'newDescribeUserGroupsResponse' smart constructor.
data DescribeUserGroupsResponse = DescribeUserGroupsResponse'
  { -- | Returns a list of user groups.
    DescribeUserGroupsResponse -> Maybe [UserGroup]
userGroups :: Prelude.Maybe [UserGroup],
    -- | 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. >
    DescribeUserGroupsResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeUserGroupsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeUserGroupsResponse -> DescribeUserGroupsResponse -> Bool
(DescribeUserGroupsResponse -> DescribeUserGroupsResponse -> Bool)
-> (DescribeUserGroupsResponse
    -> DescribeUserGroupsResponse -> Bool)
-> Eq DescribeUserGroupsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeUserGroupsResponse -> DescribeUserGroupsResponse -> Bool
$c/= :: DescribeUserGroupsResponse -> DescribeUserGroupsResponse -> Bool
== :: DescribeUserGroupsResponse -> DescribeUserGroupsResponse -> Bool
$c== :: DescribeUserGroupsResponse -> DescribeUserGroupsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeUserGroupsResponse]
ReadPrec DescribeUserGroupsResponse
Int -> ReadS DescribeUserGroupsResponse
ReadS [DescribeUserGroupsResponse]
(Int -> ReadS DescribeUserGroupsResponse)
-> ReadS [DescribeUserGroupsResponse]
-> ReadPrec DescribeUserGroupsResponse
-> ReadPrec [DescribeUserGroupsResponse]
-> Read DescribeUserGroupsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeUserGroupsResponse]
$creadListPrec :: ReadPrec [DescribeUserGroupsResponse]
readPrec :: ReadPrec DescribeUserGroupsResponse
$creadPrec :: ReadPrec DescribeUserGroupsResponse
readList :: ReadS [DescribeUserGroupsResponse]
$creadList :: ReadS [DescribeUserGroupsResponse]
readsPrec :: Int -> ReadS DescribeUserGroupsResponse
$creadsPrec :: Int -> ReadS DescribeUserGroupsResponse
Prelude.Read, Int -> DescribeUserGroupsResponse -> ShowS
[DescribeUserGroupsResponse] -> ShowS
DescribeUserGroupsResponse -> String
(Int -> DescribeUserGroupsResponse -> ShowS)
-> (DescribeUserGroupsResponse -> String)
-> ([DescribeUserGroupsResponse] -> ShowS)
-> Show DescribeUserGroupsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeUserGroupsResponse] -> ShowS
$cshowList :: [DescribeUserGroupsResponse] -> ShowS
show :: DescribeUserGroupsResponse -> String
$cshow :: DescribeUserGroupsResponse -> String
showsPrec :: Int -> DescribeUserGroupsResponse -> ShowS
$cshowsPrec :: Int -> DescribeUserGroupsResponse -> ShowS
Prelude.Show, (forall x.
 DescribeUserGroupsResponse -> Rep DescribeUserGroupsResponse x)
-> (forall x.
    Rep DescribeUserGroupsResponse x -> DescribeUserGroupsResponse)
-> Generic DescribeUserGroupsResponse
forall x.
Rep DescribeUserGroupsResponse x -> DescribeUserGroupsResponse
forall x.
DescribeUserGroupsResponse -> Rep DescribeUserGroupsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeUserGroupsResponse x -> DescribeUserGroupsResponse
$cfrom :: forall x.
DescribeUserGroupsResponse -> Rep DescribeUserGroupsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeUserGroupsResponse' 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:
--
-- 'userGroups', 'describeUserGroupsResponse_userGroups' - Returns a list of user groups.
--
-- 'marker', 'describeUserGroupsResponse_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', 'describeUserGroupsResponse_httpStatus' - The response's http status code.
newDescribeUserGroupsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeUserGroupsResponse
newDescribeUserGroupsResponse :: Int -> DescribeUserGroupsResponse
newDescribeUserGroupsResponse Int
pHttpStatus_ =
  DescribeUserGroupsResponse' :: Maybe [UserGroup]
-> Maybe Text -> Int -> DescribeUserGroupsResponse
DescribeUserGroupsResponse'
    { $sel:userGroups:DescribeUserGroupsResponse' :: Maybe [UserGroup]
userGroups =
        Maybe [UserGroup]
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeUserGroupsResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeUserGroupsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Returns a list of user groups.
describeUserGroupsResponse_userGroups :: Lens.Lens' DescribeUserGroupsResponse (Prelude.Maybe [UserGroup])
describeUserGroupsResponse_userGroups :: (Maybe [UserGroup] -> f (Maybe [UserGroup]))
-> DescribeUserGroupsResponse -> f DescribeUserGroupsResponse
describeUserGroupsResponse_userGroups = (DescribeUserGroupsResponse -> Maybe [UserGroup])
-> (DescribeUserGroupsResponse
    -> Maybe [UserGroup] -> DescribeUserGroupsResponse)
-> Lens' DescribeUserGroupsResponse (Maybe [UserGroup])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUserGroupsResponse' {Maybe [UserGroup]
userGroups :: Maybe [UserGroup]
$sel:userGroups:DescribeUserGroupsResponse' :: DescribeUserGroupsResponse -> Maybe [UserGroup]
userGroups} -> Maybe [UserGroup]
userGroups) (\s :: DescribeUserGroupsResponse
s@DescribeUserGroupsResponse' {} Maybe [UserGroup]
a -> DescribeUserGroupsResponse
s {$sel:userGroups:DescribeUserGroupsResponse' :: Maybe [UserGroup]
userGroups = Maybe [UserGroup]
a} :: DescribeUserGroupsResponse) ((Maybe [UserGroup] -> f (Maybe [UserGroup]))
 -> DescribeUserGroupsResponse -> f DescribeUserGroupsResponse)
-> ((Maybe [UserGroup] -> f (Maybe [UserGroup]))
    -> Maybe [UserGroup] -> f (Maybe [UserGroup]))
-> (Maybe [UserGroup] -> f (Maybe [UserGroup]))
-> DescribeUserGroupsResponse
-> f DescribeUserGroupsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [UserGroup] [UserGroup] [UserGroup] [UserGroup]
-> Iso
     (Maybe [UserGroup])
     (Maybe [UserGroup])
     (Maybe [UserGroup])
     (Maybe [UserGroup])
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 [UserGroup] [UserGroup] [UserGroup] [UserGroup]
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. >
describeUserGroupsResponse_marker :: Lens.Lens' DescribeUserGroupsResponse (Prelude.Maybe Prelude.Text)
describeUserGroupsResponse_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeUserGroupsResponse -> f DescribeUserGroupsResponse
describeUserGroupsResponse_marker = (DescribeUserGroupsResponse -> Maybe Text)
-> (DescribeUserGroupsResponse
    -> Maybe Text -> DescribeUserGroupsResponse)
-> Lens' DescribeUserGroupsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeUserGroupsResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeUserGroupsResponse' :: DescribeUserGroupsResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeUserGroupsResponse
s@DescribeUserGroupsResponse' {} Maybe Text
a -> DescribeUserGroupsResponse
s {$sel:marker:DescribeUserGroupsResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeUserGroupsResponse)

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

instance Prelude.NFData DescribeUserGroupsResponse