{-# 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.ListSkills
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists all enabled skills in a specific skill group.
--
-- This operation returns paginated results.
module Amazonka.AlexaBusiness.ListSkills
  ( -- * Creating a Request
    ListSkills (..),
    newListSkills,

    -- * Request Lenses
    listSkills_skillGroupArn,
    listSkills_skillType,
    listSkills_nextToken,
    listSkills_enablementType,
    listSkills_maxResults,

    -- * Destructuring the Response
    ListSkillsResponse (..),
    newListSkillsResponse,

    -- * Response Lenses
    listSkillsResponse_nextToken,
    listSkillsResponse_skillSummaries,
    listSkillsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListSkills' smart constructor.
data ListSkills = ListSkills'
  { -- | The ARN of the skill group for which to list enabled skills.
    ListSkills -> Maybe Text
skillGroupArn :: Prelude.Maybe Prelude.Text,
    -- | Whether the skill is publicly available or is a private skill.
    ListSkills -> Maybe SkillTypeFilter
skillType :: Prelude.Maybe SkillTypeFilter,
    -- | 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@.
    ListSkills -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Whether the skill is enabled under the user\'s account.
    ListSkills -> Maybe EnablementTypeFilter
enablementType :: Prelude.Maybe EnablementTypeFilter,
    -- | 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.
    ListSkills -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListSkills -> ListSkills -> Bool
(ListSkills -> ListSkills -> Bool)
-> (ListSkills -> ListSkills -> Bool) -> Eq ListSkills
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSkills -> ListSkills -> Bool
$c/= :: ListSkills -> ListSkills -> Bool
== :: ListSkills -> ListSkills -> Bool
$c== :: ListSkills -> ListSkills -> Bool
Prelude.Eq, ReadPrec [ListSkills]
ReadPrec ListSkills
Int -> ReadS ListSkills
ReadS [ListSkills]
(Int -> ReadS ListSkills)
-> ReadS [ListSkills]
-> ReadPrec ListSkills
-> ReadPrec [ListSkills]
-> Read ListSkills
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSkills]
$creadListPrec :: ReadPrec [ListSkills]
readPrec :: ReadPrec ListSkills
$creadPrec :: ReadPrec ListSkills
readList :: ReadS [ListSkills]
$creadList :: ReadS [ListSkills]
readsPrec :: Int -> ReadS ListSkills
$creadsPrec :: Int -> ReadS ListSkills
Prelude.Read, Int -> ListSkills -> ShowS
[ListSkills] -> ShowS
ListSkills -> String
(Int -> ListSkills -> ShowS)
-> (ListSkills -> String)
-> ([ListSkills] -> ShowS)
-> Show ListSkills
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSkills] -> ShowS
$cshowList :: [ListSkills] -> ShowS
show :: ListSkills -> String
$cshow :: ListSkills -> String
showsPrec :: Int -> ListSkills -> ShowS
$cshowsPrec :: Int -> ListSkills -> ShowS
Prelude.Show, (forall x. ListSkills -> Rep ListSkills x)
-> (forall x. Rep ListSkills x -> ListSkills) -> Generic ListSkills
forall x. Rep ListSkills x -> ListSkills
forall x. ListSkills -> Rep ListSkills x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListSkills x -> ListSkills
$cfrom :: forall x. ListSkills -> Rep ListSkills x
Prelude.Generic)

-- |
-- Create a value of 'ListSkills' 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:
--
-- 'skillGroupArn', 'listSkills_skillGroupArn' - The ARN of the skill group for which to list enabled skills.
--
-- 'skillType', 'listSkills_skillType' - Whether the skill is publicly available or is a private skill.
--
-- 'nextToken', 'listSkills_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@.
--
-- 'enablementType', 'listSkills_enablementType' - Whether the skill is enabled under the user\'s account.
--
-- 'maxResults', 'listSkills_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.
newListSkills ::
  ListSkills
newListSkills :: ListSkills
newListSkills =
  ListSkills' :: Maybe Text
-> Maybe SkillTypeFilter
-> Maybe Text
-> Maybe EnablementTypeFilter
-> Maybe Natural
-> ListSkills
ListSkills'
    { $sel:skillGroupArn:ListSkills' :: Maybe Text
skillGroupArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:skillType:ListSkills' :: Maybe SkillTypeFilter
skillType = Maybe SkillTypeFilter
forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListSkills' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:enablementType:ListSkills' :: Maybe EnablementTypeFilter
enablementType = Maybe EnablementTypeFilter
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListSkills' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | The ARN of the skill group for which to list enabled skills.
listSkills_skillGroupArn :: Lens.Lens' ListSkills (Prelude.Maybe Prelude.Text)
listSkills_skillGroupArn :: (Maybe Text -> f (Maybe Text)) -> ListSkills -> f ListSkills
listSkills_skillGroupArn = (ListSkills -> Maybe Text)
-> (ListSkills -> Maybe Text -> ListSkills)
-> Lens ListSkills ListSkills (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSkills' {Maybe Text
skillGroupArn :: Maybe Text
$sel:skillGroupArn:ListSkills' :: ListSkills -> Maybe Text
skillGroupArn} -> Maybe Text
skillGroupArn) (\s :: ListSkills
s@ListSkills' {} Maybe Text
a -> ListSkills
s {$sel:skillGroupArn:ListSkills' :: Maybe Text
skillGroupArn = Maybe Text
a} :: ListSkills)

-- | Whether the skill is publicly available or is a private skill.
listSkills_skillType :: Lens.Lens' ListSkills (Prelude.Maybe SkillTypeFilter)
listSkills_skillType :: (Maybe SkillTypeFilter -> f (Maybe SkillTypeFilter))
-> ListSkills -> f ListSkills
listSkills_skillType = (ListSkills -> Maybe SkillTypeFilter)
-> (ListSkills -> Maybe SkillTypeFilter -> ListSkills)
-> Lens
     ListSkills
     ListSkills
     (Maybe SkillTypeFilter)
     (Maybe SkillTypeFilter)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSkills' {Maybe SkillTypeFilter
skillType :: Maybe SkillTypeFilter
$sel:skillType:ListSkills' :: ListSkills -> Maybe SkillTypeFilter
skillType} -> Maybe SkillTypeFilter
skillType) (\s :: ListSkills
s@ListSkills' {} Maybe SkillTypeFilter
a -> ListSkills
s {$sel:skillType:ListSkills' :: Maybe SkillTypeFilter
skillType = Maybe SkillTypeFilter
a} :: ListSkills)

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

-- | Whether the skill is enabled under the user\'s account.
listSkills_enablementType :: Lens.Lens' ListSkills (Prelude.Maybe EnablementTypeFilter)
listSkills_enablementType :: (Maybe EnablementTypeFilter -> f (Maybe EnablementTypeFilter))
-> ListSkills -> f ListSkills
listSkills_enablementType = (ListSkills -> Maybe EnablementTypeFilter)
-> (ListSkills -> Maybe EnablementTypeFilter -> ListSkills)
-> Lens
     ListSkills
     ListSkills
     (Maybe EnablementTypeFilter)
     (Maybe EnablementTypeFilter)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSkills' {Maybe EnablementTypeFilter
enablementType :: Maybe EnablementTypeFilter
$sel:enablementType:ListSkills' :: ListSkills -> Maybe EnablementTypeFilter
enablementType} -> Maybe EnablementTypeFilter
enablementType) (\s :: ListSkills
s@ListSkills' {} Maybe EnablementTypeFilter
a -> ListSkills
s {$sel:enablementType:ListSkills' :: Maybe EnablementTypeFilter
enablementType = Maybe EnablementTypeFilter
a} :: ListSkills)

-- | 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.
listSkills_maxResults :: Lens.Lens' ListSkills (Prelude.Maybe Prelude.Natural)
listSkills_maxResults :: (Maybe Natural -> f (Maybe Natural)) -> ListSkills -> f ListSkills
listSkills_maxResults = (ListSkills -> Maybe Natural)
-> (ListSkills -> Maybe Natural -> ListSkills)
-> Lens ListSkills ListSkills (Maybe Natural) (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSkills' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListSkills' :: ListSkills -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListSkills
s@ListSkills' {} Maybe Natural
a -> ListSkills
s {$sel:maxResults:ListSkills' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListSkills)

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

instance Prelude.NFData ListSkills

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

instance Core.ToJSON ListSkills where
  toJSON :: ListSkills -> Value
toJSON ListSkills' {Maybe Natural
Maybe Text
Maybe EnablementTypeFilter
Maybe SkillTypeFilter
maxResults :: Maybe Natural
enablementType :: Maybe EnablementTypeFilter
nextToken :: Maybe Text
skillType :: Maybe SkillTypeFilter
skillGroupArn :: Maybe Text
$sel:maxResults:ListSkills' :: ListSkills -> Maybe Natural
$sel:enablementType:ListSkills' :: ListSkills -> Maybe EnablementTypeFilter
$sel:nextToken:ListSkills' :: ListSkills -> Maybe Text
$sel:skillType:ListSkills' :: ListSkills -> Maybe SkillTypeFilter
$sel:skillGroupArn:ListSkills' :: ListSkills -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"SkillGroupArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
skillGroupArn,
            (Text
"SkillType" Text -> SkillTypeFilter -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SkillTypeFilter -> Pair) -> Maybe SkillTypeFilter -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SkillTypeFilter
skillType,
            (Text
"NextToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
            (Text
"EnablementType" Text -> EnablementTypeFilter -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (EnablementTypeFilter -> Pair)
-> Maybe EnablementTypeFilter -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EnablementTypeFilter
enablementType,
            (Text
"MaxResults" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults
          ]
      )

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

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

-- | /See:/ 'newListSkillsResponse' smart constructor.
data ListSkillsResponse = ListSkillsResponse'
  { -- | The token returned to indicate that there is more data available.
    ListSkillsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The list of enabled skills requested. Required.
    ListSkillsResponse -> Maybe [SkillSummary]
skillSummaries :: Prelude.Maybe [SkillSummary],
    -- | The response's http status code.
    ListSkillsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListSkillsResponse -> ListSkillsResponse -> Bool
(ListSkillsResponse -> ListSkillsResponse -> Bool)
-> (ListSkillsResponse -> ListSkillsResponse -> Bool)
-> Eq ListSkillsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSkillsResponse -> ListSkillsResponse -> Bool
$c/= :: ListSkillsResponse -> ListSkillsResponse -> Bool
== :: ListSkillsResponse -> ListSkillsResponse -> Bool
$c== :: ListSkillsResponse -> ListSkillsResponse -> Bool
Prelude.Eq, ReadPrec [ListSkillsResponse]
ReadPrec ListSkillsResponse
Int -> ReadS ListSkillsResponse
ReadS [ListSkillsResponse]
(Int -> ReadS ListSkillsResponse)
-> ReadS [ListSkillsResponse]
-> ReadPrec ListSkillsResponse
-> ReadPrec [ListSkillsResponse]
-> Read ListSkillsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSkillsResponse]
$creadListPrec :: ReadPrec [ListSkillsResponse]
readPrec :: ReadPrec ListSkillsResponse
$creadPrec :: ReadPrec ListSkillsResponse
readList :: ReadS [ListSkillsResponse]
$creadList :: ReadS [ListSkillsResponse]
readsPrec :: Int -> ReadS ListSkillsResponse
$creadsPrec :: Int -> ReadS ListSkillsResponse
Prelude.Read, Int -> ListSkillsResponse -> ShowS
[ListSkillsResponse] -> ShowS
ListSkillsResponse -> String
(Int -> ListSkillsResponse -> ShowS)
-> (ListSkillsResponse -> String)
-> ([ListSkillsResponse] -> ShowS)
-> Show ListSkillsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSkillsResponse] -> ShowS
$cshowList :: [ListSkillsResponse] -> ShowS
show :: ListSkillsResponse -> String
$cshow :: ListSkillsResponse -> String
showsPrec :: Int -> ListSkillsResponse -> ShowS
$cshowsPrec :: Int -> ListSkillsResponse -> ShowS
Prelude.Show, (forall x. ListSkillsResponse -> Rep ListSkillsResponse x)
-> (forall x. Rep ListSkillsResponse x -> ListSkillsResponse)
-> Generic ListSkillsResponse
forall x. Rep ListSkillsResponse x -> ListSkillsResponse
forall x. ListSkillsResponse -> Rep ListSkillsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListSkillsResponse x -> ListSkillsResponse
$cfrom :: forall x. ListSkillsResponse -> Rep ListSkillsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListSkillsResponse' 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', 'listSkillsResponse_nextToken' - The token returned to indicate that there is more data available.
--
-- 'skillSummaries', 'listSkillsResponse_skillSummaries' - The list of enabled skills requested. Required.
--
-- 'httpStatus', 'listSkillsResponse_httpStatus' - The response's http status code.
newListSkillsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListSkillsResponse
newListSkillsResponse :: Int -> ListSkillsResponse
newListSkillsResponse Int
pHttpStatus_ =
  ListSkillsResponse' :: Maybe Text -> Maybe [SkillSummary] -> Int -> ListSkillsResponse
ListSkillsResponse'
    { $sel:nextToken:ListSkillsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:skillSummaries:ListSkillsResponse' :: Maybe [SkillSummary]
skillSummaries = Maybe [SkillSummary]
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListSkillsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | The list of enabled skills requested. Required.
listSkillsResponse_skillSummaries :: Lens.Lens' ListSkillsResponse (Prelude.Maybe [SkillSummary])
listSkillsResponse_skillSummaries :: (Maybe [SkillSummary] -> f (Maybe [SkillSummary]))
-> ListSkillsResponse -> f ListSkillsResponse
listSkillsResponse_skillSummaries = (ListSkillsResponse -> Maybe [SkillSummary])
-> (ListSkillsResponse
    -> Maybe [SkillSummary] -> ListSkillsResponse)
-> Lens' ListSkillsResponse (Maybe [SkillSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSkillsResponse' {Maybe [SkillSummary]
skillSummaries :: Maybe [SkillSummary]
$sel:skillSummaries:ListSkillsResponse' :: ListSkillsResponse -> Maybe [SkillSummary]
skillSummaries} -> Maybe [SkillSummary]
skillSummaries) (\s :: ListSkillsResponse
s@ListSkillsResponse' {} Maybe [SkillSummary]
a -> ListSkillsResponse
s {$sel:skillSummaries:ListSkillsResponse' :: Maybe [SkillSummary]
skillSummaries = Maybe [SkillSummary]
a} :: ListSkillsResponse) ((Maybe [SkillSummary] -> f (Maybe [SkillSummary]))
 -> ListSkillsResponse -> f ListSkillsResponse)
-> ((Maybe [SkillSummary] -> f (Maybe [SkillSummary]))
    -> Maybe [SkillSummary] -> f (Maybe [SkillSummary]))
-> (Maybe [SkillSummary] -> f (Maybe [SkillSummary]))
-> ListSkillsResponse
-> f ListSkillsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [SkillSummary] [SkillSummary] [SkillSummary] [SkillSummary]
-> Iso
     (Maybe [SkillSummary])
     (Maybe [SkillSummary])
     (Maybe [SkillSummary])
     (Maybe [SkillSummary])
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 [SkillSummary] [SkillSummary] [SkillSummary] [SkillSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListSkillsResponse