{-# 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.LookoutEquipment.ListLabels
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Provides a list of labels.
module Amazonka.LookoutEquipment.ListLabels
  ( -- * Creating a Request
    ListLabels (..),
    newListLabels,

    -- * Request Lenses
    listLabels_equipment,
    listLabels_faultCode,
    listLabels_intervalEndTime,
    listLabels_intervalStartTime,
    listLabels_maxResults,
    listLabels_nextToken,
    listLabels_labelGroupName,

    -- * Destructuring the Response
    ListLabelsResponse (..),
    newListLabelsResponse,

    -- * Response Lenses
    listLabelsResponse_labelSummaries,
    listLabelsResponse_nextToken,
    listLabelsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListLabels' smart constructor.
data ListLabels = ListLabels'
  { -- | Lists the labels that pertain to a particular piece of equipment.
    ListLabels -> Maybe Text
equipment :: Prelude.Maybe Prelude.Text,
    -- | Returns labels with a particular fault code.
    ListLabels -> Maybe Text
faultCode :: Prelude.Maybe Prelude.Text,
    -- | Returns all labels with a start time earlier than the end time given.
    ListLabels -> Maybe POSIX
intervalEndTime :: Prelude.Maybe Data.POSIX,
    -- | Returns all the labels with a end time equal to or later than the start
    -- time given.
    ListLabels -> Maybe POSIX
intervalStartTime :: Prelude.Maybe Data.POSIX,
    -- | Specifies the maximum number of labels to list.
    ListLabels -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
    -- | An opaque pagination token indicating where to continue the listing of
    -- label groups.
    ListLabels -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | Retruns the name of the label group.
    ListLabels -> Text
labelGroupName :: Prelude.Text
  }
  deriving (ListLabels -> ListLabels -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListLabels -> ListLabels -> Bool
$c/= :: ListLabels -> ListLabels -> Bool
== :: ListLabels -> ListLabels -> Bool
$c== :: ListLabels -> ListLabels -> Bool
Prelude.Eq, ReadPrec [ListLabels]
ReadPrec ListLabels
Int -> ReadS ListLabels
ReadS [ListLabels]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListLabels]
$creadListPrec :: ReadPrec [ListLabels]
readPrec :: ReadPrec ListLabels
$creadPrec :: ReadPrec ListLabels
readList :: ReadS [ListLabels]
$creadList :: ReadS [ListLabels]
readsPrec :: Int -> ReadS ListLabels
$creadsPrec :: Int -> ReadS ListLabels
Prelude.Read, Int -> ListLabels -> ShowS
[ListLabels] -> ShowS
ListLabels -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListLabels] -> ShowS
$cshowList :: [ListLabels] -> ShowS
show :: ListLabels -> String
$cshow :: ListLabels -> String
showsPrec :: Int -> ListLabels -> ShowS
$cshowsPrec :: Int -> ListLabels -> ShowS
Prelude.Show, forall x. Rep ListLabels x -> ListLabels
forall x. ListLabels -> Rep ListLabels x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListLabels x -> ListLabels
$cfrom :: forall x. ListLabels -> Rep ListLabels x
Prelude.Generic)

-- |
-- Create a value of 'ListLabels' 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:
--
-- 'equipment', 'listLabels_equipment' - Lists the labels that pertain to a particular piece of equipment.
--
-- 'faultCode', 'listLabels_faultCode' - Returns labels with a particular fault code.
--
-- 'intervalEndTime', 'listLabels_intervalEndTime' - Returns all labels with a start time earlier than the end time given.
--
-- 'intervalStartTime', 'listLabels_intervalStartTime' - Returns all the labels with a end time equal to or later than the start
-- time given.
--
-- 'maxResults', 'listLabels_maxResults' - Specifies the maximum number of labels to list.
--
-- 'nextToken', 'listLabels_nextToken' - An opaque pagination token indicating where to continue the listing of
-- label groups.
--
-- 'labelGroupName', 'listLabels_labelGroupName' - Retruns the name of the label group.
newListLabels ::
  -- | 'labelGroupName'
  Prelude.Text ->
  ListLabels
newListLabels :: Text -> ListLabels
newListLabels Text
pLabelGroupName_ =
  ListLabels'
    { $sel:equipment:ListLabels' :: Maybe Text
equipment = forall a. Maybe a
Prelude.Nothing,
      $sel:faultCode:ListLabels' :: Maybe Text
faultCode = forall a. Maybe a
Prelude.Nothing,
      $sel:intervalEndTime:ListLabels' :: Maybe POSIX
intervalEndTime = forall a. Maybe a
Prelude.Nothing,
      $sel:intervalStartTime:ListLabels' :: Maybe POSIX
intervalStartTime = forall a. Maybe a
Prelude.Nothing,
      $sel:maxResults:ListLabels' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListLabels' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:labelGroupName:ListLabels' :: Text
labelGroupName = Text
pLabelGroupName_
    }

