{-# 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 #-}
module Amazonka.LookoutEquipment.ListLabelGroups
(
ListLabelGroups (..),
newListLabelGroups,
listLabelGroups_labelGroupNameBeginsWith,
listLabelGroups_maxResults,
listLabelGroups_nextToken,
ListLabelGroupsResponse (..),
newListLabelGroupsResponse,
listLabelGroupsResponse_labelGroupSummaries,
listLabelGroupsResponse_nextToken,
listLabelGroupsResponse_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
data ListLabelGroups = ListLabelGroups'
{
ListLabelGroups -> Maybe Text
labelGroupNameBeginsWith :: Prelude.Maybe Prelude.Text,
ListLabelGroups -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListLabelGroups -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text
}
deriving (ListLabelGroups -> ListLabelGroups -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListLabelGroups -> ListLabelGroups -> Bool
$c/= :: ListLabelGroups -> ListLabelGroups -> Bool
== :: ListLabelGroups -> ListLabelGroups -> Bool
$c== :: ListLabelGroups -> ListLabelGroups -> Bool
Prelude.Eq, ReadPrec [ListLabelGroups]
ReadPrec ListLabelGroups
Int -> ReadS ListLabelGroups
ReadS [ListLabelGroups]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListLabelGroups]
$creadListPrec :: ReadPrec [ListLabelGroups]
readPrec :: ReadPrec ListLabelGroups
$creadPrec :: ReadPrec ListLabelGroups
readList :: ReadS [ListLabelGroups]
$creadList :: ReadS [ListLabelGroups]
readsPrec :: Int -> ReadS ListLabelGroups
$creadsPrec :: Int -> ReadS ListLabelGroups
Prelude.Read, Int -> ListLabelGroups -> ShowS
[ListLabelGroups] -> ShowS
ListLabelGroups -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListLabelGroups] -> ShowS
$cshowList :: [ListLabelGroups] -> ShowS
show :: ListLabelGroups -> String
$cshow :: ListLabelGroups -> String
showsPrec :: Int -> ListLabelGroups -> ShowS
$cshowsPrec :: Int -> ListLabelGroups -> ShowS
Prelude.Show, forall x. Rep ListLabelGroups x -> ListLabelGroups
forall x. ListLabelGroups -> Rep ListLabelGroups x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListLabelGroups x -> ListLabelGroups
$cfrom :: forall x. ListLabelGroups -> Rep ListLabelGroups x
Prelude.Generic)
newListLabelGroups ::
ListLabelGroups
newListLabelGroups :: ListLabelGroups
newListLabelGroups =
ListLabelGroups'
{ $sel:labelGroupNameBeginsWith:ListLabelGroups' :: Maybe Text
labelGroupNameBeginsWith =
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListLabelGroups' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListLabelGroups' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing
}
listLabelGroups_labelGroupNameBeginsWith :: Lens.Lens' ListLabelGroups (Prelude.Maybe Prelude.Text)
listLabelGroups_labelGroupNameBeginsWith :: Lens' ListLabelGroups (Maybe Text)
listLabelGroups_labelGroupNameBeginsWith = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLabelGroups' {Maybe Text
labelGroupNameBeginsWith :: Maybe Text
$sel:labelGroupNameBeginsWith:ListLabelGroups' :: ListLabelGroups -> Maybe Text
labelGroupNameBeginsWith} -> Maybe Text
labelGroupNameBeginsWith) (\s :: ListLabelGroups
s@ListLabelGroups' {} Maybe Text
a -> ListLabelGroups
s {$sel:labelGroupNameBeginsWith:ListLabelGroups' :: Maybe Text
labelGroupNameBeginsWith = Maybe Text
a} :: ListLabelGroups)
listLabelGroups_maxResults :: Lens.Lens' ListLabelGroups (Prelude.Maybe Prelude.Natural)
listLabelGroups_maxResults :: Lens' ListLabelGroups (Maybe Natural)
listLabelGroups_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLabelGroups' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListLabelGroups' :: ListLabelGroups -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListLabelGroups
s@ListLabelGroups' {} Maybe Natural
a -> ListLabelGroups
s {$sel:maxResults:ListLabelGroups' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListLabelGroups)
listLabelGroups_nextToken :: Lens.Lens' ListLabelGroups (Prelude.Maybe Prelude.Text)
listLabelGroups_nextToken :: Lens' ListLabelGroups (Maybe Text)
listLabelGroups_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLabelGroups' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListLabelGroups' :: ListLabelGroups -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListLabelGroups
s@ListLabelGroups' {} Maybe Text
a -> ListLabelGroups
s {$sel:nextToken:ListLabelGroups' :: Maybe Text
nextToken = Maybe Text
a} :: ListLabelGroups)
instance Core.AWSRequest ListLabelGroups where
type
AWSResponse ListLabelGroups =
ListLabelGroupsResponse
request :: (Service -> Service) -> ListLabelGroups -> Request ListLabelGroups
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 ListLabelGroups
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListLabelGroups)))
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 [LabelGroupSummary]
-> Maybe Text -> Int -> ListLabelGroupsResponse
ListLabelGroupsResponse'
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
"LabelGroupSummaries"
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 ListLabelGroups where
hashWithSalt :: Int -> ListLabelGroups -> Int
hashWithSalt Int
_salt ListLabelGroups' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
labelGroupNameBeginsWith :: Maybe Text
$sel:nextToken:ListLabelGroups' :: ListLabelGroups -> Maybe Text
$sel:maxResults:ListLabelGroups' :: ListLabelGroups -> Maybe Natural
$sel:labelGroupNameBeginsWith:ListLabelGroups' :: ListLabelGroups -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
labelGroupNameBeginsWith
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
maxResults
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nextToken
instance Prelude.NFData ListLabelGroups where
rnf :: ListLabelGroups -> ()
rnf ListLabelGroups' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
labelGroupNameBeginsWith :: Maybe Text
$sel:nextToken:ListLabelGroups' :: ListLabelGroups -> Maybe Text
$sel:maxResults:ListLabelGroups' :: ListLabelGroups -> Maybe Natural
$sel:labelGroupNameBeginsWith:ListLabelGroups' :: ListLabelGroups -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
labelGroupNameBeginsWith
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
instance Data.ToHeaders ListLabelGroups where
toHeaders :: ListLabelGroups -> 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.ListLabelGroups" ::
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 ListLabelGroups where
toJSON :: ListLabelGroups -> Value
toJSON ListLabelGroups' {Maybe Natural
Maybe Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
labelGroupNameBeginsWith :: Maybe Text
$sel:nextToken:ListLabelGroups' :: ListLabelGroups -> Maybe Text
$sel:maxResults:ListLabelGroups' :: ListLabelGroups -> Maybe Natural
$sel:labelGroupNameBeginsWith:ListLabelGroups' :: ListLabelGroups -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"LabelGroupNameBeginsWith" 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
labelGroupNameBeginsWith,
(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
]
)
instance Data.ToPath ListLabelGroups where
toPath :: ListLabelGroups -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListLabelGroups where
toQuery :: ListLabelGroups -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListLabelGroupsResponse = ListLabelGroupsResponse'
{
ListLabelGroupsResponse -> Maybe [LabelGroupSummary]
labelGroupSummaries :: Prelude.Maybe [LabelGroupSummary],
ListLabelGroupsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListLabelGroupsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListLabelGroupsResponse -> ListLabelGroupsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListLabelGroupsResponse -> ListLabelGroupsResponse -> Bool
$c/= :: ListLabelGroupsResponse -> ListLabelGroupsResponse -> Bool
== :: ListLabelGroupsResponse -> ListLabelGroupsResponse -> Bool
$c== :: ListLabelGroupsResponse -> ListLabelGroupsResponse -> Bool
Prelude.Eq, ReadPrec [ListLabelGroupsResponse]
ReadPrec ListLabelGroupsResponse
Int -> ReadS ListLabelGroupsResponse
ReadS [ListLabelGroupsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListLabelGroupsResponse]
$creadListPrec :: ReadPrec [ListLabelGroupsResponse]
readPrec :: ReadPrec ListLabelGroupsResponse
$creadPrec :: ReadPrec ListLabelGroupsResponse
readList :: ReadS [ListLabelGroupsResponse]
$creadList :: ReadS [ListLabelGroupsResponse]
readsPrec :: Int -> ReadS ListLabelGroupsResponse
$creadsPrec :: Int -> ReadS ListLabelGroupsResponse
Prelude.Read, Int -> ListLabelGroupsResponse -> ShowS
[ListLabelGroupsResponse] -> ShowS
ListLabelGroupsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListLabelGroupsResponse] -> ShowS
$cshowList :: [ListLabelGroupsResponse] -> ShowS
show :: ListLabelGroupsResponse -> String
$cshow :: ListLabelGroupsResponse -> String
showsPrec :: Int -> ListLabelGroupsResponse -> ShowS
$cshowsPrec :: Int -> ListLabelGroupsResponse -> ShowS
Prelude.Show, forall x. Rep ListLabelGroupsResponse x -> ListLabelGroupsResponse
forall x. ListLabelGroupsResponse -> Rep ListLabelGroupsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListLabelGroupsResponse x -> ListLabelGroupsResponse
$cfrom :: forall x. ListLabelGroupsResponse -> Rep ListLabelGroupsResponse x
Prelude.Generic)
newListLabelGroupsResponse ::
Prelude.Int ->
ListLabelGroupsResponse
newListLabelGroupsResponse :: Int -> ListLabelGroupsResponse
newListLabelGroupsResponse Int
pHttpStatus_ =
ListLabelGroupsResponse'
{ $sel:labelGroupSummaries:ListLabelGroupsResponse' :: Maybe [LabelGroupSummary]
labelGroupSummaries =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListLabelGroupsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListLabelGroupsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listLabelGroupsResponse_labelGroupSummaries :: Lens.Lens' ListLabelGroupsResponse (Prelude.Maybe [LabelGroupSummary])
listLabelGroupsResponse_labelGroupSummaries :: Lens' ListLabelGroupsResponse (Maybe [LabelGroupSummary])
listLabelGroupsResponse_labelGroupSummaries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLabelGroupsResponse' {Maybe [LabelGroupSummary]
labelGroupSummaries :: Maybe [LabelGroupSummary]
$sel:labelGroupSummaries:ListLabelGroupsResponse' :: ListLabelGroupsResponse -> Maybe [LabelGroupSummary]
labelGroupSummaries} -> Maybe [LabelGroupSummary]
labelGroupSummaries) (\s :: ListLabelGroupsResponse
s@ListLabelGroupsResponse' {} Maybe [LabelGroupSummary]
a -> ListLabelGroupsResponse
s {$sel:labelGroupSummaries:ListLabelGroupsResponse' :: Maybe [LabelGroupSummary]
labelGroupSummaries = Maybe [LabelGroupSummary]
a} :: ListLabelGroupsResponse) 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
listLabelGroupsResponse_nextToken :: Lens.Lens' ListLabelGroupsResponse (Prelude.Maybe Prelude.Text)
listLabelGroupsResponse_nextToken :: Lens' ListLabelGroupsResponse (Maybe Text)
listLabelGroupsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLabelGroupsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListLabelGroupsResponse' :: ListLabelGroupsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListLabelGroupsResponse
s@ListLabelGroupsResponse' {} Maybe Text
a -> ListLabelGroupsResponse
s {$sel:nextToken:ListLabelGroupsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListLabelGroupsResponse)
listLabelGroupsResponse_httpStatus :: Lens.Lens' ListLabelGroupsResponse Prelude.Int
listLabelGroupsResponse_httpStatus :: Lens' ListLabelGroupsResponse Int
listLabelGroupsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListLabelGroupsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListLabelGroupsResponse' :: ListLabelGroupsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListLabelGroupsResponse
s@ListLabelGroupsResponse' {} Int
a -> ListLabelGroupsResponse
s {$sel:httpStatus:ListLabelGroupsResponse' :: Int
httpStatus = Int
a} :: ListLabelGroupsResponse)
instance Prelude.NFData ListLabelGroupsResponse where
rnf :: ListLabelGroupsResponse -> ()
rnf ListLabelGroupsResponse' {Int
Maybe [LabelGroupSummary]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
labelGroupSummaries :: Maybe [LabelGroupSummary]
$sel:httpStatus:ListLabelGroupsResponse' :: ListLabelGroupsResponse -> Int
$sel:nextToken:ListLabelGroupsResponse' :: ListLabelGroupsResponse -> Maybe Text
$sel:labelGroupSummaries:ListLabelGroupsResponse' :: ListLabelGroupsResponse -> Maybe [LabelGroupSummary]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [LabelGroupSummary]
labelGroupSummaries
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