{-# 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.SearchProductsAsAdmin
(
SearchProductsAsAdmin (..),
newSearchProductsAsAdmin,
searchProductsAsAdmin_portfolioId,
searchProductsAsAdmin_filters,
searchProductsAsAdmin_sortOrder,
searchProductsAsAdmin_acceptLanguage,
searchProductsAsAdmin_pageToken,
searchProductsAsAdmin_pageSize,
searchProductsAsAdmin_productSource,
searchProductsAsAdmin_sortBy,
SearchProductsAsAdminResponse (..),
newSearchProductsAsAdminResponse,
searchProductsAsAdminResponse_nextPageToken,
searchProductsAsAdminResponse_productViewDetails,
searchProductsAsAdminResponse_httpStatus,
)
where
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
import Amazonka.ServiceCatalog.Types
data SearchProductsAsAdmin = SearchProductsAsAdmin'
{
SearchProductsAsAdmin -> Maybe Text
portfolioId :: Prelude.Maybe Prelude.Text,
SearchProductsAsAdmin -> Maybe (HashMap ProductViewFilterBy [Text])
filters :: Prelude.Maybe (Prelude.HashMap ProductViewFilterBy [Prelude.Text]),
SearchProductsAsAdmin -> Maybe SortOrder
sortOrder :: Prelude.Maybe SortOrder,
SearchProductsAsAdmin -> Maybe Text
acceptLanguage :: Prelude.Maybe Prelude.Text,
SearchProductsAsAdmin -> Maybe Text
pageToken :: Prelude.Maybe Prelude.Text,
SearchProductsAsAdmin -> Maybe Natural
pageSize :: Prelude.Maybe Prelude.Natural,
SearchProductsAsAdmin -> Maybe ProductSource
productSource :: Prelude.Maybe ProductSource,
SearchProductsAsAdmin -> Maybe ProductViewSortBy
sortBy :: Prelude.Maybe ProductViewSortBy
}
deriving (SearchProductsAsAdmin -> SearchProductsAsAdmin -> Bool
(SearchProductsAsAdmin -> SearchProductsAsAdmin -> Bool)
-> (SearchProductsAsAdmin -> SearchProductsAsAdmin -> Bool)
-> Eq SearchProductsAsAdmin
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchProductsAsAdmin -> SearchProductsAsAdmin -> Bool
$c/= :: SearchProductsAsAdmin -> SearchProductsAsAdmin -> Bool
== :: SearchProductsAsAdmin -> SearchProductsAsAdmin -> Bool
$c== :: SearchProductsAsAdmin -> SearchProductsAsAdmin -> Bool
Prelude.Eq, ReadPrec [SearchProductsAsAdmin]
ReadPrec SearchProductsAsAdmin
Int -> ReadS SearchProductsAsAdmin
ReadS [SearchProductsAsAdmin]
(Int -> ReadS SearchProductsAsAdmin)
-> ReadS [SearchProductsAsAdmin]
-> ReadPrec SearchProductsAsAdmin
-> ReadPrec [SearchProductsAsAdmin]
-> Read SearchProductsAsAdmin
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SearchProductsAsAdmin]
$creadListPrec :: ReadPrec [SearchProductsAsAdmin]
readPrec :: ReadPrec SearchProductsAsAdmin
$creadPrec :: ReadPrec SearchProductsAsAdmin
readList :: ReadS [SearchProductsAsAdmin]
$creadList :: ReadS [SearchProductsAsAdmin]
readsPrec :: Int -> ReadS SearchProductsAsAdmin
$creadsPrec :: Int -> ReadS SearchProductsAsAdmin
Prelude.Read, Int -> SearchProductsAsAdmin -> ShowS
[SearchProductsAsAdmin] -> ShowS
SearchProductsAsAdmin -> String
(Int -> SearchProductsAsAdmin -> ShowS)
-> (SearchProductsAsAdmin -> String)
-> ([SearchProductsAsAdmin] -> ShowS)
-> Show SearchProductsAsAdmin
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchProductsAsAdmin] -> ShowS
$cshowList :: [SearchProductsAsAdmin] -> ShowS
show :: SearchProductsAsAdmin -> String
$cshow :: SearchProductsAsAdmin -> String
showsPrec :: Int -> SearchProductsAsAdmin -> ShowS
$cshowsPrec :: Int -> SearchProductsAsAdmin -> ShowS
Prelude.Show, (forall x. SearchProductsAsAdmin -> Rep SearchProductsAsAdmin x)
-> (forall x. Rep SearchProductsAsAdmin x -> SearchProductsAsAdmin)
-> Generic SearchProductsAsAdmin
forall x. Rep SearchProductsAsAdmin x -> SearchProductsAsAdmin
forall x. SearchProductsAsAdmin -> Rep SearchProductsAsAdmin x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SearchProductsAsAdmin x -> SearchProductsAsAdmin
$cfrom :: forall x. SearchProductsAsAdmin -> Rep SearchProductsAsAdmin x
Prelude.Generic)
newSearchProductsAsAdmin ::
SearchProductsAsAdmin
newSearchProductsAsAdmin :: SearchProductsAsAdmin
newSearchProductsAsAdmin =
SearchProductsAsAdmin' :: Maybe Text
-> Maybe (HashMap ProductViewFilterBy [Text])
-> Maybe SortOrder
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> Maybe ProductSource
-> Maybe ProductViewSortBy
-> SearchProductsAsAdmin
SearchProductsAsAdmin'
{ $sel:portfolioId:SearchProductsAsAdmin' :: Maybe Text
portfolioId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:filters:SearchProductsAsAdmin' :: Maybe (HashMap ProductViewFilterBy [Text])
filters = Maybe (HashMap ProductViewFilterBy [Text])
forall a. Maybe a
Prelude.Nothing,
$sel:sortOrder:SearchProductsAsAdmin' :: Maybe SortOrder
sortOrder = Maybe SortOrder
forall a. Maybe a
Prelude.Nothing,
$sel:acceptLanguage:SearchProductsAsAdmin' :: Maybe Text
acceptLanguage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:pageToken:SearchProductsAsAdmin' :: Maybe Text
pageToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:pageSize:SearchProductsAsAdmin' :: Maybe Natural
pageSize = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:productSource:SearchProductsAsAdmin' :: Maybe ProductSource
productSource = Maybe ProductSource
forall a. Maybe a
Prelude.Nothing,
$sel:sortBy:SearchProductsAsAdmin' :: Maybe ProductViewSortBy
sortBy = Maybe ProductViewSortBy
forall a. Maybe a
Prelude.Nothing
}
searchProductsAsAdmin_portfolioId :: Lens.Lens' SearchProductsAsAdmin (Prelude.Maybe Prelude.Text)
searchProductsAsAdmin_portfolioId :: (Maybe Text -> f (Maybe Text))
-> SearchProductsAsAdmin -> f SearchProductsAsAdmin
searchProductsAsAdmin_portfolioId = (SearchProductsAsAdmin -> Maybe Text)
-> (SearchProductsAsAdmin -> Maybe Text -> SearchProductsAsAdmin)
-> Lens
SearchProductsAsAdmin
SearchProductsAsAdmin
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchProductsAsAdmin' {Maybe Text
portfolioId :: Maybe Text
$sel:portfolioId:SearchProductsAsAdmin' :: SearchProductsAsAdmin -> Maybe Text
portfolioId} -> Maybe Text
portfolioId) (\s :: SearchProductsAsAdmin
s@SearchProductsAsAdmin' {} Maybe Text
a -> SearchProductsAsAdmin
s {$sel:portfolioId:SearchProductsAsAdmin' :: Maybe Text
portfolioId = Maybe Text
a} :: SearchProductsAsAdmin)
searchProductsAsAdmin_filters :: Lens.Lens' SearchProductsAsAdmin (Prelude.Maybe (Prelude.HashMap ProductViewFilterBy [Prelude.Text]))
searchProductsAsAdmin_filters :: (Maybe (HashMap ProductViewFilterBy [Text])
-> f (Maybe (HashMap ProductViewFilterBy [Text])))
-> SearchProductsAsAdmin -> f SearchProductsAsAdmin
searchProductsAsAdmin_filters = (SearchProductsAsAdmin
-> Maybe (HashMap ProductViewFilterBy [Text]))
-> (SearchProductsAsAdmin
-> Maybe (HashMap ProductViewFilterBy [Text])
-> SearchProductsAsAdmin)
-> Lens
SearchProductsAsAdmin
SearchProductsAsAdmin
(Maybe (HashMap ProductViewFilterBy [Text]))
(Maybe (HashMap ProductViewFilterBy [Text]))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchProductsAsAdmin' {Maybe (HashMap ProductViewFilterBy [Text])
filters :: Maybe (HashMap ProductViewFilterBy [Text])
$sel:filters:SearchProductsAsAdmin' :: SearchProductsAsAdmin -> Maybe (HashMap ProductViewFilterBy [Text])
filters} -> Maybe (HashMap ProductViewFilterBy [Text])
filters) (\s :: SearchProductsAsAdmin
s@SearchProductsAsAdmin' {} Maybe (HashMap ProductViewFilterBy [Text])
a -> SearchProductsAsAdmin
s {$sel:filters:SearchProductsAsAdmin' :: Maybe (HashMap ProductViewFilterBy [Text])
filters = Maybe (HashMap ProductViewFilterBy [Text])
a} :: SearchProductsAsAdmin) ((Maybe (HashMap ProductViewFilterBy [Text])
-> f (Maybe (HashMap ProductViewFilterBy [Text])))
-> SearchProductsAsAdmin -> f SearchProductsAsAdmin)
-> ((Maybe (HashMap ProductViewFilterBy [Text])
-> f (Maybe (HashMap ProductViewFilterBy [Text])))
-> Maybe (HashMap ProductViewFilterBy [Text])
-> f (Maybe (HashMap ProductViewFilterBy [Text])))
-> (Maybe (HashMap ProductViewFilterBy [Text])
-> f (Maybe (HashMap ProductViewFilterBy [Text])))
-> SearchProductsAsAdmin
-> f SearchProductsAsAdmin
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap ProductViewFilterBy [Text])
(HashMap ProductViewFilterBy [Text])
(HashMap ProductViewFilterBy [Text])
(HashMap ProductViewFilterBy [Text])
-> Iso
(Maybe (HashMap ProductViewFilterBy [Text]))
(Maybe (HashMap ProductViewFilterBy [Text]))
(Maybe (HashMap ProductViewFilterBy [Text]))
(Maybe (HashMap ProductViewFilterBy [Text]))
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
(HashMap ProductViewFilterBy [Text])
(HashMap ProductViewFilterBy [Text])
(HashMap ProductViewFilterBy [Text])
(HashMap ProductViewFilterBy [Text])
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
searchProductsAsAdmin_sortOrder :: Lens.Lens' SearchProductsAsAdmin (Prelude.Maybe SortOrder)
searchProductsAsAdmin_sortOrder :: (Maybe SortOrder -> f (Maybe SortOrder))
-> SearchProductsAsAdmin -> f SearchProductsAsAdmin
searchProductsAsAdmin_sortOrder = (SearchProductsAsAdmin -> Maybe SortOrder)
-> (SearchProductsAsAdmin
-> Maybe SortOrder -> SearchProductsAsAdmin)
-> Lens
SearchProductsAsAdmin
SearchProductsAsAdmin
(Maybe SortOrder)
(Maybe SortOrder)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchProductsAsAdmin' {Maybe SortOrder
sortOrder :: Maybe SortOrder
$sel:sortOrder:SearchProductsAsAdmin' :: SearchProductsAsAdmin -> Maybe SortOrder
sortOrder} -> Maybe SortOrder
sortOrder) (\s :: SearchProductsAsAdmin
s@SearchProductsAsAdmin' {} Maybe SortOrder
a -> SearchProductsAsAdmin
s {$sel:sortOrder:SearchProductsAsAdmin' :: Maybe SortOrder
sortOrder = Maybe SortOrder
a} :: SearchProductsAsAdmin)
searchProductsAsAdmin_acceptLanguage :: Lens.Lens' SearchProductsAsAdmin (Prelude.Maybe Prelude.Text)
searchProductsAsAdmin_acceptLanguage :: (Maybe Text -> f (Maybe Text))
-> SearchProductsAsAdmin -> f SearchProductsAsAdmin
searchProductsAsAdmin_acceptLanguage = (SearchProductsAsAdmin -> Maybe Text)
-> (SearchProductsAsAdmin -> Maybe Text -> SearchProductsAsAdmin)
-> Lens
SearchProductsAsAdmin
SearchProductsAsAdmin
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchProductsAsAdmin' {Maybe Text
acceptLanguage :: Maybe Text
$sel:acceptLanguage:SearchProductsAsAdmin' :: SearchProductsAsAdmin -> Maybe Text
acceptLanguage} -> Maybe Text
acceptLanguage) (\s :: SearchProductsAsAdmin
s@SearchProductsAsAdmin' {} Maybe Text
a -> SearchProductsAsAdmin
s {$sel:acceptLanguage:SearchProductsAsAdmin' :: Maybe Text
acceptLanguage = Maybe Text
a} :: SearchProductsAsAdmin)
searchProductsAsAdmin_pageToken :: Lens.Lens' SearchProductsAsAdmin (Prelude.Maybe Prelude.Text)
searchProductsAsAdmin_pageToken :: (Maybe Text -> f (Maybe Text))
-> SearchProductsAsAdmin -> f SearchProductsAsAdmin
searchProductsAsAdmin_pageToken = (SearchProductsAsAdmin -> Maybe Text)
-> (SearchProductsAsAdmin -> Maybe Text -> SearchProductsAsAdmin)
-> Lens
SearchProductsAsAdmin
SearchProductsAsAdmin
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchProductsAsAdmin' {Maybe Text
pageToken :: Maybe Text
$sel:pageToken:SearchProductsAsAdmin' :: SearchProductsAsAdmin -> Maybe Text
pageToken} -> Maybe Text
pageToken) (\s :: SearchProductsAsAdmin
s@SearchProductsAsAdmin' {} Maybe Text
a -> SearchProductsAsAdmin
s {$sel:pageToken:SearchProductsAsAdmin' :: Maybe Text
pageToken = Maybe Text
a} :: SearchProductsAsAdmin)
searchProductsAsAdmin_pageSize :: Lens.Lens' SearchProductsAsAdmin (Prelude.Maybe Prelude.Natural)
searchProductsAsAdmin_pageSize :: (Maybe Natural -> f (Maybe Natural))
-> SearchProductsAsAdmin -> f SearchProductsAsAdmin
searchProductsAsAdmin_pageSize = (SearchProductsAsAdmin -> Maybe Natural)
-> (SearchProductsAsAdmin
-> Maybe Natural -> SearchProductsAsAdmin)
-> Lens
SearchProductsAsAdmin
SearchProductsAsAdmin
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchProductsAsAdmin' {Maybe Natural
pageSize :: Maybe Natural
$sel:pageSize:SearchProductsAsAdmin' :: SearchProductsAsAdmin -> Maybe Natural
pageSize} -> Maybe Natural
pageSize) (\s :: SearchProductsAsAdmin
s@SearchProductsAsAdmin' {} Maybe Natural
a -> SearchProductsAsAdmin
s {$sel:pageSize:SearchProductsAsAdmin' :: Maybe Natural
pageSize = Maybe Natural
a} :: SearchProductsAsAdmin)
searchProductsAsAdmin_productSource :: Lens.Lens' SearchProductsAsAdmin (Prelude.Maybe ProductSource)
searchProductsAsAdmin_productSource :: (Maybe ProductSource -> f (Maybe ProductSource))
-> SearchProductsAsAdmin -> f SearchProductsAsAdmin
searchProductsAsAdmin_productSource = (SearchProductsAsAdmin -> Maybe ProductSource)
-> (SearchProductsAsAdmin
-> Maybe ProductSource -> SearchProductsAsAdmin)
-> Lens
SearchProductsAsAdmin
SearchProductsAsAdmin
(Maybe ProductSource)
(Maybe ProductSource)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchProductsAsAdmin' {Maybe ProductSource
productSource :: Maybe ProductSource
$sel:productSource:SearchProductsAsAdmin' :: SearchProductsAsAdmin -> Maybe ProductSource
productSource} -> Maybe ProductSource
productSource) (\s :: SearchProductsAsAdmin
s@SearchProductsAsAdmin' {} Maybe ProductSource
a -> SearchProductsAsAdmin
s {$sel:productSource:SearchProductsAsAdmin' :: Maybe ProductSource
productSource = Maybe ProductSource
a} :: SearchProductsAsAdmin)
searchProductsAsAdmin_sortBy :: Lens.Lens' SearchProductsAsAdmin (Prelude.Maybe ProductViewSortBy)
searchProductsAsAdmin_sortBy :: (Maybe ProductViewSortBy -> f (Maybe ProductViewSortBy))
-> SearchProductsAsAdmin -> f SearchProductsAsAdmin
searchProductsAsAdmin_sortBy = (SearchProductsAsAdmin -> Maybe ProductViewSortBy)
-> (SearchProductsAsAdmin
-> Maybe ProductViewSortBy -> SearchProductsAsAdmin)
-> Lens
SearchProductsAsAdmin
SearchProductsAsAdmin
(Maybe ProductViewSortBy)
(Maybe ProductViewSortBy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchProductsAsAdmin' {Maybe ProductViewSortBy
sortBy :: Maybe ProductViewSortBy
$sel:sortBy:SearchProductsAsAdmin' :: SearchProductsAsAdmin -> Maybe ProductViewSortBy
sortBy} -> Maybe ProductViewSortBy
sortBy) (\s :: SearchProductsAsAdmin
s@SearchProductsAsAdmin' {} Maybe ProductViewSortBy
a -> SearchProductsAsAdmin
s {$sel:sortBy:SearchProductsAsAdmin' :: Maybe ProductViewSortBy
sortBy = Maybe ProductViewSortBy
a} :: SearchProductsAsAdmin)
instance Core.AWSPager SearchProductsAsAdmin where
page :: SearchProductsAsAdmin
-> AWSResponse SearchProductsAsAdmin -> Maybe SearchProductsAsAdmin
page SearchProductsAsAdmin
rq AWSResponse SearchProductsAsAdmin
rs
| Maybe Text -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse SearchProductsAsAdmin
SearchProductsAsAdminResponse
rs
SearchProductsAsAdminResponse
-> Getting (First Text) SearchProductsAsAdminResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> SearchProductsAsAdminResponse
-> Const (First Text) SearchProductsAsAdminResponse
Lens' SearchProductsAsAdminResponse (Maybe Text)
searchProductsAsAdminResponse_nextPageToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> SearchProductsAsAdminResponse
-> Const (First Text) SearchProductsAsAdminResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) SearchProductsAsAdminResponse 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 SearchProductsAsAdmin
forall a. Maybe a
Prelude.Nothing
| Maybe [ProductViewDetail] -> Bool
forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse SearchProductsAsAdmin
SearchProductsAsAdminResponse
rs
SearchProductsAsAdminResponse
-> Getting
(First [ProductViewDetail])
SearchProductsAsAdminResponse
[ProductViewDetail]
-> Maybe [ProductViewDetail]
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe [ProductViewDetail]
-> Const (First [ProductViewDetail]) (Maybe [ProductViewDetail]))
-> SearchProductsAsAdminResponse
-> Const (First [ProductViewDetail]) SearchProductsAsAdminResponse
Lens' SearchProductsAsAdminResponse (Maybe [ProductViewDetail])
searchProductsAsAdminResponse_productViewDetails
((Maybe [ProductViewDetail]
-> Const (First [ProductViewDetail]) (Maybe [ProductViewDetail]))
-> SearchProductsAsAdminResponse
-> Const (First [ProductViewDetail]) SearchProductsAsAdminResponse)
-> (([ProductViewDetail]
-> Const (First [ProductViewDetail]) [ProductViewDetail])
-> Maybe [ProductViewDetail]
-> Const (First [ProductViewDetail]) (Maybe [ProductViewDetail]))
-> Getting
(First [ProductViewDetail])
SearchProductsAsAdminResponse
[ProductViewDetail]
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ProductViewDetail]
-> Const (First [ProductViewDetail]) [ProductViewDetail])
-> Maybe [ProductViewDetail]
-> Const (First [ProductViewDetail]) (Maybe [ProductViewDetail])
forall a b. Prism (Maybe a) (Maybe b) a b
Lens._Just
) =
Maybe SearchProductsAsAdmin
forall a. Maybe a
Prelude.Nothing
| Bool
Prelude.otherwise =
SearchProductsAsAdmin -> Maybe SearchProductsAsAdmin
forall a. a -> Maybe a
Prelude.Just (SearchProductsAsAdmin -> Maybe SearchProductsAsAdmin)
-> SearchProductsAsAdmin -> Maybe SearchProductsAsAdmin
forall a b. (a -> b) -> a -> b
Prelude.$
SearchProductsAsAdmin
rq
SearchProductsAsAdmin
-> (SearchProductsAsAdmin -> SearchProductsAsAdmin)
-> SearchProductsAsAdmin
forall a b. a -> (a -> b) -> b
Prelude.& (Maybe Text -> Identity (Maybe Text))
-> SearchProductsAsAdmin -> Identity SearchProductsAsAdmin
Lens
SearchProductsAsAdmin
SearchProductsAsAdmin
(Maybe Text)
(Maybe Text)
searchProductsAsAdmin_pageToken
((Maybe Text -> Identity (Maybe Text))
-> SearchProductsAsAdmin -> Identity SearchProductsAsAdmin)
-> Maybe Text -> SearchProductsAsAdmin -> SearchProductsAsAdmin
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse SearchProductsAsAdmin
SearchProductsAsAdminResponse
rs
SearchProductsAsAdminResponse
-> Getting (First Text) SearchProductsAsAdminResponse Text
-> Maybe Text
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? (Maybe Text -> Const (First Text) (Maybe Text))
-> SearchProductsAsAdminResponse
-> Const (First Text) SearchProductsAsAdminResponse
Lens' SearchProductsAsAdminResponse (Maybe Text)
searchProductsAsAdminResponse_nextPageToken
((Maybe Text -> Const (First Text) (Maybe Text))
-> SearchProductsAsAdminResponse
-> Const (First Text) SearchProductsAsAdminResponse)
-> ((Text -> Const (First Text) Text)
-> Maybe Text -> Const (First Text) (Maybe Text))
-> Getting (First Text) SearchProductsAsAdminResponse 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 SearchProductsAsAdmin where
type
AWSResponse SearchProductsAsAdmin =
SearchProductsAsAdminResponse
request :: SearchProductsAsAdmin -> Request SearchProductsAsAdmin
request = Service -> SearchProductsAsAdmin -> Request SearchProductsAsAdmin
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy SearchProductsAsAdmin
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SearchProductsAsAdmin)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse SearchProductsAsAdmin))
-> Logger
-> Service
-> Proxy SearchProductsAsAdmin
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse SearchProductsAsAdmin)))
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 [ProductViewDetail]
-> Int
-> SearchProductsAsAdminResponse
SearchProductsAsAdminResponse'
(Maybe Text
-> Maybe [ProductViewDetail]
-> Int
-> SearchProductsAsAdminResponse)
-> Either String (Maybe Text)
-> Either
String
(Maybe [ProductViewDetail] -> Int -> SearchProductsAsAdminResponse)
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
"NextPageToken")
Either
String
(Maybe [ProductViewDetail] -> Int -> SearchProductsAsAdminResponse)
-> Either String (Maybe [ProductViewDetail])
-> Either String (Int -> SearchProductsAsAdminResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Either String (Maybe (Maybe [ProductViewDetail]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ProductViewDetails"
Either String (Maybe (Maybe [ProductViewDetail]))
-> Maybe [ProductViewDetail]
-> Either String (Maybe [ProductViewDetail])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ProductViewDetail]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Int -> SearchProductsAsAdminResponse)
-> Either String Int -> Either String SearchProductsAsAdminResponse
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 SearchProductsAsAdmin
instance Prelude.NFData SearchProductsAsAdmin
instance Core.ToHeaders SearchProductsAsAdmin where
toHeaders :: SearchProductsAsAdmin -> ResponseHeaders
toHeaders =
ResponseHeaders -> SearchProductsAsAdmin -> 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
"AWS242ServiceCatalogService.SearchProductsAsAdmin" ::
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 SearchProductsAsAdmin where
toJSON :: SearchProductsAsAdmin -> Value
toJSON SearchProductsAsAdmin' {Maybe Natural
Maybe Text
Maybe (HashMap ProductViewFilterBy [Text])
Maybe ProductSource
Maybe ProductViewSortBy
Maybe SortOrder
sortBy :: Maybe ProductViewSortBy
productSource :: Maybe ProductSource
pageSize :: Maybe Natural
pageToken :: Maybe Text
acceptLanguage :: Maybe Text
sortOrder :: Maybe SortOrder
filters :: Maybe (HashMap ProductViewFilterBy [Text])
portfolioId :: Maybe Text
$sel:sortBy:SearchProductsAsAdmin' :: SearchProductsAsAdmin -> Maybe ProductViewSortBy
$sel:productSource:SearchProductsAsAdmin' :: SearchProductsAsAdmin -> Maybe ProductSource
$sel:pageSize:SearchProductsAsAdmin' :: SearchProductsAsAdmin -> Maybe Natural
$sel:pageToken:SearchProductsAsAdmin' :: SearchProductsAsAdmin -> Maybe Text
$sel:acceptLanguage:SearchProductsAsAdmin' :: SearchProductsAsAdmin -> Maybe Text
$sel:sortOrder:SearchProductsAsAdmin' :: SearchProductsAsAdmin -> Maybe SortOrder
$sel:filters:SearchProductsAsAdmin' :: SearchProductsAsAdmin -> Maybe (HashMap ProductViewFilterBy [Text])
$sel:portfolioId:SearchProductsAsAdmin' :: SearchProductsAsAdmin -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"PortfolioId" 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
portfolioId,
(Text
"Filters" Text -> HashMap ProductViewFilterBy [Text] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap ProductViewFilterBy [Text] -> Pair)
-> Maybe (HashMap ProductViewFilterBy [Text]) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap ProductViewFilterBy [Text])
filters,
(Text
"SortOrder" Text -> SortOrder -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SortOrder -> Pair) -> Maybe SortOrder -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SortOrder
sortOrder,
(Text
"AcceptLanguage" 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
acceptLanguage,
(Text
"PageToken" 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
pageToken,
(Text
"PageSize" 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
pageSize,
(Text
"ProductSource" Text -> ProductSource -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ProductSource -> Pair) -> Maybe ProductSource -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ProductSource
productSource,
(Text
"SortBy" Text -> ProductViewSortBy -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ProductViewSortBy -> Pair)
-> Maybe ProductViewSortBy -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ProductViewSortBy
sortBy
]
)
instance Core.ToPath SearchProductsAsAdmin where
toPath :: SearchProductsAsAdmin -> ByteString
toPath = ByteString -> SearchProductsAsAdmin -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Core.ToQuery SearchProductsAsAdmin where
toQuery :: SearchProductsAsAdmin -> QueryString
toQuery = QueryString -> SearchProductsAsAdmin -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data SearchProductsAsAdminResponse = SearchProductsAsAdminResponse'
{
SearchProductsAsAdminResponse -> Maybe Text
nextPageToken :: Prelude.Maybe Prelude.Text,
SearchProductsAsAdminResponse -> Maybe [ProductViewDetail]
productViewDetails :: Prelude.Maybe [ProductViewDetail],
SearchProductsAsAdminResponse -> Int
httpStatus :: Prelude.Int
}
deriving (SearchProductsAsAdminResponse
-> SearchProductsAsAdminResponse -> Bool
(SearchProductsAsAdminResponse
-> SearchProductsAsAdminResponse -> Bool)
-> (SearchProductsAsAdminResponse
-> SearchProductsAsAdminResponse -> Bool)
-> Eq SearchProductsAsAdminResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SearchProductsAsAdminResponse
-> SearchProductsAsAdminResponse -> Bool
$c/= :: SearchProductsAsAdminResponse
-> SearchProductsAsAdminResponse -> Bool
== :: SearchProductsAsAdminResponse
-> SearchProductsAsAdminResponse -> Bool
$c== :: SearchProductsAsAdminResponse
-> SearchProductsAsAdminResponse -> Bool
Prelude.Eq, ReadPrec [SearchProductsAsAdminResponse]
ReadPrec SearchProductsAsAdminResponse
Int -> ReadS SearchProductsAsAdminResponse
ReadS [SearchProductsAsAdminResponse]
(Int -> ReadS SearchProductsAsAdminResponse)
-> ReadS [SearchProductsAsAdminResponse]
-> ReadPrec SearchProductsAsAdminResponse
-> ReadPrec [SearchProductsAsAdminResponse]
-> Read SearchProductsAsAdminResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SearchProductsAsAdminResponse]
$creadListPrec :: ReadPrec [SearchProductsAsAdminResponse]
readPrec :: ReadPrec SearchProductsAsAdminResponse
$creadPrec :: ReadPrec SearchProductsAsAdminResponse
readList :: ReadS [SearchProductsAsAdminResponse]
$creadList :: ReadS [SearchProductsAsAdminResponse]
readsPrec :: Int -> ReadS SearchProductsAsAdminResponse
$creadsPrec :: Int -> ReadS SearchProductsAsAdminResponse
Prelude.Read, Int -> SearchProductsAsAdminResponse -> ShowS
[SearchProductsAsAdminResponse] -> ShowS
SearchProductsAsAdminResponse -> String
(Int -> SearchProductsAsAdminResponse -> ShowS)
-> (SearchProductsAsAdminResponse -> String)
-> ([SearchProductsAsAdminResponse] -> ShowS)
-> Show SearchProductsAsAdminResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SearchProductsAsAdminResponse] -> ShowS
$cshowList :: [SearchProductsAsAdminResponse] -> ShowS
show :: SearchProductsAsAdminResponse -> String
$cshow :: SearchProductsAsAdminResponse -> String
showsPrec :: Int -> SearchProductsAsAdminResponse -> ShowS
$cshowsPrec :: Int -> SearchProductsAsAdminResponse -> ShowS
Prelude.Show, (forall x.
SearchProductsAsAdminResponse
-> Rep SearchProductsAsAdminResponse x)
-> (forall x.
Rep SearchProductsAsAdminResponse x
-> SearchProductsAsAdminResponse)
-> Generic SearchProductsAsAdminResponse
forall x.
Rep SearchProductsAsAdminResponse x
-> SearchProductsAsAdminResponse
forall x.
SearchProductsAsAdminResponse
-> Rep SearchProductsAsAdminResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SearchProductsAsAdminResponse x
-> SearchProductsAsAdminResponse
$cfrom :: forall x.
SearchProductsAsAdminResponse
-> Rep SearchProductsAsAdminResponse x
Prelude.Generic)
newSearchProductsAsAdminResponse ::
Prelude.Int ->
SearchProductsAsAdminResponse
newSearchProductsAsAdminResponse :: Int -> SearchProductsAsAdminResponse
newSearchProductsAsAdminResponse Int
pHttpStatus_ =
SearchProductsAsAdminResponse' :: Maybe Text
-> Maybe [ProductViewDetail]
-> Int
-> SearchProductsAsAdminResponse
SearchProductsAsAdminResponse'
{ $sel:nextPageToken:SearchProductsAsAdminResponse' :: Maybe Text
nextPageToken =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:productViewDetails:SearchProductsAsAdminResponse' :: Maybe [ProductViewDetail]
productViewDetails = Maybe [ProductViewDetail]
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:SearchProductsAsAdminResponse' :: Int
httpStatus = Int
pHttpStatus_
}
searchProductsAsAdminResponse_nextPageToken :: Lens.Lens' SearchProductsAsAdminResponse (Prelude.Maybe Prelude.Text)
searchProductsAsAdminResponse_nextPageToken :: (Maybe Text -> f (Maybe Text))
-> SearchProductsAsAdminResponse -> f SearchProductsAsAdminResponse
searchProductsAsAdminResponse_nextPageToken = (SearchProductsAsAdminResponse -> Maybe Text)
-> (SearchProductsAsAdminResponse
-> Maybe Text -> SearchProductsAsAdminResponse)
-> Lens' SearchProductsAsAdminResponse (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchProductsAsAdminResponse' {Maybe Text
nextPageToken :: Maybe Text
$sel:nextPageToken:SearchProductsAsAdminResponse' :: SearchProductsAsAdminResponse -> Maybe Text
nextPageToken} -> Maybe Text
nextPageToken) (\s :: SearchProductsAsAdminResponse
s@SearchProductsAsAdminResponse' {} Maybe Text
a -> SearchProductsAsAdminResponse
s {$sel:nextPageToken:SearchProductsAsAdminResponse' :: Maybe Text
nextPageToken = Maybe Text
a} :: SearchProductsAsAdminResponse)
searchProductsAsAdminResponse_productViewDetails :: Lens.Lens' SearchProductsAsAdminResponse (Prelude.Maybe [ProductViewDetail])
searchProductsAsAdminResponse_productViewDetails :: (Maybe [ProductViewDetail] -> f (Maybe [ProductViewDetail]))
-> SearchProductsAsAdminResponse -> f SearchProductsAsAdminResponse
searchProductsAsAdminResponse_productViewDetails = (SearchProductsAsAdminResponse -> Maybe [ProductViewDetail])
-> (SearchProductsAsAdminResponse
-> Maybe [ProductViewDetail] -> SearchProductsAsAdminResponse)
-> Lens' SearchProductsAsAdminResponse (Maybe [ProductViewDetail])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchProductsAsAdminResponse' {Maybe [ProductViewDetail]
productViewDetails :: Maybe [ProductViewDetail]
$sel:productViewDetails:SearchProductsAsAdminResponse' :: SearchProductsAsAdminResponse -> Maybe [ProductViewDetail]
productViewDetails} -> Maybe [ProductViewDetail]
productViewDetails) (\s :: SearchProductsAsAdminResponse
s@SearchProductsAsAdminResponse' {} Maybe [ProductViewDetail]
a -> SearchProductsAsAdminResponse
s {$sel:productViewDetails:SearchProductsAsAdminResponse' :: Maybe [ProductViewDetail]
productViewDetails = Maybe [ProductViewDetail]
a} :: SearchProductsAsAdminResponse) ((Maybe [ProductViewDetail] -> f (Maybe [ProductViewDetail]))
-> SearchProductsAsAdminResponse
-> f SearchProductsAsAdminResponse)
-> ((Maybe [ProductViewDetail] -> f (Maybe [ProductViewDetail]))
-> Maybe [ProductViewDetail] -> f (Maybe [ProductViewDetail]))
-> (Maybe [ProductViewDetail] -> f (Maybe [ProductViewDetail]))
-> SearchProductsAsAdminResponse
-> f SearchProductsAsAdminResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ProductViewDetail]
[ProductViewDetail]
[ProductViewDetail]
[ProductViewDetail]
-> Iso
(Maybe [ProductViewDetail])
(Maybe [ProductViewDetail])
(Maybe [ProductViewDetail])
(Maybe [ProductViewDetail])
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
[ProductViewDetail]
[ProductViewDetail]
[ProductViewDetail]
[ProductViewDetail]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
searchProductsAsAdminResponse_httpStatus :: Lens.Lens' SearchProductsAsAdminResponse Prelude.Int
searchProductsAsAdminResponse_httpStatus :: (Int -> f Int)
-> SearchProductsAsAdminResponse -> f SearchProductsAsAdminResponse
searchProductsAsAdminResponse_httpStatus = (SearchProductsAsAdminResponse -> Int)
-> (SearchProductsAsAdminResponse
-> Int -> SearchProductsAsAdminResponse)
-> Lens
SearchProductsAsAdminResponse SearchProductsAsAdminResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SearchProductsAsAdminResponse' {Int
httpStatus :: Int
$sel:httpStatus:SearchProductsAsAdminResponse' :: SearchProductsAsAdminResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: SearchProductsAsAdminResponse
s@SearchProductsAsAdminResponse' {} Int
a -> SearchProductsAsAdminResponse
s {$sel:httpStatus:SearchProductsAsAdminResponse' :: Int
httpStatus = Int
a} :: SearchProductsAsAdminResponse)
instance Prelude.NFData SearchProductsAsAdminResponse