-- | Lists the labels that pertain to a particular piece of equipment.
listLabels_equipment :: Lens.Lens' ListLabels (Prelude.Maybe Prelude.Text)
listLabels_equipment :: Lens' ListLabels (Maybe Text)
listLabels_equipment = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLabels' {Maybe Text
equipment :: Maybe Text
$sel:equipment:ListLabels' :: ListLabels -> Maybe Text
equipment} -> Maybe Text
equipment) (\s :: ListLabels
s@ListLabels' {} Maybe Text
a -> ListLabels
s {$sel:equipment:ListLabels' :: Maybe Text
equipment = Maybe Text
a} :: ListLabels)

-- | Returns labels with a particular fault code.
listLabels_faultCode :: Lens.Lens' ListLabels (Prelude.Maybe Prelude.Text)
listLabels_faultCode :: Lens' ListLabels (Maybe Text)
listLabels_faultCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLabels' {Maybe Text
faultCode :: Maybe Text
$sel:faultCode:ListLabels' :: ListLabels -> Maybe Text
faultCode} -> Maybe Text
faultCode) (\s :: ListLabels
s@ListLabels' {} Maybe Text
a -> ListLabels
s {$sel:faultCode:ListLabels' :: Maybe Text
faultCode = Maybe Text
a} :: ListLabels)

-- | Returns all labels with a start time earlier than the end time given.
listLabels_intervalEndTime :: Lens.Lens' ListLabels (Prelude.Maybe Prelude.UTCTime)
listLabels_intervalEndTime :: Lens' ListLabels (Maybe UTCTime)
listLabels_intervalEndTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLabels' {Maybe POSIX
intervalEndTime :: Maybe POSIX
$sel:intervalEndTime:ListLabels' :: ListLabels -> Maybe POSIX
intervalEndTime} -> Maybe POSIX
intervalEndTime) (\s :: ListLabels
s@ListLabels' {} Maybe POSIX
a -> ListLabels
s {$sel:intervalEndTime:ListLabels' :: Maybe POSIX
intervalEndTime = Maybe POSIX
a} :: ListLabels) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | Returns all the labels with a end time equal to or later than the start
-- time given.
listLabels_intervalStartTime :: Lens.Lens' ListLabels (Prelude.Maybe Prelude.UTCTime)
listLabels_intervalStartTime :: Lens' ListLabels (Maybe UTCTime)
listLabels_intervalStartTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLabels' {Maybe POSIX
intervalStartTime :: Maybe POSIX
$sel:intervalStartTime:ListLabels' :: ListLabels -> Maybe POSIX
intervalStartTime} -> Maybe POSIX
intervalStartTime) (\s :: ListLabels
s@ListLabels' {} Maybe POSIX
a -> ListLabels
s {$sel:intervalStartTime:ListLabels' :: Maybe POSIX
intervalStartTime = Maybe POSIX
a} :: ListLabels) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | Specifies the maximum number of labels to list.
listLabels_maxResults :: Lens.Lens' ListLabels (Prelude.Maybe Prelude.Natural)
listLabels_maxResults :: Lens' ListLabels (Maybe Natural)
listLabels_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLabels' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListLabels' :: ListLabels -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListLabels
s@ListLabels' {} Maybe Natural
a -> ListLabels
s {$sel:maxResults:ListLabels' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListLabels)

-- | An opaque pagination token indicating where to continue the listing of
-- label groups.
listLabels_nextToken :: Lens.Lens' ListLabels (Prelude.Maybe Prelude.Text)
listLabels_nextToken :: Lens' ListLabels (Maybe Text)
listLabels_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLabels' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListLabels' :: ListLabels -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListLabels
s@ListLabels' {} Maybe Text
a -> ListLabels
s {$sel:nextToken:ListLabels' :: Maybe Text
nextToken = Maybe Text
a} :: ListLabels)

-- | Retruns the name of the label group.
listLabels_labelGroupName :: Lens.Lens' ListLabels Prelude.Text
listLabels_labelGroupName :: Lens' ListLabels Text
listLabels_labelGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLabels' {Text
labelGroupName :: Text
$sel:labelGroupName:ListLabels' :: ListLabels -> Text
labelGroupName} -> Text
labelGroupName) (\s :: ListLabels
s@ListLabels' {} Text
a -> ListLabels
s {$sel:labelGroupName:ListLabels' :: Text
labelGroupName = Text
a} :: ListLabels)

instance Core.AWSRequest ListLabels where
  type AWSResponse ListLabels = ListLabelsResponse
  request :: (Service -> Service) -> ListLabels -> Request ListLabels
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 ListLabels
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListLabels)))
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 [LabelSummary] -> Maybe Text -> Int -> ListLabelsResponse
ListLabelsResponse'
            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
"LabelSummaries" 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
"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))
      )

instance Prelude.Hashable ListLabels where
  hashWithSalt :: Int -> ListLabels -> Int
hashWithSalt Int
_salt ListLabels' {Maybe Natural
Maybe Text
Maybe POSIX
Text
labelGroupName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
intervalStartTime :: Maybe POSIX
intervalEndTime :: Maybe POSIX
faultCode :: Maybe Text
equipment :: Maybe Text
$sel:labelGroupName:ListLabels' :: ListLabels -> Text
$sel:nextToken:ListLabels' :: ListLabels -> Maybe Text
$sel:maxResults:ListLabels' :: ListLabels -> Maybe Natural
$sel:intervalStartTime:ListLabels' :: ListLabels -> Maybe POSIX
$sel:intervalEndTime:ListLabels' :: ListLabels -> Maybe POSIX
$sel:faultCode:ListLabels' :: ListLabels -> Maybe Text
$sel:equipment:ListLabels' :: ListLabels -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
equipment
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
faultCode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
intervalEndTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
intervalStartTime
      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` Text
labelGroupName

instance Prelude.NFData ListLabels where
  rnf :: ListLabels -> ()
rnf ListLabels' {Maybe Natural
Maybe Text
Maybe POSIX
Text
labelGroupName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
intervalStartTime :: Maybe POSIX
intervalEndTime :: Maybe POSIX
faultCode :: Maybe Text
equipment :: Maybe Text
$sel:labelGroupName:ListLabels' :: ListLabels -> Text
$sel:nextToken:ListLabels' :: ListLabels -> Maybe Text
$sel:maxResults:ListLabels' :: ListLabels -> Maybe Natural
$sel:intervalStartTime:ListLabels' :: ListLabels -> Maybe POSIX
$sel:intervalEndTime:ListLabels' :: ListLabels -> Maybe POSIX
$sel:faultCode:ListLabels' :: ListLabels -> Maybe Text
$sel:equipment:ListLabels' :: ListLabels -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
equipment
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
faultCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
intervalEndTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
intervalStartTime
      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 Text
labelGroupName

instance Data.ToHeaders ListLabels where
  toHeaders :: ListLabels -> 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
"AWSLookoutEquipmentFrontendService.ListLabels" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON ListLabels where
  toJSON :: ListLabels -> Value
toJSON ListLabels' {Maybe Natural
Maybe Text
Maybe POSIX
Text
labelGroupName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
intervalStartTime :: Maybe POSIX
intervalEndTime :: Maybe POSIX
faultCode :: Maybe Text
equipment :: Maybe Text
$sel:labelGroupName:ListLabels' :: ListLabels -> Text
$sel:nextToken:ListLabels' :: ListLabels -> Maybe Text
$sel:maxResults:ListLabels' :: ListLabels -> Maybe Natural
$sel:intervalStartTime:ListLabels' :: ListLabels -> Maybe POSIX
$sel:intervalEndTime:ListLabels' :: ListLabels -> Maybe POSIX
$sel:faultCode:ListLabels' :: ListLabels -> Maybe Text
$sel:equipment:ListLabels' :: ListLabels -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Equipment" 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
equipment,
            (Key
"FaultCode" 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
faultCode,
            (Key
"IntervalEndTime" 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 POSIX
intervalEndTime,
            (Key
"IntervalStartTime" 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 POSIX
intervalStartTime,
            (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,
            forall a. a -> Maybe a
Prelude.Just
              (Key
"LabelGroupName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
labelGroupName)
          ]
      )

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

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

-- | /See:/ 'newListLabelsResponse' smart constructor.
data ListLabelsResponse = ListLabelsResponse'
  { -- | A summary of the items in the label group.
    ListLabelsResponse -> Maybe [LabelSummary]
labelSummaries :: Prelude.Maybe [LabelSummary],
    -- | An opaque pagination token indicating where to continue the listing of
    -- datasets.
    ListLabelsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    ListLabelsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListLabelsResponse -> ListLabelsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListLabelsResponse -> ListLabelsResponse -> Bool
$c/= :: ListLabelsResponse -> ListLabelsResponse -> Bool
== :: ListLabelsResponse -> ListLabelsResponse -> Bool
$c== :: ListLabelsResponse -> ListLabelsResponse -> Bool
Prelude.Eq, ReadPrec [ListLabelsResponse]
ReadPrec ListLabelsResponse
Int -> ReadS ListLabelsResponse
ReadS [ListLabelsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListLabelsResponse]
$creadListPrec :: ReadPrec [ListLabelsResponse]
readPrec :: ReadPrec ListLabelsResponse
$creadPrec :: ReadPrec ListLabelsResponse
readList :: ReadS [ListLabelsResponse]
$creadList :: ReadS [ListLabelsResponse]
readsPrec :: Int -> ReadS ListLabelsResponse
$creadsPrec :: Int -> ReadS ListLabelsResponse
Prelude.Read, Int -> ListLabelsResponse -> ShowS
[ListLabelsResponse] -> ShowS
ListLabelsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListLabelsResponse] -> ShowS
$cshowList :: [ListLabelsResponse] -> ShowS
show :: ListLabelsResponse -> String
$cshow :: ListLabelsResponse -> String
showsPrec :: Int -> ListLabelsResponse -> ShowS
$cshowsPrec :: Int -> ListLabelsResponse -> ShowS
Prelude.Show, forall x. Rep ListLabelsResponse x -> ListLabelsResponse
forall x. ListLabelsResponse -> Rep ListLabelsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListLabelsResponse x -> ListLabelsResponse
$cfrom :: forall x. ListLabelsResponse -> Rep ListLabelsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListLabelsResponse' 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:
--
-- 'labelSummaries', 'listLabelsResponse_labelSummaries' - A summary of the items in the label group.
--
-- 'nextToken', 'listLabelsResponse_nextToken' - An opaque pagination token indicating where to continue the listing of
-- datasets.
--
-- 'httpStatus', 'listLabelsResponse_httpStatus' - The response's http status code.
newListLabelsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListLabelsResponse
newListLabelsResponse :: Int -> ListLabelsResponse
newListLabelsResponse Int
pHttpStatus_ =
  ListLabelsResponse'
    { $sel:labelSummaries:ListLabelsResponse' :: Maybe [LabelSummary]
labelSummaries =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nextToken:ListLabelsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListLabelsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A summary of the items in the label group.
listLabelsResponse_labelSummaries :: Lens.Lens' ListLabelsResponse (Prelude.Maybe [LabelSummary])
listLabelsResponse_labelSummaries :: Lens' ListLabelsResponse (Maybe [LabelSummary])
listLabelsResponse_labelSummaries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLabelsResponse' {Maybe [LabelSummary]
labelSummaries :: Maybe [LabelSummary]
$sel:labelSummaries:ListLabelsResponse' :: ListLabelsResponse -> Maybe [LabelSummary]
labelSummaries} -> Maybe [LabelSummary]
labelSummaries) (\s :: ListLabelsResponse
s@ListLabelsResponse' {} Maybe [LabelSummary]
a -> ListLabelsResponse
s {$sel:labelSummaries:ListLabelsResponse' :: Maybe [LabelSummary]
labelSummaries = Maybe [LabelSummary]
a} :: ListLabelsResponse) 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

-- | An opaque pagination token indicating where to continue the listing of
-- datasets.
listLabelsResponse_nextToken :: Lens.Lens' ListLabelsResponse (Prelude.Maybe Prelude.Text)
listLabelsResponse_nextToken :: Lens' ListLabelsResponse (Maybe Text)
listLabelsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLabelsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListLabelsResponse' :: ListLabelsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListLabelsResponse
s@ListLabelsResponse' {} Maybe Text
a -> ListLabelsResponse
s {$sel:nextToken:ListLabelsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListLabelsResponse)

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

instance Prelude.NFData ListLabelsResponse where
  rnf :: ListLabelsResponse -> ()
rnf ListLabelsResponse' {Int
Maybe [LabelSummary]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
labelSummaries :: Maybe [LabelSummary]
$sel:httpStatus:ListLabelsResponse' :: ListLabelsResponse -> Int
$sel:nextToken:ListLabelsResponse' :: ListLabelsResponse -> Maybe Text
$sel:labelSummaries:ListLabelsResponse' :: ListLabelsResponse -> Maybe [LabelSummary]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [LabelSummary]
labelSummaries
      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 Int
httpStatus