{-# 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.AlexaBusiness.SearchSkillGroups
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Searches skill groups and lists the ones that meet a set of filter and
-- sort criteria.
--
-- This operation returns paginated results.
module Amazonka.AlexaBusiness.SearchSkillGroups
  ( -- * Creating a Request
    SearchSkillGroups (..),
    newSearchSkillGroups,

    -- * Request Lenses
    searchSkillGroups_filters,
    searchSkillGroups_maxResults,
    searchSkillGroups_nextToken,
    searchSkillGroups_sortCriteria,

    -- * Destructuring the Response
    SearchSkillGroupsResponse (..),
    newSearchSkillGroupsResponse,

    -- * Response Lenses
    searchSkillGroupsResponse_nextToken,
    searchSkillGroupsResponse_skillGroups,
    searchSkillGroupsResponse_totalCount,
    searchSkillGroupsResponse_httpStatus,
  )
where

import Amazonka.AlexaBusiness.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newSearchSkillGroups' smart constructor.
data SearchSkillGroups = SearchSkillGroups'
  { -- | The filters to use to list a specified set of skill groups. The
    -- supported filter key is SkillGroupName.
    SearchSkillGroups -> Maybe [Filter]
filters :: Prelude.Maybe [Filter],
    -- | The maximum number of results to include in the response. If more
    -- results exist than the specified @MaxResults@ value, a token is included
    -- in the response so that the remaining results can be retrieved.
    SearchSkillGroups -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | An optional token returned from a prior request. Use this token for
    -- pagination of results from this action. If this parameter is specified,
    -- the response includes only results beyond the token, up to the value
    -- specified by @MaxResults@. Required.
    SearchSkillGroups -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The sort order to use in listing the specified set of skill groups. The
    -- supported sort key is SkillGroupName.
    SearchSkillGroups -> Maybe [Sort]
sortCriteria :: Prelude.Maybe [Sort]
  }
  deriving (SearchSkillGroups -> SearchSkillGroups -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchSkillGroups -> SearchSkillGroups -> Bool
$c/= :: SearchSkillGroups -> SearchSkillGroups -> Bool
== :: SearchSkillGroups -> SearchSkillGroups -> Bool
$c== :: SearchSkillGroups -> SearchSkillGroups -> Bool
Prelude.Eq, ReadPrec [SearchSkillGroups]
ReadPrec SearchSkillGroups
Int -> ReadS SearchSkillGroups
ReadS [SearchSkillGroups]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SearchSkillGroups]
$creadListPrec :: ReadPrec [SearchSkillGroups]
readPrec :: ReadPrec SearchSkillGroups
$creadPrec :: ReadPrec SearchSkillGroups
readList :: ReadS [SearchSkillGroups]
$creadList :: ReadS [SearchSkillGroups]
readsPrec :: Int -> ReadS SearchSkillGroups
$creadsPrec :: Int -> ReadS SearchSkillGroups
Prelude.Read, Int -> SearchSkillGroups -> ShowS
[SearchSkillGroups] -> ShowS
SearchSkillGroups -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchSkillGroups] -> ShowS
$cshowList :: [SearchSkillGroups] -> ShowS
show :: SearchSkillGroups -> String
$cshow :: SearchSkillGroups -> String
showsPrec :: Int -> SearchSkillGroups -> ShowS
$cshowsPrec :: Int -> SearchSkillGroups -> ShowS
Prelude.Show, forall x. Rep SearchSkillGroups x -> SearchSkillGroups
forall x. SearchSkillGroups -> Rep SearchSkillGroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SearchSkillGroups x -> SearchSkillGroups
$cfrom :: forall x. SearchSkillGroups -> Rep SearchSkillGroups x
Prelude.Generic)

-- |
-- Create a value of 'SearchSkillGroups' 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', 'searchSkillGroups_filters' - The filters to use to list a specified set of skill groups. The
-- supported filter key is SkillGroupName.
--
-- 'maxResults', 'searchSkillGroups_maxResults' - The maximum number of results to include in the response. If more
-- results exist than the specified @MaxResults@ value, a token is included
-- in the response so that the remaining results can be retrieved.
--
-- 'nextToken', 'searchSkillGroups_nextToken' - An optional token returned from a prior request. Use this token for
-- pagination of results from this action. If this parameter is specified,
-- the response includes only results beyond the token, up to the value
-- specified by @MaxResults@. Required.
--
-- 'sortCriteria', 'searchSkillGroups_sortCriteria' - The sort order to use in listing the specified set of skill groups. The
-- supported sort key is SkillGroupName.
newSearchSkillGroups ::
  SearchSkillGroups
newSearchSkillGroups :: SearchSkillGroups
newSearchSkillGroups =
  SearchSkillGroups'
    { $sel:filters:SearchSkillGroups' :: Maybe [Filter]
filters = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:SearchSkillGroups' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:SearchSkillGroups' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:sortCriteria:SearchSkillGroups' :: Maybe [Sort]
sortCriteria = forall a. Maybe a
Prelude.Nothing
    }

-- | The filters to use to list a specified set of skill groups. The
-- supported filter key is SkillGroupName.
searchSkillGroups_filters :: Lens.Lens' SearchSkillGroups (Prelude.Maybe [Filter])
searchSkillGroups_filters :: Lens' SearchSkillGroups (Maybe [Filter])
searchSkillGroups_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchSkillGroups' {Maybe [Filter]
filters :: Maybe [Filter]
$sel:filters:SearchSkillGroups' :: SearchSkillGroups -> Maybe [Filter]
filters} -> Maybe [Filter]
filters) (\s :: SearchSkillGroups
s@SearchSkillGroups' {} Maybe [Filter]
a -> SearchSkillGroups
s {$sel:filters:SearchSkillGroups' :: Maybe [Filter]
filters = Maybe [Filter]
a} :: SearchSkillGroups) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The maximum number of results to include in the response. If more
-- results exist than the specified @MaxResults@ value, a token is included
-- in the response so that the remaining results can be retrieved.
searchSkillGroups_maxResults :: Lens.Lens' SearchSkillGroups (Prelude.Maybe Prelude.Natural)
searchSkillGroups_maxResults :: Lens' SearchSkillGroups (Maybe Natural)
searchSkillGroups_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchSkillGroups' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:SearchSkillGroups' :: SearchSkillGroups -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: SearchSkillGroups
s@SearchSkillGroups' {} Maybe Natural
a -> SearchSkillGroups
s {$sel:maxResults:SearchSkillGroups' :: Maybe Natural
maxResults = Maybe Natural
a} :: SearchSkillGroups)

-- | An optional token returned from a prior request. Use this token for
-- pagination of results from this action. If this parameter is specified,
-- the response includes only results beyond the token, up to the value
-- specified by @MaxResults@. Required.
searchSkillGroups_nextToken :: Lens.Lens' SearchSkillGroups (Prelude.Maybe Prelude.Text)
searchSkillGroups_nextToken :: Lens' SearchSkillGroups (Maybe Text)
searchSkillGroups_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchSkillGroups' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:SearchSkillGroups' :: SearchSkillGroups -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: SearchSkillGroups
s@SearchSkillGroups' {} Maybe Text
a -> SearchSkillGroups
s {$sel:nextToken:SearchSkillGroups' :: Maybe Text
nextToken = Maybe Text
a} :: SearchSkillGroups)

-- | The sort order to use in listing the specified set of skill groups. The
-- supported sort key is SkillGroupName.
searchSkillGroups_sortCriteria :: Lens.Lens' SearchSkillGroups (Prelude.Maybe [Sort])
searchSkillGroups_sortCriteria :: Lens' SearchSkillGroups (Maybe [Sort])
searchSkillGroups_sortCriteria = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchSkillGroups' {Maybe [Sort]
sortCriteria :: Maybe [Sort]
$sel:sortCriteria:SearchSkillGroups' :: SearchSkillGroups -> Maybe [Sort]
sortCriteria} -> Maybe [Sort]
sortCriteria) (\s :: SearchSkillGroups
s@SearchSkillGroups' {} Maybe [Sort]
a -> SearchSkillGroups
s {$sel:sortCriteria:SearchSkillGroups' :: Maybe [Sort]
sortCriteria = Maybe [Sort]
a} :: SearchSkillGroups) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.AWSPager SearchSkillGroups where
  page :: SearchSkillGroups
-> AWSResponse SearchSkillGroups -> Maybe SearchSkillGroups
page SearchSkillGroups
rq AWSResponse SearchSkillGroups
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse SearchSkillGroups
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' SearchSkillGroupsResponse (Maybe Text)
searchSkillGroupsResponse_nextToken
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse SearchSkillGroups
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' SearchSkillGroupsResponse (Maybe [SkillGroupData])
searchSkillGroupsResponse_skillGroups
            forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
        ) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ SearchSkillGroups
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' SearchSkillGroups (Maybe Text)
searchSkillGroups_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse SearchSkillGroups
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' SearchSkillGroupsResponse (Maybe Text)
searchSkillGroupsResponse_nextToken
          forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just

instance Core.AWSRequest SearchSkillGroups where
  type
    AWSResponse SearchSkillGroups =
      SearchSkillGroupsResponse
  request :: (Service -> Service)
-> SearchSkillGroups -> Request SearchSkillGroups
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy SearchSkillGroups
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse SearchSkillGroups)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Text
-> Maybe [SkillGroupData]
-> Maybe Int
-> Int
-> SearchSkillGroupsResponse
SearchSkillGroupsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"NextToken")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"SkillGroups" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"TotalCount")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable SearchSkillGroups where
  hashWithSalt :: Int -> SearchSkillGroups -> Int
hashWithSalt Int
_salt SearchSkillGroups' {Maybe Natural
Maybe [Filter]
Maybe [Sort]
Maybe Text
sortCriteria :: Maybe [Sort]
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
$sel:sortCriteria:SearchSkillGroups' :: SearchSkillGroups -> Maybe [Sort]
$sel:nextToken:SearchSkillGroups' :: SearchSkillGroups -> Maybe Text
$sel:maxResults:SearchSkillGroups' :: SearchSkillGroups -> Maybe Natural
$sel:filters:SearchSkillGroups' :: SearchSkillGroups -> Maybe [Filter]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Filter]
filters
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Sort]
sortCriteria

instance Prelude.NFData SearchSkillGroups where
  rnf :: SearchSkillGroups -> ()
rnf SearchSkillGroups' {Maybe Natural
Maybe [Filter]
Maybe [Sort]
Maybe Text
sortCriteria :: Maybe [Sort]
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
$sel:sortCriteria:SearchSkillGroups' :: SearchSkillGroups -> Maybe [Sort]
$sel:nextToken:SearchSkillGroups' :: SearchSkillGroups -> Maybe Text
$sel:maxResults:SearchSkillGroups' :: SearchSkillGroups -> Maybe Natural
$sel:filters:SearchSkillGroups' :: SearchSkillGroups -> Maybe [Filter]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Filter]
filters
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
maxResults
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [Sort]
sortCriteria

instance Data.ToHeaders SearchSkillGroups where
  toHeaders :: SearchSkillGroups -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AlexaForBusiness.SearchSkillGroups" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON SearchSkillGroups where
  toJSON :: SearchSkillGroups -> Value
toJSON SearchSkillGroups' {Maybe Natural
Maybe [Filter]
Maybe [Sort]
Maybe Text
sortCriteria :: Maybe [Sort]
nextToken :: Maybe Text
maxResults :: Maybe Natural
filters :: Maybe [Filter]
$sel:sortCriteria:SearchSkillGroups' :: SearchSkillGroups -> Maybe [Sort]
$sel:nextToken:SearchSkillGroups' :: SearchSkillGroups -> Maybe Text
$sel:maxResults:SearchSkillGroups' :: SearchSkillGroups -> Maybe Natural
$sel:filters:SearchSkillGroups' :: SearchSkillGroups -> Maybe [Filter]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Filters" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Filter]
filters,
            (Key
"MaxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
            (Key
"NextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Key
"SortCriteria" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Sort]
sortCriteria
          ]
      )

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

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

