{-# 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.LakeFormation.GetWorkUnits
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Retrieves the work units generated by the @StartQueryPlanning@
-- operation.
--
-- This operation returns paginated results.
module Amazonka.LakeFormation.GetWorkUnits
  ( -- * Creating a Request
    GetWorkUnits (..),
    newGetWorkUnits,

    -- * Request Lenses
    getWorkUnits_nextToken,
    getWorkUnits_pageSize,
    getWorkUnits_queryId,

    -- * Destructuring the Response
    GetWorkUnitsResponse (..),
    newGetWorkUnitsResponse,

    -- * Response Lenses
    getWorkUnitsResponse_nextToken,
    getWorkUnitsResponse_httpStatus,
    getWorkUnitsResponse_queryId,
    getWorkUnitsResponse_workUnitRanges,
  )
where

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

-- | /See:/ 'newGetWorkUnits' smart constructor.
data GetWorkUnits = GetWorkUnits'
  { -- | A continuation token, if this is a continuation call.
    GetWorkUnits -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The size of each page to get in the Amazon Web Services service call.
    -- This does not affect the number of items returned in the command\'s
    -- output. Setting a smaller page size results in more calls to the Amazon
    -- Web Services service, retrieving fewer items in each call. This can help
    -- prevent the Amazon Web Services service calls from timing out.
    GetWorkUnits -> Maybe Int
pageSize :: Prelude.Maybe Prelude.Int,
    -- | The ID of the plan query operation.
    GetWorkUnits -> Text
queryId :: Prelude.Text
  }
  deriving (GetWorkUnits -> GetWorkUnits -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetWorkUnits -> GetWorkUnits -> Bool
$c/= :: GetWorkUnits -> GetWorkUnits -> Bool
== :: GetWorkUnits -> GetWorkUnits -> Bool
$c== :: GetWorkUnits -> GetWorkUnits -> Bool
Prelude.Eq, ReadPrec [GetWorkUnits]
ReadPrec GetWorkUnits
Int -> ReadS GetWorkUnits
ReadS [GetWorkUnits]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetWorkUnits]
$creadListPrec :: ReadPrec [GetWorkUnits]
readPrec :: ReadPrec GetWorkUnits
$creadPrec :: ReadPrec GetWorkUnits
readList :: ReadS [GetWorkUnits]
$creadList :: ReadS [GetWorkUnits]
readsPrec :: Int -> ReadS GetWorkUnits
$creadsPrec :: Int -> ReadS GetWorkUnits
Prelude.Read, Int -> GetWorkUnits -> ShowS
[GetWorkUnits] -> ShowS
GetWorkUnits -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetWorkUnits] -> ShowS
$cshowList :: [GetWorkUnits] -> ShowS
show :: GetWorkUnits -> String
$cshow :: GetWorkUnits -> String
showsPrec :: Int -> GetWorkUnits -> ShowS
$cshowsPrec :: Int -> GetWorkUnits -> ShowS
Prelude.Show, forall x. Rep GetWorkUnits x -> GetWorkUnits
forall x. GetWorkUnits -> Rep GetWorkUnits x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetWorkUnits x -> GetWorkUnits
$cfrom :: forall x. GetWorkUnits -> Rep GetWorkUnits x
Prelude.Generic)

-- |
-- Create a value of 'GetWorkUnits' 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', 'getWorkUnits_nextToken' - A continuation token, if this is a continuation call.
--
-- 'pageSize', 'getWorkUnits_pageSize' - The size of each page to get in the Amazon Web Services service call.
-- This does not affect the number of items returned in the command\'s
-- output. Setting a smaller page size results in more calls to the Amazon
-- Web Services service, retrieving fewer items in each call. This can help
-- prevent the Amazon Web Services service calls from timing out.
--
-- 'queryId', 'getWorkUnits_queryId' - The ID of the plan query operation.
newGetWorkUnits ::
  -- | 'queryId'
  Prelude.Text ->
  GetWorkUnits
newGetWorkUnits :: Text -> GetWorkUnits
newGetWorkUnits Text
pQueryId_ =
  GetWorkUnits'
    { $sel:nextToken:GetWorkUnits' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:pageSize:GetWorkUnits' :: Maybe Int
pageSize = forall a. Maybe a
Prelude.Nothing,
      $sel:queryId:GetWorkUnits' :: Text
queryId = Text
pQueryId_
    }

-- | A continuation token, if this is a continuation call.
getWorkUnits_nextToken :: Lens.Lens' GetWorkUnits (Prelude.Maybe Prelude.Text)
getWorkUnits_nextToken :: Lens' GetWorkUnits (Maybe Text)
getWorkUnits_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetWorkUnits' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetWorkUnits' :: GetWorkUnits -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetWorkUnits
s@GetWorkUnits' {} Maybe Text
a -> GetWorkUnits
s {$sel:nextToken:GetWorkUnits' :: Maybe Text
nextToken = Maybe Text
a} :: GetWorkUnits)

-- | The size of each page to get in the Amazon Web Services service call.
-- This does not affect the number of items returned in the command\'s
-- output. Setting a smaller page size results in more calls to the Amazon
-- Web Services service, retrieving fewer items in each call. This can help
-- prevent the Amazon Web Services service calls from timing out.
getWorkUnits_pageSize :: Lens.Lens' GetWorkUnits (Prelude.Maybe Prelude.Int)
getWorkUnits_pageSize :: Lens' GetWorkUnits (Maybe Int)
getWorkUnits_pageSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetWorkUnits' {Maybe Int
pageSize :: Maybe Int
$sel:pageSize:GetWorkUnits' :: GetWorkUnits -> Maybe Int
pageSize} -> Maybe Int
pageSize) (\s :: GetWorkUnits
s@GetWorkUnits' {} Maybe Int
a -> GetWorkUnits
s {$sel:pageSize:GetWorkUnits' :: Maybe Int
pageSize = Maybe Int
a} :: GetWorkUnits)

-- | The ID of the plan query operation.
getWorkUnits_queryId :: Lens.Lens' GetWorkUnits Prelude.Text
getWorkUnits_queryId :: Lens' GetWorkUnits Text
getWorkUnits_queryId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetWorkUnits' {Text
queryId :: Text
$sel:queryId:GetWorkUnits' :: GetWorkUnits -> Text
queryId} -> Text
queryId) (\s :: GetWorkUnits
s@GetWorkUnits' {} Text
a -> GetWorkUnits
s {$sel:queryId:GetWorkUnits' :: Text
queryId = Text
a} :: GetWorkUnits)

instance Core.AWSPager GetWorkUnits where
  page :: GetWorkUnits -> AWSResponse GetWorkUnits -> Maybe GetWorkUnits
page GetWorkUnits
rq AWSResponse GetWorkUnits
rs
    | forall a. AWSTruncated a => a -> Bool
Core.stop
        ( AWSResponse GetWorkUnits
rs
            forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetWorkUnitsResponse (Maybe Text)
getWorkUnitsResponse_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 GetWorkUnits
rs forall s a. s -> Getting a s a -> a
Lens.^. Lens' GetWorkUnitsResponse [WorkUnitRange]
getWorkUnitsResponse_workUnitRanges) =
        forall a. Maybe a
Prelude.Nothing
    | Bool
Prelude.otherwise =
        forall a. a -> Maybe a
Prelude.Just
          forall a b. (a -> b) -> a -> b
Prelude.$ GetWorkUnits
rq
          forall a b. a -> (a -> b) -> b
Prelude.& Lens' GetWorkUnits (Maybe Text)
getWorkUnits_nextToken
          forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse GetWorkUnits
rs
          forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' GetWorkUnitsResponse (Maybe Text)
getWorkUnitsResponse_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 GetWorkUnits where
  type AWSResponse GetWorkUnits = GetWorkUnitsResponse
  request :: (Service -> Service) -> GetWorkUnits -> Request GetWorkUnits
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 GetWorkUnits
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse GetWorkUnits)))
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
-> Int -> Text -> [WorkUnitRange] -> GetWorkUnitsResponse
GetWorkUnitsResponse'
            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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String a
Data..:> Key
"QueryId")
            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
"WorkUnitRanges"
                            forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable GetWorkUnits where
  hashWithSalt :: Int -> GetWorkUnits -> Int
hashWithSalt Int
_salt GetWorkUnits' {Maybe Int
Maybe Text
Text
queryId :: Text
pageSize :: Maybe Int
nextToken :: Maybe Text
$sel:queryId:GetWorkUnits' :: GetWorkUnits -> Text
$sel:pageSize:GetWorkUnits' :: GetWorkUnits -> Maybe Int
$sel:nextToken:GetWorkUnits' :: GetWorkUnits -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
pageSize
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
queryId

