{-# 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.ServiceCatalog.ListTagOptions
(
ListTagOptions (..),
newListTagOptions,
listTagOptions_filters,
listTagOptions_pageSize,
listTagOptions_pageToken,
ListTagOptionsResponse (..),
newListTagOptionsResponse,
listTagOptionsResponse_pageToken,
listTagOptionsResponse_tagOptionDetails,
listTagOptionsResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
import Amazonka.ServiceCatalog.Types
data ListTagOptions = ListTagOptions'
{
ListTagOptions -> Maybe ListTagOptionsFilters
filters :: Prelude.Maybe ListTagOptionsFilters,
ListTagOptions -> Maybe Natural
pageSize :: Prelude.Maybe Prelude.Natural,
ListTagOptions -> Maybe Text
pageToken :: Prelude.Maybe Prelude.Text
}
deriving (ListTagOptions -> ListTagOptions -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTagOptions -> ListTagOptions -> Bool
$c/= :: ListTagOptions -> ListTagOptions -> Bool
== :: ListTagOptions -> ListTagOptions -> Bool
$c== :: ListTagOptions -> ListTagOptions -> Bool
Prelude.Eq, ReadPrec [ListTagOptions]
ReadPrec ListTagOptions
Int -> ReadS ListTagOptions
ReadS [ListTagOptions]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTagOptions]
$creadListPrec :: ReadPrec [ListTagOptions]
readPrec :: ReadPrec ListTagOptions
$creadPrec :: ReadPrec ListTagOptions
readList :: ReadS [ListTagOptions]
$creadList :: ReadS [ListTagOptions]
readsPrec :: Int -> ReadS ListTagOptions
$creadsPrec :: Int -> ReadS ListTagOptions
Prelude.Read, Int -> ListTagOptions -> ShowS
[ListTagOptions] -> ShowS
ListTagOptions -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTagOptions] -> ShowS
$cshowList :: [ListTagOptions] -> ShowS
show :: ListTagOptions -> String
$cshow :: ListTagOptions -> String
showsPrec :: Int -> ListTagOptions -> ShowS
$cshowsPrec :: Int -> ListTagOptions -> ShowS
Prelude.Show, forall x. Rep ListTagOptions x -> ListTagOptions
forall x. ListTagOptions -> Rep ListTagOptions x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListTagOptions x -> ListTagOptions
$cfrom :: forall x. ListTagOptions -> Rep ListTagOptions x
Prelude.Generic)
newListTagOptions ::
ListTagOptions
newListTagOptions :: ListTagOptions
newListTagOptions =
ListTagOptions'
{ $sel:filters:ListTagOptions' :: Maybe ListTagOptionsFilters
filters = forall a. Maybe a
Prelude.Nothing,
$sel:pageSize:ListTagOptions' :: Maybe Natural
pageSize = forall a. Maybe a
Prelude.Nothing,
$sel:pageToken:ListTagOptions' :: Maybe Text
pageToken = forall a. Maybe a
Prelude.Nothing
}
listTagOptions_filters :: Lens.Lens' ListTagOptions (Prelude.Maybe ListTagOptionsFilters)
listTagOptions_filters :: Lens' ListTagOptions (Maybe ListTagOptionsFilters)
listTagOptions_filters = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTagOptions' {Maybe ListTagOptionsFilters
filters :: Maybe ListTagOptionsFilters
$sel:filters:ListTagOptions' :: ListTagOptions -> Maybe ListTagOptionsFilters
filters} -> Maybe ListTagOptionsFilters
filters) (\s :: ListTagOptions
s@ListTagOptions' {} Maybe ListTagOptionsFilters
a -> ListTagOptions
s {$sel:filters:ListTagOptions' :: Maybe ListTagOptionsFilters
filters = Maybe ListTagOptionsFilters
a} :: ListTagOptions)
listTagOptions_pageSize :: Lens.Lens' ListTagOptions (Prelude.Maybe Prelude.Natural)
listTagOptions_pageSize :: Lens' ListTagOptions (Maybe Natural)
listTagOptions_pageSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTagOptions' {Maybe Natural
pageSize :: Maybe Natural
$sel:pageSize:ListTagOptions' :: ListTagOptions -> Maybe Natural
pageSize} -> Maybe Natural
pageSize) (\s :: ListTagOptions
s@ListTagOptions' {} Maybe Natural
a -> ListTagOptions
s {$sel:pageSize:ListTagOptions' :: Maybe Natural
pageSize = Maybe Natural
a} :: ListTagOptions)
listTagOptions_pageToken :: Lens.Lens' ListTagOptions (Prelude.Maybe Prelude.Text)
listTagOptions_pageToken :: Lens' ListTagOptions (Maybe Text)
listTagOptions_pageToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTagOptions' {Maybe Text
pageToken :: Maybe Text
$sel:pageToken:ListTagOptions' :: ListTagOptions -> Maybe Text
pageToken} -> Maybe Text
pageToken) (\s :: ListTagOptions
s@ListTagOptions' {} Maybe Text
a -> ListTagOptions
s {$sel:pageToken:ListTagOptions' :: Maybe Text
pageToken = Maybe Text
a} :: ListTagOptions)
instance Core.AWSPager ListTagOptions where
page :: ListTagOptions
-> AWSResponse ListTagOptions -> Maybe ListTagOptions
page ListTagOptions
rq AWSResponse ListTagOptions
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListTagOptions
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListTagOptionsResponse (Maybe Text)
listTagOptionsResponse_pageToken
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 ListTagOptions
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListTagOptionsResponse (Maybe [TagOptionDetail])
listTagOptionsResponse_tagOptionDetails
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
| Bool
Prelude.otherwise =
forall a. a -> Maybe a
Prelude.Just
forall a b. (a -> b) -> a -> b
Prelude.$ ListTagOptions
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListTagOptions (Maybe Text)
listTagOptions_pageToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListTagOptions
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListTagOptionsResponse (Maybe Text)
listTagOptionsResponse_pageToken
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 ListTagOptions where
type
AWSResponse ListTagOptions =
ListTagOptionsResponse
request :: (Service -> Service) -> ListTagOptions -> Request ListTagOptions
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 ListTagOptions
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListTagOptions)))
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
-> Maybe [TagOptionDetail] -> Int -> ListTagOptionsResponse
ListTagOptionsResponse'
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
"PageToken")
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
"TagOptionDetails"
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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable ListTagOptions where
hashWithSalt :: Int -> ListTagOptions -> Int
hashWithSalt Int
_salt ListTagOptions' {Maybe Natural
Maybe Text
Maybe ListTagOptionsFilters
pageToken :: Maybe Text
pageSize :: Maybe Natural
filters :: Maybe ListTagOptionsFilters
$sel:pageToken:ListTagOptions' :: ListTagOptions -> Maybe Text
$sel:pageSize:ListTagOptions' :: ListTagOptions -> Maybe Natural
$sel:filters:ListTagOptions' :: ListTagOptions -> Maybe ListTagOptionsFilters
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ListTagOptionsFilters
filters
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
pageSize
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
pageToken
instance Prelude.NFData ListTagOptions where
rnf :: ListTagOptions -> ()
rnf ListTagOptions' {Maybe Natural
Maybe Text
Maybe ListTagOptionsFilters
pageToken :: Maybe Text
pageSize :: Maybe Natural
filters :: Maybe ListTagOptionsFilters
$sel:pageToken:ListTagOptions' :: ListTagOptions -> Maybe Text
$sel:pageSize:ListTagOptions' :: ListTagOptions -> Maybe Natural
$sel:filters:ListTagOptions' :: ListTagOptions -> Maybe ListTagOptionsFilters
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ListTagOptionsFilters
filters
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
pageSize
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
pageToken
instance Data.ToHeaders ListTagOptions where
toHeaders :: ListTagOptions -> 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
"AWS242ServiceCatalogService.ListTagOptions" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON ListTagOptions where
toJSON :: ListTagOptions -> Value
toJSON ListTagOptions' {Maybe Natural
Maybe Text
Maybe ListTagOptionsFilters
pageToken :: Maybe Text
pageSize :: Maybe Natural
filters :: Maybe ListTagOptionsFilters
$sel:pageToken:ListTagOptions' :: ListTagOptions -> Maybe Text
$sel:pageSize:ListTagOptions' :: ListTagOptions -> Maybe Natural
$sel:filters:ListTagOptions' :: ListTagOptions -> Maybe ListTagOptionsFilters
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Filters" 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 ListTagOptionsFilters
filters,
(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 Natural
pageSize,
(Key
"PageToken" 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
pageToken
]
)
instance Data.ToPath ListTagOptions where
toPath :: ListTagOptions -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListTagOptions where
toQuery :: ListTagOptions -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListTagOptionsResponse = ListTagOptionsResponse'
{
ListTagOptionsResponse -> Maybe Text
pageToken :: Prelude.Maybe Prelude.Text,
ListTagOptionsResponse -> Maybe [TagOptionDetail]
tagOptionDetails :: Prelude.Maybe [TagOptionDetail],
ListTagOptionsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListTagOptionsResponse -> ListTagOptionsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListTagOptionsResponse -> ListTagOptionsResponse -> Bool
$c/= :: ListTagOptionsResponse -> ListTagOptionsResponse -> Bool
== :: ListTagOptionsResponse -> ListTagOptionsResponse -> Bool
$c== :: ListTagOptionsResponse -> ListTagOptionsResponse -> Bool
Prelude.Eq, ReadPrec [ListTagOptionsResponse]
ReadPrec ListTagOptionsResponse
Int -> ReadS ListTagOptionsResponse
ReadS [ListTagOptionsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListTagOptionsResponse]
$creadListPrec :: ReadPrec [ListTagOptionsResponse]
readPrec :: ReadPrec ListTagOptionsResponse
$creadPrec :: ReadPrec ListTagOptionsResponse
readList :: ReadS [ListTagOptionsResponse]
$creadList :: ReadS [ListTagOptionsResponse]
readsPrec :: Int -> ReadS ListTagOptionsResponse
$creadsPrec :: Int -> ReadS ListTagOptionsResponse
Prelude.Read, Int -> ListTagOptionsResponse -> ShowS
[ListTagOptionsResponse] -> ShowS
ListTagOptionsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListTagOptionsResponse] -> ShowS
$cshowList :: [ListTagOptionsResponse] -> ShowS
show :: ListTagOptionsResponse -> String
$cshow :: ListTagOptionsResponse -> String
showsPrec :: Int -> ListTagOptionsResponse -> ShowS
$cshowsPrec :: Int -> ListTagOptionsResponse -> ShowS
Prelude.Show, forall x. Rep ListTagOptionsResponse x -> ListTagOptionsResponse
forall x. ListTagOptionsResponse -> Rep ListTagOptionsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListTagOptionsResponse x -> ListTagOptionsResponse
$cfrom :: forall x. ListTagOptionsResponse -> Rep ListTagOptionsResponse x
Prelude.Generic)
newListTagOptionsResponse ::
Prelude.Int ->
ListTagOptionsResponse
newListTagOptionsResponse :: Int -> ListTagOptionsResponse
newListTagOptionsResponse Int
pHttpStatus_ =
ListTagOptionsResponse'
{ $sel:pageToken:ListTagOptionsResponse' :: Maybe Text
pageToken =
forall a. Maybe a
Prelude.Nothing,
$sel:tagOptionDetails:ListTagOptionsResponse' :: Maybe [TagOptionDetail]
tagOptionDetails = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListTagOptionsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listTagOptionsResponse_pageToken :: Lens.Lens' ListTagOptionsResponse (Prelude.Maybe Prelude.Text)
listTagOptionsResponse_pageToken :: Lens' ListTagOptionsResponse (Maybe Text)
listTagOptionsResponse_pageToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTagOptionsResponse' {Maybe Text
pageToken :: Maybe Text
$sel:pageToken:ListTagOptionsResponse' :: ListTagOptionsResponse -> Maybe Text
pageToken} -> Maybe Text
pageToken) (\s :: ListTagOptionsResponse
s@ListTagOptionsResponse' {} Maybe Text
a -> ListTagOptionsResponse
s {$sel:pageToken:ListTagOptionsResponse' :: Maybe Text
pageToken = Maybe Text
a} :: ListTagOptionsResponse)
listTagOptionsResponse_tagOptionDetails :: Lens.Lens' ListTagOptionsResponse (Prelude.Maybe [TagOptionDetail])
listTagOptionsResponse_tagOptionDetails :: Lens' ListTagOptionsResponse (Maybe [TagOptionDetail])
listTagOptionsResponse_tagOptionDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTagOptionsResponse' {Maybe [TagOptionDetail]
tagOptionDetails :: Maybe [TagOptionDetail]
$sel:tagOptionDetails:ListTagOptionsResponse' :: ListTagOptionsResponse -> Maybe [TagOptionDetail]
tagOptionDetails} -> Maybe [TagOptionDetail]
tagOptionDetails) (\s :: ListTagOptionsResponse
s@ListTagOptionsResponse' {} Maybe [TagOptionDetail]
a -> ListTagOptionsResponse
s {$sel:tagOptionDetails:ListTagOptionsResponse' :: Maybe [TagOptionDetail]
tagOptionDetails = Maybe [TagOptionDetail]
a} :: ListTagOptionsResponse) 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
listTagOptionsResponse_httpStatus :: Lens.Lens' ListTagOptionsResponse Prelude.Int
listTagOptionsResponse_httpStatus :: Lens' ListTagOptionsResponse Int
listTagOptionsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListTagOptionsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListTagOptionsResponse' :: ListTagOptionsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListTagOptionsResponse
s@ListTagOptionsResponse' {} Int
a -> ListTagOptionsResponse
s {$sel:httpStatus:ListTagOptionsResponse' :: Int
httpStatus = Int
a} :: ListTagOptionsResponse)
instance Prelude.NFData ListTagOptionsResponse where
rnf :: ListTagOptionsResponse -> ()
rnf ListTagOptionsResponse' {Int
Maybe [TagOptionDetail]
Maybe Text
httpStatus :: Int
tagOptionDetails :: Maybe [TagOptionDetail]
pageToken :: Maybe Text
$sel:httpStatus:ListTagOptionsResponse' :: ListTagOptionsResponse -> Int
$sel:tagOptionDetails:ListTagOptionsResponse' :: ListTagOptionsResponse -> Maybe [TagOptionDetail]
$sel:pageToken:ListTagOptionsResponse' :: ListTagOptionsResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
pageToken
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [TagOptionDetail]
tagOptionDetails
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus