{-# 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.Comprehend.ListDominantLanguageDetectionJobs
-- 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)
--
-- Gets a list of the dominant language detection jobs that you have
-- submitted.
--
-- This operation returns paginated results.
module Amazonka.Comprehend.ListDominantLanguageDetectionJobs
  ( -- * Creating a Request
    ListDominantLanguageDetectionJobs (..),
    newListDominantLanguageDetectionJobs,

    -- * Request Lenses
    listDominantLanguageDetectionJobs_nextToken,
    listDominantLanguageDetectionJobs_filter,
    listDominantLanguageDetectionJobs_maxResults,

    -- * Destructuring the Response
    ListDominantLanguageDetectionJobsResponse (..),
    newListDominantLanguageDetectionJobsResponse,

    -- * Response Lenses
    listDominantLanguageDetectionJobsResponse_nextToken,
    listDominantLanguageDetectionJobsResponse_dominantLanguageDetectionJobPropertiesList,
    listDominantLanguageDetectionJobsResponse_httpStatus,
  )
where

import Amazonka.Comprehend.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:/ 'newListDominantLanguageDetectionJobs' smart constructor.
data ListDominantLanguageDetectionJobs = ListDominantLanguageDetectionJobs'
  { -- | Identifies the next page of results to return.
    ListDominantLanguageDetectionJobs -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Filters that jobs that are returned. You can filter jobs on their name,
    -- status, or the date and time that they were submitted. You can only set
    -- one filter at a time.
    ListDominantLanguageDetectionJobs
-> Maybe DominantLanguageDetectionJobFilter
filter' :: Prelude.Maybe DominantLanguageDetectionJobFilter,
    -- | The maximum number of results to return in each page. The default is
    -- 100.
    ListDominantLanguageDetectionJobs -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
  }
  deriving (ListDominantLanguageDetectionJobs
-> ListDominantLanguageDetectionJobs -> Bool
(ListDominantLanguageDetectionJobs
 -> ListDominantLanguageDetectionJobs -> Bool)
-> (ListDominantLanguageDetectionJobs
    -> ListDominantLanguageDetectionJobs -> Bool)
-> Eq ListDominantLanguageDetectionJobs
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDominantLanguageDetectionJobs
-> ListDominantLanguageDetectionJobs -> Bool
$c/= :: ListDominantLanguageDetectionJobs
-> ListDominantLanguageDetectionJobs -> Bool
== :: ListDominantLanguageDetectionJobs
-> ListDominantLanguageDetectionJobs -> Bool
$c== :: ListDominantLanguageDetectionJobs
-> ListDominantLanguageDetectionJobs -> Bool
Prelude.Eq, ReadPrec [ListDominantLanguageDetectionJobs]
ReadPrec ListDominantLanguageDetectionJobs
Int -> ReadS ListDominantLanguageDetectionJobs
ReadS [ListDominantLanguageDetectionJobs]
(Int -> ReadS ListDominantLanguageDetectionJobs)
-> ReadS [ListDominantLanguageDetectionJobs]
-> ReadPrec ListDominantLanguageDetectionJobs
-> ReadPrec [ListDominantLanguageDetectionJobs]
-> Read ListDominantLanguageDetectionJobs
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDominantLanguageDetectionJobs]
$creadListPrec :: ReadPrec [ListDominantLanguageDetectionJobs]
readPrec :: ReadPrec ListDominantLanguageDetectionJobs
$creadPrec :: ReadPrec ListDominantLanguageDetectionJobs
readList :: ReadS [ListDominantLanguageDetectionJobs]
$creadList :: ReadS [ListDominantLanguageDetectionJobs]
readsPrec :: Int -> ReadS ListDominantLanguageDetectionJobs
$creadsPrec :: Int -> ReadS ListDominantLanguageDetectionJobs
Prelude.Read, Int -> ListDominantLanguageDetectionJobs -> ShowS
[ListDominantLanguageDetectionJobs] -> ShowS
ListDominantLanguageDetectionJobs -> String
(Int -> ListDominantLanguageDetectionJobs -> ShowS)
-> (ListDominantLanguageDetectionJobs -> String)
-> ([ListDominantLanguageDetectionJobs] -> ShowS)
-> Show ListDominantLanguageDetectionJobs
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDominantLanguageDetectionJobs] -> ShowS
$cshowList :: [ListDominantLanguageDetectionJobs] -> ShowS
show :: ListDominantLanguageDetectionJobs -> String
$cshow :: ListDominantLanguageDetectionJobs -> String
showsPrec :: Int -> ListDominantLanguageDetectionJobs -> ShowS
$cshowsPrec :: Int -> ListDominantLanguageDetectionJobs -> ShowS
Prelude.Show, (forall x.
 ListDominantLanguageDetectionJobs
 -> Rep ListDominantLanguageDetectionJobs x)
-> (forall x.
    Rep ListDominantLanguageDetectionJobs x
    -> ListDominantLanguageDetectionJobs)
-> Generic ListDominantLanguageDetectionJobs
forall x.
Rep ListDominantLanguageDetectionJobs x
-> ListDominantLanguageDetectionJobs
forall x.
ListDominantLanguageDetectionJobs
-> Rep ListDominantLanguageDetectionJobs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDominantLanguageDetectionJobs x
-> ListDominantLanguageDetectionJobs
$cfrom :: forall x.
ListDominantLanguageDetectionJobs
-> Rep ListDominantLanguageDetectionJobs x
Prelude.Generic)

-- |
-- Create a value of 'ListDominantLanguageDetectionJobs' 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', 'listDominantLanguageDetectionJobs_nextToken' - Identifies the next page of results to return.
--
-- 'filter'', 'listDominantLanguageDetectionJobs_filter' - Filters that jobs that are returned. You can filter jobs on their name,
-- status, or the date and time that they were submitted. You can only set
-- one filter at a time.
--
-- 'maxResults', 'listDominantLanguageDetectionJobs_maxResults' - The maximum number of results to return in each page. The default is
-- 100.
newListDominantLanguageDetectionJobs ::
  ListDominantLanguageDetectionJobs
newListDominantLanguageDetectionJobs :: ListDominantLanguageDetectionJobs
newListDominantLanguageDetectionJobs =
  ListDominantLanguageDetectionJobs' :: Maybe Text
-> Maybe DominantLanguageDetectionJobFilter
-> Maybe Natural
-> ListDominantLanguageDetectionJobs
ListDominantLanguageDetectionJobs'
    { $sel:nextToken:ListDominantLanguageDetectionJobs' :: Maybe Text
nextToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:filter':ListDominantLanguageDetectionJobs' :: Maybe DominantLanguageDetectionJobFilter
filter' = Maybe DominantLanguageDetectionJobFilter
forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListDominantLanguageDetectionJobs' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | Identifies the next page of results to return.
listDominantLanguageDetectionJobs_nextToken :: Lens.Lens' ListDominantLanguageDetectionJobs (Prelude.Maybe Prelude.Text)
listDominantLanguageDetectionJobs_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDominantLanguageDetectionJobs
-> f ListDominantLanguageDetectionJobs
listDominantLanguageDetectionJobs_nextToken = (ListDominantLanguageDetectionJobs -> Maybe Text)
-> (ListDominantLanguageDetectionJobs
    -> Maybe Text -> ListDominantLanguageDetectionJobs)
-> Lens
     ListDominantLanguageDetectionJobs
     ListDominantLanguageDetectionJobs
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDominantLanguageDetectionJobs' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDominantLanguageDetectionJobs' :: ListDominantLanguageDetectionJobs -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDominantLanguageDetectionJobs
s@ListDominantLanguageDetectionJobs' {} Maybe Text
a -> ListDominantLanguageDetectionJobs
s {$sel:nextToken:ListDominantLanguageDetectionJobs' :: Maybe Text
nextToken = Maybe Text
a} :: ListDominantLanguageDetectionJobs)

-- | Filters that jobs that are returned. You can filter jobs on their name,
-- status, or the date and time that they were submitted. You can only set
-- one filter at a time.
listDominantLanguageDetectionJobs_filter :: Lens.Lens' ListDominantLanguageDetectionJobs (Prelude.Maybe DominantLanguageDetectionJobFilter)
listDominantLanguageDetectionJobs_filter :: (Maybe DominantLanguageDetectionJobFilter
 -> f (Maybe DominantLanguageDetectionJobFilter))
-> ListDominantLanguageDetectionJobs
-> f ListDominantLanguageDetectionJobs
listDominantLanguageDetectionJobs_filter = (ListDominantLanguageDetectionJobs
 -> Maybe DominantLanguageDetectionJobFilter)
-> (ListDominantLanguageDetectionJobs
    -> Maybe DominantLanguageDetectionJobFilter
    -> ListDominantLanguageDetectionJobs)
-> Lens
     ListDominantLanguageDetectionJobs
     ListDominantLanguageDetectionJobs
     (Maybe DominantLanguageDetectionJobFilter)
     (Maybe DominantLanguageDetectionJobFilter)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDominantLanguageDetectionJobs' {Maybe DominantLanguageDetectionJobFilter
filter' :: Maybe DominantLanguageDetectionJobFilter
$sel:filter':ListDominantLanguageDetectionJobs' :: ListDominantLanguageDetectionJobs
-> Maybe DominantLanguageDetectionJobFilter
filter'} -> Maybe DominantLanguageDetectionJobFilter
filter') (\s :: ListDominantLanguageDetectionJobs
s@ListDominantLanguageDetectionJobs' {} Maybe DominantLanguageDetectionJobFilter
a -> ListDominantLanguageDetectionJobs
s {$sel:filter':ListDominantLanguageDetectionJobs' :: Maybe DominantLanguageDetectionJobFilter
filter' = Maybe DominantLanguageDetectionJobFilter
a} :: ListDominantLanguageDetectionJobs)

-- | The maximum number of results to return in each page. The default is
-- 100.
listDominantLanguageDetectionJobs_maxResults :: Lens.Lens' ListDominantLanguageDetectionJobs (Prelude.Maybe Prelude.Natural)
listDominantLanguageDetectionJobs_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListDominantLanguageDetectionJobs
-> f ListDominantLanguageDetectionJobs
listDominantLanguageDetectionJobs_maxResults = (ListDominantLanguageDetectionJobs -> Maybe Natural)
-> (ListDominantLanguageDetectionJobs
    -> Maybe Natural -> ListDominantLanguageDetectionJobs)
-> Lens
     ListDominantLanguageDetectionJobs
     ListDominantLanguageDetectionJobs
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDominantLanguageDetectionJobs' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListDominantLanguageDetectionJobs' :: ListDominantLanguageDetectionJobs -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListDominantLanguageDetectionJobs
s@ListDominantLanguageDetectionJobs' {} Maybe Natural
a -> ListDominantLanguageDetectionJobs
s {$sel:maxResults:ListDominantLanguageDetectionJobs' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListDominantLanguageDetectionJobs)

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

instance
  Prelude.NFData
    ListDominantLanguageDetectionJobs

instance
  Core.ToHeaders
    ListDominantLanguageDetectionJobs
  where
  toHeaders :: ListDominantLanguageDetectionJobs -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> ListDominantLanguageDetectionJobs -> 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
"Comprehend_20171127.ListDominantLanguageDetectionJobs" ::
                          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
    ListDominantLanguageDetectionJobs
  where
  toJSON :: ListDominantLanguageDetectionJobs -> Value
toJSON ListDominantLanguageDetectionJobs' {Maybe Natural
Maybe Text
Maybe DominantLanguageDetectionJobFilter
maxResults :: Maybe Natural
filter' :: Maybe DominantLanguageDetectionJobFilter
nextToken :: Maybe Text
$sel:maxResults:ListDominantLanguageDetectionJobs' :: ListDominantLanguageDetectionJobs -> Maybe Natural
$sel:filter':ListDominantLanguageDetectionJobs' :: ListDominantLanguageDetectionJobs
-> Maybe DominantLanguageDetectionJobFilter
$sel:nextToken:ListDominantLanguageDetectionJobs' :: ListDominantLanguageDetectionJobs -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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
"Filter" Text -> DominantLanguageDetectionJobFilter -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (DominantLanguageDetectionJobFilter -> Pair)
-> Maybe DominantLanguageDetectionJobFilter -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe DominantLanguageDetectionJobFilter
filter',
            (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
    ListDominantLanguageDetectionJobs
  where
  toPath :: ListDominantLanguageDetectionJobs -> ByteString
toPath = ByteString -> ListDominantLanguageDetectionJobs -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newListDominantLanguageDetectionJobsResponse' smart constructor.
data ListDominantLanguageDetectionJobsResponse = ListDominantLanguageDetectionJobsResponse'
  { -- | Identifies the next page of results to return.
    ListDominantLanguageDetectionJobsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | A list containing the properties of each job that is returned.
    ListDominantLanguageDetectionJobsResponse
-> Maybe [DominantLanguageDetectionJobProperties]
dominantLanguageDetectionJobPropertiesList :: Prelude.Maybe [DominantLanguageDetectionJobProperties],
    -- | The response's http status code.
    ListDominantLanguageDetectionJobsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListDominantLanguageDetectionJobsResponse
-> ListDominantLanguageDetectionJobsResponse -> Bool
(ListDominantLanguageDetectionJobsResponse
 -> ListDominantLanguageDetectionJobsResponse -> Bool)
-> (ListDominantLanguageDetectionJobsResponse
    -> ListDominantLanguageDetectionJobsResponse -> Bool)
-> Eq ListDominantLanguageDetectionJobsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListDominantLanguageDetectionJobsResponse
-> ListDominantLanguageDetectionJobsResponse -> Bool
$c/= :: ListDominantLanguageDetectionJobsResponse
-> ListDominantLanguageDetectionJobsResponse -> Bool
== :: ListDominantLanguageDetectionJobsResponse
-> ListDominantLanguageDetectionJobsResponse -> Bool
$c== :: ListDominantLanguageDetectionJobsResponse
-> ListDominantLanguageDetectionJobsResponse -> Bool
Prelude.Eq, ReadPrec [ListDominantLanguageDetectionJobsResponse]
ReadPrec ListDominantLanguageDetectionJobsResponse
Int -> ReadS ListDominantLanguageDetectionJobsResponse
ReadS [ListDominantLanguageDetectionJobsResponse]
(Int -> ReadS ListDominantLanguageDetectionJobsResponse)
-> ReadS [ListDominantLanguageDetectionJobsResponse]
-> ReadPrec ListDominantLanguageDetectionJobsResponse
-> ReadPrec [ListDominantLanguageDetectionJobsResponse]
-> Read ListDominantLanguageDetectionJobsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListDominantLanguageDetectionJobsResponse]
$creadListPrec :: ReadPrec [ListDominantLanguageDetectionJobsResponse]
readPrec :: ReadPrec ListDominantLanguageDetectionJobsResponse
$creadPrec :: ReadPrec ListDominantLanguageDetectionJobsResponse
readList :: ReadS [ListDominantLanguageDetectionJobsResponse]
$creadList :: ReadS [ListDominantLanguageDetectionJobsResponse]
readsPrec :: Int -> ReadS ListDominantLanguageDetectionJobsResponse
$creadsPrec :: Int -> ReadS ListDominantLanguageDetectionJobsResponse
Prelude.Read, Int -> ListDominantLanguageDetectionJobsResponse -> ShowS
[ListDominantLanguageDetectionJobsResponse] -> ShowS
ListDominantLanguageDetectionJobsResponse -> String
(Int -> ListDominantLanguageDetectionJobsResponse -> ShowS)
-> (ListDominantLanguageDetectionJobsResponse -> String)
-> ([ListDominantLanguageDetectionJobsResponse] -> ShowS)
-> Show ListDominantLanguageDetectionJobsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListDominantLanguageDetectionJobsResponse] -> ShowS
$cshowList :: [ListDominantLanguageDetectionJobsResponse] -> ShowS
show :: ListDominantLanguageDetectionJobsResponse -> String
$cshow :: ListDominantLanguageDetectionJobsResponse -> String
showsPrec :: Int -> ListDominantLanguageDetectionJobsResponse -> ShowS
$cshowsPrec :: Int -> ListDominantLanguageDetectionJobsResponse -> ShowS
Prelude.Show, (forall x.
 ListDominantLanguageDetectionJobsResponse
 -> Rep ListDominantLanguageDetectionJobsResponse x)
-> (forall x.
    Rep ListDominantLanguageDetectionJobsResponse x
    -> ListDominantLanguageDetectionJobsResponse)
-> Generic ListDominantLanguageDetectionJobsResponse
forall x.
Rep ListDominantLanguageDetectionJobsResponse x
-> ListDominantLanguageDetectionJobsResponse
forall x.
ListDominantLanguageDetectionJobsResponse
-> Rep ListDominantLanguageDetectionJobsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListDominantLanguageDetectionJobsResponse x
-> ListDominantLanguageDetectionJobsResponse
$cfrom :: forall x.
ListDominantLanguageDetectionJobsResponse
-> Rep ListDominantLanguageDetectionJobsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListDominantLanguageDetectionJobsResponse' 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', 'listDominantLanguageDetectionJobsResponse_nextToken' - Identifies the next page of results to return.
--
-- 'dominantLanguageDetectionJobPropertiesList', 'listDominantLanguageDetectionJobsResponse_dominantLanguageDetectionJobPropertiesList' - A list containing the properties of each job that is returned.
--
-- 'httpStatus', 'listDominantLanguageDetectionJobsResponse_httpStatus' - The response's http status code.
newListDominantLanguageDetectionJobsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListDominantLanguageDetectionJobsResponse
newListDominantLanguageDetectionJobsResponse :: Int -> ListDominantLanguageDetectionJobsResponse
newListDominantLanguageDetectionJobsResponse
  Int
pHttpStatus_ =
    ListDominantLanguageDetectionJobsResponse' :: Maybe Text
-> Maybe [DominantLanguageDetectionJobProperties]
-> Int
-> ListDominantLanguageDetectionJobsResponse
ListDominantLanguageDetectionJobsResponse'
      { $sel:nextToken:ListDominantLanguageDetectionJobsResponse' :: Maybe Text
nextToken =
          Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:dominantLanguageDetectionJobPropertiesList:ListDominantLanguageDetectionJobsResponse' :: Maybe [DominantLanguageDetectionJobProperties]
dominantLanguageDetectionJobPropertiesList =
          Maybe [DominantLanguageDetectionJobProperties]
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:ListDominantLanguageDetectionJobsResponse' :: Int
httpStatus = Int
pHttpStatus_
      }

-- | Identifies the next page of results to return.
listDominantLanguageDetectionJobsResponse_nextToken :: Lens.Lens' ListDominantLanguageDetectionJobsResponse (Prelude.Maybe Prelude.Text)
listDominantLanguageDetectionJobsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListDominantLanguageDetectionJobsResponse
-> f ListDominantLanguageDetectionJobsResponse
listDominantLanguageDetectionJobsResponse_nextToken = (ListDominantLanguageDetectionJobsResponse -> Maybe Text)
-> (ListDominantLanguageDetectionJobsResponse
    -> Maybe Text -> ListDominantLanguageDetectionJobsResponse)
-> Lens' ListDominantLanguageDetectionJobsResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDominantLanguageDetectionJobsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListDominantLanguageDetectionJobsResponse' :: ListDominantLanguageDetectionJobsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListDominantLanguageDetectionJobsResponse
s@ListDominantLanguageDetectionJobsResponse' {} Maybe Text
a -> ListDominantLanguageDetectionJobsResponse
s {$sel:nextToken:ListDominantLanguageDetectionJobsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListDominantLanguageDetectionJobsResponse)

-- | A list containing the properties of each job that is returned.
listDominantLanguageDetectionJobsResponse_dominantLanguageDetectionJobPropertiesList :: Lens.Lens' ListDominantLanguageDetectionJobsResponse (Prelude.Maybe [DominantLanguageDetectionJobProperties])
listDominantLanguageDetectionJobsResponse_dominantLanguageDetectionJobPropertiesList :: (Maybe [DominantLanguageDetectionJobProperties]
 -> f (Maybe [DominantLanguageDetectionJobProperties]))
-> ListDominantLanguageDetectionJobsResponse
-> f ListDominantLanguageDetectionJobsResponse
listDominantLanguageDetectionJobsResponse_dominantLanguageDetectionJobPropertiesList = (ListDominantLanguageDetectionJobsResponse
 -> Maybe [DominantLanguageDetectionJobProperties])
-> (ListDominantLanguageDetectionJobsResponse
    -> Maybe [DominantLanguageDetectionJobProperties]
    -> ListDominantLanguageDetectionJobsResponse)
-> Lens'
     ListDominantLanguageDetectionJobsResponse
     (Maybe [DominantLanguageDetectionJobProperties])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListDominantLanguageDetectionJobsResponse' {Maybe [DominantLanguageDetectionJobProperties]
dominantLanguageDetectionJobPropertiesList :: Maybe [DominantLanguageDetectionJobProperties]
$sel:dominantLanguageDetectionJobPropertiesList:ListDominantLanguageDetectionJobsResponse' :: ListDominantLanguageDetectionJobsResponse
-> Maybe [DominantLanguageDetectionJobProperties]
dominantLanguageDetectionJobPropertiesList} -> Maybe [DominantLanguageDetectionJobProperties]
dominantLanguageDetectionJobPropertiesList) (\s :: ListDominantLanguageDetectionJobsResponse
s@ListDominantLanguageDetectionJobsResponse' {} Maybe [DominantLanguageDetectionJobProperties]
a -> ListDominantLanguageDetectionJobsResponse
s {$sel:dominantLanguageDetectionJobPropertiesList:ListDominantLanguageDetectionJobsResponse' :: Maybe [DominantLanguageDetectionJobProperties]
dominantLanguageDetectionJobPropertiesList = Maybe [DominantLanguageDetectionJobProperties]
a} :: ListDominantLanguageDetectionJobsResponse) ((Maybe [DominantLanguageDetectionJobProperties]
  -> f (Maybe [DominantLanguageDetectionJobProperties]))
 -> ListDominantLanguageDetectionJobsResponse
 -> f ListDominantLanguageDetectionJobsResponse)
-> ((Maybe [DominantLanguageDetectionJobProperties]
     -> f (Maybe [DominantLanguageDetectionJobProperties]))
    -> Maybe [DominantLanguageDetectionJobProperties]
    -> f (Maybe [DominantLanguageDetectionJobProperties]))
-> (Maybe [DominantLanguageDetectionJobProperties]
    -> f (Maybe [DominantLanguageDetectionJobProperties]))
-> ListDominantLanguageDetectionJobsResponse
-> f ListDominantLanguageDetectionJobsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [DominantLanguageDetectionJobProperties]
  [DominantLanguageDetectionJobProperties]
  [DominantLanguageDetectionJobProperties]
  [DominantLanguageDetectionJobProperties]
-> Iso
     (Maybe [DominantLanguageDetectionJobProperties])
     (Maybe [DominantLanguageDetectionJobProperties])
     (Maybe [DominantLanguageDetectionJobProperties])
     (Maybe [DominantLanguageDetectionJobProperties])
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
  [DominantLanguageDetectionJobProperties]
  [DominantLanguageDetectionJobProperties]
  [DominantLanguageDetectionJobProperties]
  [DominantLanguageDetectionJobProperties]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance
  Prelude.NFData
    ListDominantLanguageDetectionJobsResponse