{-# 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.WorkDocs.DescribeGroups
-- 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 groups specified by the query. Groups are defined by the
-- underlying Active Directory.
--
-- This operation returns paginated results.
module Amazonka.WorkDocs.DescribeGroups
  ( -- * Creating a Request
    DescribeGroups (..),
    newDescribeGroups,

    -- * Request Lenses
    describeGroups_authenticationToken,
    describeGroups_marker,
    describeGroups_limit,
    describeGroups_organizationId,
    describeGroups_searchQuery,

    -- * Destructuring the Response
    DescribeGroupsResponse (..),
    newDescribeGroupsResponse,

    -- * Response Lenses
    describeGroupsResponse_groups,
    describeGroupsResponse_marker,
    describeGroupsResponse_httpStatus,
  )
where

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
import Amazonka.WorkDocs.Types

-- | /See:/ 'newDescribeGroups' smart constructor.
data DescribeGroups = DescribeGroups'
  { -- | Amazon WorkDocs authentication token. Not required when using AWS
    -- administrator credentials to access the API.
    DescribeGroups -> Maybe (Sensitive Text)
authenticationToken :: Prelude.Maybe (Core.Sensitive Prelude.Text),
    -- | The marker for the next set of results. (You received this marker from a
    -- previous call.)
    DescribeGroups -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The maximum number of items to return with this call.
    DescribeGroups -> Maybe Natural
limit :: Prelude.Maybe Prelude.Natural,
    -- | The ID of the organization.
    DescribeGroups -> Maybe Text
organizationId :: Prelude.Maybe Prelude.Text,
    -- | A query to describe groups by group name.
    DescribeGroups -> Sensitive Text
searchQuery :: Core.Sensitive Prelude.Text
  }
  deriving (DescribeGroups -> DescribeGroups -> Bool
(DescribeGroups -> DescribeGroups -> Bool)
-> (DescribeGroups -> DescribeGroups -> Bool) -> Eq DescribeGroups
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeGroups -> DescribeGroups -> Bool
$c/= :: DescribeGroups -> DescribeGroups -> Bool
== :: DescribeGroups -> DescribeGroups -> Bool
$c== :: DescribeGroups -> DescribeGroups -> Bool
Prelude.Eq, Int -> DescribeGroups -> ShowS
[DescribeGroups] -> ShowS
DescribeGroups -> String
(Int -> DescribeGroups -> ShowS)
-> (DescribeGroups -> String)
-> ([DescribeGroups] -> ShowS)
-> Show DescribeGroups
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeGroups] -> ShowS
$cshowList :: [DescribeGroups] -> ShowS
show :: DescribeGroups -> String
$cshow :: DescribeGroups -> String
showsPrec :: Int -> DescribeGroups -> ShowS
$cshowsPrec :: Int -> DescribeGroups -> ShowS
Prelude.Show, (forall x. DescribeGroups -> Rep DescribeGroups x)
-> (forall x. Rep DescribeGroups x -> DescribeGroups)
-> Generic DescribeGroups
forall x. Rep DescribeGroups x -> DescribeGroups
forall x. DescribeGroups -> Rep DescribeGroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeGroups x -> DescribeGroups
$cfrom :: forall x. DescribeGroups -> Rep DescribeGroups x
Prelude.Generic)

-- |
-- Create a value of 'DescribeGroups' 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:
--
-- 'authenticationToken', 'describeGroups_authenticationToken' - Amazon WorkDocs authentication token. Not required when using AWS
-- administrator credentials to access the API.
--
-- 'marker', 'describeGroups_marker' - The marker for the next set of results. (You received this marker from a
-- previous call.)
--
-- 'limit', 'describeGroups_limit' - The maximum number of items to return with this call.
--
-- 'organizationId', 'describeGroups_organizationId' - The ID of the organization.
--
-- 'searchQuery', 'describeGroups_searchQuery' - A query to describe groups by group name.
newDescribeGroups ::
  -- | 'searchQuery'
  Prelude.Text ->
  DescribeGroups
newDescribeGroups :: Text -> DescribeGroups
newDescribeGroups Text
pSearchQuery_ =
  DescribeGroups' :: Maybe (Sensitive Text)
-> Maybe Text
-> Maybe Natural
-> Maybe Text
-> Sensitive Text
-> DescribeGroups
DescribeGroups'
    { $sel:authenticationToken:DescribeGroups' :: Maybe (Sensitive Text)
authenticationToken =
        Maybe (Sensitive Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeGroups' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:limit:DescribeGroups' :: Maybe Natural
limit = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
      $sel:organizationId:DescribeGroups' :: Maybe Text
organizationId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:searchQuery:DescribeGroups' :: Sensitive Text
searchQuery = Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
 -> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pSearchQuery_
    }

-- | Amazon WorkDocs authentication token. Not required when using AWS
-- administrator credentials to access the API.
describeGroups_authenticationToken :: Lens.Lens' DescribeGroups (Prelude.Maybe Prelude.Text)
describeGroups_authenticationToken :: (Maybe Text -> f (Maybe Text))
-> DescribeGroups -> f DescribeGroups
describeGroups_authenticationToken = (DescribeGroups -> Maybe (Sensitive Text))
-> (DescribeGroups -> Maybe (Sensitive Text) -> DescribeGroups)
-> Lens
     DescribeGroups
     DescribeGroups
     (Maybe (Sensitive Text))
     (Maybe (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGroups' {Maybe (Sensitive Text)
authenticationToken :: Maybe (Sensitive Text)
$sel:authenticationToken:DescribeGroups' :: DescribeGroups -> Maybe (Sensitive Text)
authenticationToken} -> Maybe (Sensitive Text)
authenticationToken) (\s :: DescribeGroups
s@DescribeGroups' {} Maybe (Sensitive Text)
a -> DescribeGroups
s {$sel:authenticationToken:DescribeGroups' :: Maybe (Sensitive Text)
authenticationToken = Maybe (Sensitive Text)
a} :: DescribeGroups) ((Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
 -> DescribeGroups -> f DescribeGroups)
-> ((Maybe Text -> f (Maybe Text))
    -> Maybe (Sensitive Text) -> f (Maybe (Sensitive Text)))
-> (Maybe Text -> f (Maybe Text))
-> DescribeGroups
-> f DescribeGroups
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Text) (Sensitive Text) Text Text
-> Iso
     (Maybe (Sensitive Text))
     (Maybe (Sensitive 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 (Sensitive Text) (Sensitive Text) Text Text
forall a. Iso' (Sensitive a) a
Core._Sensitive

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

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

-- | The ID of the organization.
describeGroups_organizationId :: Lens.Lens' DescribeGroups (Prelude.Maybe Prelude.Text)
describeGroups_organizationId :: (Maybe Text -> f (Maybe Text))
-> DescribeGroups -> f DescribeGroups
describeGroups_organizationId = (DescribeGroups -> Maybe Text)
-> (DescribeGroups -> Maybe Text -> DescribeGroups)
-> Lens DescribeGroups DescribeGroups (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGroups' {Maybe Text
organizationId :: Maybe Text
$sel:organizationId:DescribeGroups' :: DescribeGroups -> Maybe Text
organizationId} -> Maybe Text
organizationId) (\s :: DescribeGroups
s@DescribeGroups' {} Maybe Text
a -> DescribeGroups
s {$sel:organizationId:DescribeGroups' :: Maybe Text
organizationId = Maybe Text
a} :: DescribeGroups)

-- | A query to describe groups by group name.
describeGroups_searchQuery :: Lens.Lens' DescribeGroups Prelude.Text
describeGroups_searchQuery :: (Text -> f Text) -> DescribeGroups -> f DescribeGroups
describeGroups_searchQuery = (DescribeGroups -> Sensitive Text)
-> (DescribeGroups -> Sensitive Text -> DescribeGroups)
-> Lens
     DescribeGroups DescribeGroups (Sensitive Text) (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGroups' {Sensitive Text
searchQuery :: Sensitive Text
$sel:searchQuery:DescribeGroups' :: DescribeGroups -> Sensitive Text
searchQuery} -> Sensitive Text
searchQuery) (\s :: DescribeGroups
s@DescribeGroups' {} Sensitive Text
a -> DescribeGroups
s {$sel:searchQuery:DescribeGroups' :: Sensitive Text
searchQuery = Sensitive Text
a} :: DescribeGroups) ((Sensitive Text -> f (Sensitive Text))
 -> DescribeGroups -> f DescribeGroups)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> DescribeGroups
-> f DescribeGroups
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive

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

instance Prelude.NFData DescribeGroups

instance Core.ToHeaders DescribeGroups where
  toHeaders :: DescribeGroups -> ResponseHeaders
toHeaders DescribeGroups' {Maybe Natural
Maybe Text
Maybe (Sensitive Text)
Sensitive Text
searchQuery :: Sensitive Text
organizationId :: Maybe Text
limit :: Maybe Natural
marker :: Maybe Text
authenticationToken :: Maybe (Sensitive Text)
$sel:searchQuery:DescribeGroups' :: DescribeGroups -> Sensitive Text
$sel:organizationId:DescribeGroups' :: DescribeGroups -> Maybe Text
$sel:limit:DescribeGroups' :: DescribeGroups -> Maybe Natural
$sel:marker:DescribeGroups' :: DescribeGroups -> Maybe Text
$sel:authenticationToken:DescribeGroups' :: DescribeGroups -> Maybe (Sensitive Text)
..} =
    [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ HeaderName
"Authentication" HeaderName -> Maybe (Sensitive Text) -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# Maybe (Sensitive Text)
authenticationToken,
        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.ToPath DescribeGroups where
  toPath :: DescribeGroups -> ByteString
toPath = ByteString -> DescribeGroups -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/api/v1/groups"

instance Core.ToQuery DescribeGroups where
  toQuery :: DescribeGroups -> QueryString
toQuery DescribeGroups' {Maybe Natural
Maybe Text
Maybe (Sensitive Text)
Sensitive Text
searchQuery :: Sensitive Text
organizationId :: Maybe Text
limit :: Maybe Natural
marker :: Maybe Text
authenticationToken :: Maybe (Sensitive Text)
$sel:searchQuery:DescribeGroups' :: DescribeGroups -> Sensitive Text
$sel:organizationId:DescribeGroups' :: DescribeGroups -> Maybe Text
$sel:limit:DescribeGroups' :: DescribeGroups -> Maybe Natural
$sel:marker:DescribeGroups' :: DescribeGroups -> Maybe Text
$sel:authenticationToken:DescribeGroups' :: DescribeGroups -> Maybe (Sensitive Text)
..} =
    [QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"marker" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
marker,
        ByteString
"limit" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
limit,
        ByteString
"organizationId" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
organizationId,
        ByteString
"searchQuery" ByteString -> Sensitive Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Sensitive Text
searchQuery
      ]

-- | /See:/ 'newDescribeGroupsResponse' smart constructor.
data DescribeGroupsResponse = DescribeGroupsResponse'
  { -- | The list of groups.
    DescribeGroupsResponse -> Maybe [GroupMetadata]
groups :: Prelude.Maybe [GroupMetadata],
    -- | The marker to use when requesting the next set of results. If there are
    -- no additional results, the string is empty.
    DescribeGroupsResponse -> Maybe Text
marker :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    DescribeGroupsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeGroupsResponse -> DescribeGroupsResponse -> Bool
(DescribeGroupsResponse -> DescribeGroupsResponse -> Bool)
-> (DescribeGroupsResponse -> DescribeGroupsResponse -> Bool)
-> Eq DescribeGroupsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeGroupsResponse -> DescribeGroupsResponse -> Bool
$c/= :: DescribeGroupsResponse -> DescribeGroupsResponse -> Bool
== :: DescribeGroupsResponse -> DescribeGroupsResponse -> Bool
$c== :: DescribeGroupsResponse -> DescribeGroupsResponse -> Bool
Prelude.Eq, ReadPrec [DescribeGroupsResponse]
ReadPrec DescribeGroupsResponse
Int -> ReadS DescribeGroupsResponse
ReadS [DescribeGroupsResponse]
(Int -> ReadS DescribeGroupsResponse)
-> ReadS [DescribeGroupsResponse]
-> ReadPrec DescribeGroupsResponse
-> ReadPrec [DescribeGroupsResponse]
-> Read DescribeGroupsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeGroupsResponse]
$creadListPrec :: ReadPrec [DescribeGroupsResponse]
readPrec :: ReadPrec DescribeGroupsResponse
$creadPrec :: ReadPrec DescribeGroupsResponse
readList :: ReadS [DescribeGroupsResponse]
$creadList :: ReadS [DescribeGroupsResponse]
readsPrec :: Int -> ReadS DescribeGroupsResponse
$creadsPrec :: Int -> ReadS DescribeGroupsResponse
Prelude.Read, Int -> DescribeGroupsResponse -> ShowS
[DescribeGroupsResponse] -> ShowS
DescribeGroupsResponse -> String
(Int -> DescribeGroupsResponse -> ShowS)
-> (DescribeGroupsResponse -> String)
-> ([DescribeGroupsResponse] -> ShowS)
-> Show DescribeGroupsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeGroupsResponse] -> ShowS
$cshowList :: [DescribeGroupsResponse] -> ShowS
show :: DescribeGroupsResponse -> String
$cshow :: DescribeGroupsResponse -> String
showsPrec :: Int -> DescribeGroupsResponse -> ShowS
$cshowsPrec :: Int -> DescribeGroupsResponse -> ShowS
Prelude.Show, (forall x. DescribeGroupsResponse -> Rep DescribeGroupsResponse x)
-> (forall x.
    Rep DescribeGroupsResponse x -> DescribeGroupsResponse)
-> Generic DescribeGroupsResponse
forall x. Rep DescribeGroupsResponse x -> DescribeGroupsResponse
forall x. DescribeGroupsResponse -> Rep DescribeGroupsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeGroupsResponse x -> DescribeGroupsResponse
$cfrom :: forall x. DescribeGroupsResponse -> Rep DescribeGroupsResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeGroupsResponse' 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:
--
-- 'groups', 'describeGroupsResponse_groups' - The list of groups.
--
-- 'marker', 'describeGroupsResponse_marker' - The marker to use when requesting the next set of results. If there are
-- no additional results, the string is empty.
--
-- 'httpStatus', 'describeGroupsResponse_httpStatus' - The response's http status code.
newDescribeGroupsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeGroupsResponse
newDescribeGroupsResponse :: Int -> DescribeGroupsResponse
newDescribeGroupsResponse Int
pHttpStatus_ =
  DescribeGroupsResponse' :: Maybe [GroupMetadata]
-> Maybe Text -> Int -> DescribeGroupsResponse
DescribeGroupsResponse'
    { $sel:groups:DescribeGroupsResponse' :: Maybe [GroupMetadata]
groups = Maybe [GroupMetadata]
forall a. Maybe a
Prelude.Nothing,
      $sel:marker:DescribeGroupsResponse' :: Maybe Text
marker = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeGroupsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | The marker to use when requesting the next set of results. If there are
-- no additional results, the string is empty.
describeGroupsResponse_marker :: Lens.Lens' DescribeGroupsResponse (Prelude.Maybe Prelude.Text)
describeGroupsResponse_marker :: (Maybe Text -> f (Maybe Text))
-> DescribeGroupsResponse -> f DescribeGroupsResponse
describeGroupsResponse_marker = (DescribeGroupsResponse -> Maybe Text)
-> (DescribeGroupsResponse -> Maybe Text -> DescribeGroupsResponse)
-> Lens' DescribeGroupsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeGroupsResponse' {Maybe Text
marker :: Maybe Text
$sel:marker:DescribeGroupsResponse' :: DescribeGroupsResponse -> Maybe Text
marker} -> Maybe Text
marker) (\s :: DescribeGroupsResponse
s@DescribeGroupsResponse' {} Maybe Text
a -> DescribeGroupsResponse
s {$sel:marker:DescribeGroupsResponse' :: Maybe Text
marker = Maybe Text
a} :: DescribeGroupsResponse)

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

instance Prelude.NFData DescribeGroupsResponse