-- | /See:/ 'newSearchSkillGroupsResponse' smart constructor.
data SearchSkillGroupsResponse = SearchSkillGroupsResponse'
  { -- | The token returned to indicate that there is more data available.
    SearchSkillGroupsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The skill groups that meet the filter criteria, in sort order.
    SearchSkillGroupsResponse -> Maybe [SkillGroupData]
skillGroups :: Prelude.Maybe [SkillGroupData],
    -- | The total number of skill groups returned.
    SearchSkillGroupsResponse -> Maybe Int
totalCount :: Prelude.Maybe Prelude.Int,
    -- | The response's http status code.
    SearchSkillGroupsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (SearchSkillGroupsResponse -> SearchSkillGroupsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchSkillGroupsResponse -> SearchSkillGroupsResponse -> Bool
$c/= :: SearchSkillGroupsResponse -> SearchSkillGroupsResponse -> Bool
== :: SearchSkillGroupsResponse -> SearchSkillGroupsResponse -> Bool
$c== :: SearchSkillGroupsResponse -> SearchSkillGroupsResponse -> Bool
Prelude.Eq, ReadPrec [SearchSkillGroupsResponse]
ReadPrec SearchSkillGroupsResponse
Int -> ReadS SearchSkillGroupsResponse
ReadS [SearchSkillGroupsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SearchSkillGroupsResponse]
$creadListPrec :: ReadPrec [SearchSkillGroupsResponse]
readPrec :: ReadPrec SearchSkillGroupsResponse
$creadPrec :: ReadPrec SearchSkillGroupsResponse
readList :: ReadS [SearchSkillGroupsResponse]
$creadList :: ReadS [SearchSkillGroupsResponse]
readsPrec :: Int -> ReadS SearchSkillGroupsResponse
$creadsPrec :: Int -> ReadS SearchSkillGroupsResponse
Prelude.Read, Int -> SearchSkillGroupsResponse -> ShowS
[SearchSkillGroupsResponse] -> ShowS
SearchSkillGroupsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchSkillGroupsResponse] -> ShowS
$cshowList :: [SearchSkillGroupsResponse] -> ShowS
show :: SearchSkillGroupsResponse -> String
$cshow :: SearchSkillGroupsResponse -> String
showsPrec :: Int -> SearchSkillGroupsResponse -> ShowS
$cshowsPrec :: Int -> SearchSkillGroupsResponse -> ShowS
Prelude.Show, forall x.
Rep SearchSkillGroupsResponse x -> SearchSkillGroupsResponse
forall x.
SearchSkillGroupsResponse -> Rep SearchSkillGroupsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SearchSkillGroupsResponse x -> SearchSkillGroupsResponse
$cfrom :: forall x.
SearchSkillGroupsResponse -> Rep SearchSkillGroupsResponse x
Prelude.Generic)