instance Prelude.NFData GetWorkUnits where
  rnf :: GetWorkUnits -> ()
rnf GetWorkUnits' {Maybe Int
Maybe Text
Text
queryId :: Text
pageSize :: Maybe Int
nextToken :: Maybe Text
$sel:queryId:GetWorkUnits' :: GetWorkUnits -> Text
$sel:pageSize:GetWorkUnits' :: GetWorkUnits -> Maybe Int
$sel:nextToken:GetWorkUnits' :: GetWorkUnits -> 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 Int
pageSize
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
queryId

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

instance Data.ToJSON GetWorkUnits where
  toJSON :: GetWorkUnits -> Value
toJSON GetWorkUnits' {Maybe Int
Maybe Text
Text
queryId :: Text
pageSize :: Maybe Int
nextToken :: Maybe Text
$sel:queryId:GetWorkUnits' :: GetWorkUnits -> Text
$sel:pageSize:GetWorkUnits' :: GetWorkUnits -> Maybe Int
$sel:nextToken:GetWorkUnits' :: GetWorkUnits -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (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
"PageSize" 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 Int
pageSize,
            forall a. a -> Maybe a
Prelude.Just (Key
"QueryId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
queryId)
          ]
      )

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

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

-- | A structure for the output.
--
-- /See:/ 'newGetWorkUnitsResponse' smart constructor.
data GetWorkUnitsResponse = GetWorkUnitsResponse'
  { -- | A continuation token for paginating the returned list of tokens,
    -- returned if the current segment of the list is not the last.
    GetWorkUnitsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    GetWorkUnitsResponse -> Int
httpStatus :: Prelude.Int,
    -- | The ID of the plan query operation.
    GetWorkUnitsResponse -> Text
queryId :: Prelude.Text,
    -- | A @WorkUnitRangeList@ object that specifies the valid range of work unit
    -- IDs for querying the execution service.
    GetWorkUnitsResponse -> [WorkUnitRange]
workUnitRanges :: [WorkUnitRange]
  }
  deriving (GetWorkUnitsResponse -> GetWorkUnitsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetWorkUnitsResponse -> GetWorkUnitsResponse -> Bool
$c/= :: GetWorkUnitsResponse -> GetWorkUnitsResponse -> Bool
== :: GetWorkUnitsResponse -> GetWorkUnitsResponse -> Bool
$c== :: GetWorkUnitsResponse -> GetWorkUnitsResponse -> Bool
Prelude.Eq, ReadPrec [GetWorkUnitsResponse]
ReadPrec GetWorkUnitsResponse
Int -> ReadS GetWorkUnitsResponse
ReadS [GetWorkUnitsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetWorkUnitsResponse]
$creadListPrec :: ReadPrec [GetWorkUnitsResponse]
readPrec :: ReadPrec GetWorkUnitsResponse
$creadPrec :: ReadPrec GetWorkUnitsResponse
readList :: ReadS [GetWorkUnitsResponse]
$creadList :: ReadS [GetWorkUnitsResponse]
readsPrec :: Int -> ReadS GetWorkUnitsResponse
$creadsPrec :: Int -> ReadS GetWorkUnitsResponse
Prelude.Read, Int -> GetWorkUnitsResponse -> ShowS
[GetWorkUnitsResponse] -> ShowS
GetWorkUnitsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetWorkUnitsResponse] -> ShowS
$cshowList :: [GetWorkUnitsResponse] -> ShowS
show :: GetWorkUnitsResponse -> String
$cshow :: GetWorkUnitsResponse -> String
showsPrec :: Int -> GetWorkUnitsResponse -> ShowS
$cshowsPrec :: Int -> GetWorkUnitsResponse -> ShowS
Prelude.Show, forall x. Rep GetWorkUnitsResponse x -> GetWorkUnitsResponse
forall x. GetWorkUnitsResponse -> Rep GetWorkUnitsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetWorkUnitsResponse x -> GetWorkUnitsResponse
$cfrom :: forall x. GetWorkUnitsResponse -> Rep GetWorkUnitsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetWorkUnitsResponse' 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', 'getWorkUnitsResponse_nextToken' - A continuation token for paginating the returned list of tokens,
-- returned if the current segment of the list is not the last.
--
-- 'httpStatus', 'getWorkUnitsResponse_httpStatus' - The response's http status code.
--
-- 'queryId', 'getWorkUnitsResponse_queryId' - The ID of the plan query operation.
--
-- 'workUnitRanges', 'getWorkUnitsResponse_workUnitRanges' - A @WorkUnitRangeList@ object that specifies the valid range of work unit
-- IDs for querying the execution service.
newGetWorkUnitsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'queryId'
  Prelude.Text ->
  GetWorkUnitsResponse
newGetWorkUnitsResponse :: Int -> Text -> GetWorkUnitsResponse
newGetWorkUnitsResponse Int
pHttpStatus_ Text
pQueryId_ =
  GetWorkUnitsResponse'
    { $sel:nextToken:GetWorkUnitsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetWorkUnitsResponse' :: Int
httpStatus = Int
pHttpStatus_,
      $sel:queryId:GetWorkUnitsResponse' :: Text
queryId = Text
pQueryId_,
      $sel:workUnitRanges:GetWorkUnitsResponse' :: [WorkUnitRange]
workUnitRanges = forall a. Monoid a => a
Prelude.mempty
    }

-- | A continuation token for paginating the returned list of tokens,
-- returned if the current segment of the list is not the last.
getWorkUnitsResponse_nextToken :: Lens.Lens' GetWorkUnitsResponse (Prelude.Maybe Prelude.Text)
getWorkUnitsResponse_nextToken :: Lens' GetWorkUnitsResponse (Maybe Text)
getWorkUnitsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetWorkUnitsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:GetWorkUnitsResponse' :: GetWorkUnitsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: GetWorkUnitsResponse
s@GetWorkUnitsResponse' {} Maybe Text
a -> GetWorkUnitsResponse
s {$sel:nextToken:GetWorkUnitsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: GetWorkUnitsResponse)

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

-- | The ID of the plan query operation.
getWorkUnitsResponse_queryId :: Lens.Lens' GetWorkUnitsResponse Prelude.Text
getWorkUnitsResponse_queryId :: Lens' GetWorkUnitsResponse Text
getWorkUnitsResponse_queryId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetWorkUnitsResponse' {Text
queryId :: Text
$sel:queryId:GetWorkUnitsResponse' :: GetWorkUnitsResponse -> Text
queryId} -> Text
queryId) (\s :: GetWorkUnitsResponse
s@GetWorkUnitsResponse' {} Text
a -> GetWorkUnitsResponse
s {$sel:queryId:GetWorkUnitsResponse' :: Text
queryId = Text
a} :: GetWorkUnitsResponse)

-- | A @WorkUnitRangeList@ object that specifies the valid range of work unit
-- IDs for querying the execution service.
getWorkUnitsResponse_workUnitRanges :: Lens.Lens' GetWorkUnitsResponse [WorkUnitRange]
getWorkUnitsResponse_workUnitRanges :: Lens' GetWorkUnitsResponse [WorkUnitRange]
getWorkUnitsResponse_workUnitRanges = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetWorkUnitsResponse' {[WorkUnitRange]
workUnitRanges :: [WorkUnitRange]
$sel:workUnitRanges:GetWorkUnitsResponse' :: GetWorkUnitsResponse -> [WorkUnitRange]
workUnitRanges} -> [WorkUnitRange]
workUnitRanges) (\s :: GetWorkUnitsResponse
s@GetWorkUnitsResponse' {} [WorkUnitRange]
a -> GetWorkUnitsResponse
s {$sel:workUnitRanges:GetWorkUnitsResponse' :: [WorkUnitRange]
workUnitRanges = [WorkUnitRange]
a} :: GetWorkUnitsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Prelude.NFData GetWorkUnitsResponse where
  rnf :: GetWorkUnitsResponse -> ()
rnf GetWorkUnitsResponse' {Int
[WorkUnitRange]
Maybe Text
Text
workUnitRanges :: [WorkUnitRange]
queryId :: Text
httpStatus :: Int
nextToken :: Maybe Text
$sel:workUnitRanges:GetWorkUnitsResponse' :: GetWorkUnitsResponse -> [WorkUnitRange]
$sel:queryId:GetWorkUnitsResponse' :: GetWorkUnitsResponse -> Text
$sel:httpStatus:GetWorkUnitsResponse' :: GetWorkUnitsResponse -> Int
$sel:nextToken:GetWorkUnitsResponse' :: GetWorkUnitsResponse -> 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 Int
httpStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
queryId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [WorkUnitRange]
workUnitRanges