-- |
-- Create a value of 'SearchSkillGroupsResponse' 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', 'searchSkillGroupsResponse_nextToken' - The token returned to indicate that there is more data available.
--
-- 'skillGroups', 'searchSkillGroupsResponse_skillGroups' - The skill groups that meet the filter criteria, in sort order.
--
-- 'totalCount', 'searchSkillGroupsResponse_totalCount' - The total number of skill groups returned.
--
-- 'httpStatus', 'searchSkillGroupsResponse_httpStatus' - The response's http status code.
newSearchSkillGroupsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  SearchSkillGroupsResponse
newSearchSkillGroupsResponse :: Int -> SearchSkillGroupsResponse
newSearchSkillGroupsResponse Int
pHttpStatus_ =
  SearchSkillGroupsResponse'
    { $sel:nextToken:SearchSkillGroupsResponse' :: Maybe Text
nextToken =
        forall a. Maybe a
Prelude.Nothing,
      $sel:skillGroups:SearchSkillGroupsResponse' :: Maybe [SkillGroupData]
skillGroups = forall a. Maybe a
Prelude.Nothing,
      $sel:totalCount:SearchSkillGroupsResponse' :: Maybe Int
totalCount = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:SearchSkillGroupsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The token returned to indicate that there is more data available.
searchSkillGroupsResponse_nextToken :: Lens.Lens' SearchSkillGroupsResponse (Prelude.Maybe Prelude.Text)
searchSkillGroupsResponse_nextToken :: Lens' SearchSkillGroupsResponse (Maybe Text)
searchSkillGroupsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchSkillGroupsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:SearchSkillGroupsResponse' :: SearchSkillGroupsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: SearchSkillGroupsResponse
s@SearchSkillGroupsResponse' {} Maybe Text
a -> SearchSkillGroupsResponse
s {$sel:nextToken:SearchSkillGroupsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: SearchSkillGroupsResponse)

-- | The skill groups that meet the filter criteria, in sort order.
searchSkillGroupsResponse_skillGroups :: Lens.Lens' SearchSkillGroupsResponse (Prelude.Maybe [SkillGroupData])
searchSkillGroupsResponse_skillGroups :: Lens' SearchSkillGroupsResponse (Maybe [SkillGroupData])
searchSkillGroupsResponse_skillGroups = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchSkillGroupsResponse' {Maybe [SkillGroupData]
skillGroups :: Maybe [SkillGroupData]
$sel:skillGroups:SearchSkillGroupsResponse' :: SearchSkillGroupsResponse -> Maybe [SkillGroupData]
skillGroups} -> Maybe [SkillGroupData]
skillGroups) (\s :: SearchSkillGroupsResponse
s@SearchSkillGroupsResponse' {} Maybe [SkillGroupData]
a -> SearchSkillGroupsResponse
s {$sel:skillGroups:SearchSkillGroupsResponse' :: Maybe [SkillGroupData]
skillGroups = Maybe [SkillGroupData]
a} :: SearchSkillGroupsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The total number of skill groups returned.
searchSkillGroupsResponse_totalCount :: Lens.Lens' SearchSkillGroupsResponse (Prelude.Maybe Prelude.Int)
searchSkillGroupsResponse_totalCount :: Lens' SearchSkillGroupsResponse (Maybe Int)
searchSkillGroupsResponse_totalCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchSkillGroupsResponse' {Maybe Int
totalCount :: Maybe Int
$sel:totalCount:SearchSkillGroupsResponse' :: SearchSkillGroupsResponse -> Maybe Int
totalCount} -> Maybe Int
totalCount) (\s :: SearchSkillGroupsResponse
s@SearchSkillGroupsResponse' {} Maybe Int
a -> SearchSkillGroupsResponse
s {$sel:totalCount:SearchSkillGroupsResponse' :: Maybe Int
totalCount = Maybe Int
a} :: SearchSkillGroupsResponse)

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

instance Prelude.NFData SearchSkillGroupsResponse where
  rnf :: SearchSkillGroupsResponse -> ()
rnf SearchSkillGroupsResponse' {Int
Maybe Int
Maybe [SkillGroupData]
Maybe Text
httpStatus :: Int
totalCount :: Maybe Int
skillGroups :: Maybe [SkillGroupData]
nextToken :: Maybe Text
$sel:httpStatus:SearchSkillGroupsResponse' :: SearchSkillGroupsResponse -> Int
$sel:totalCount:SearchSkillGroupsResponse' :: SearchSkillGroupsResponse -> Maybe Int
$sel:skillGroups:SearchSkillGroupsResponse' :: SearchSkillGroupsResponse -> Maybe [SkillGroupData]
$sel:nextToken:SearchSkillGroupsResponse' :: SearchSkillGroupsResponse -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nextToken
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [SkillGroupData]
skillGroups
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
totalCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus