{-# 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.CustomerProfiles.ListProfileObjectTypes
(
ListProfileObjectTypes (..),
newListProfileObjectTypes,
listProfileObjectTypes_maxResults,
listProfileObjectTypes_nextToken,
listProfileObjectTypes_domainName,
ListProfileObjectTypesResponse (..),
newListProfileObjectTypesResponse,
listProfileObjectTypesResponse_items,
listProfileObjectTypesResponse_nextToken,
listProfileObjectTypesResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import Amazonka.CustomerProfiles.Types
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data ListProfileObjectTypes = ListProfileObjectTypes'
{
ListProfileObjectTypes -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListProfileObjectTypes -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListProfileObjectTypes -> Text
domainName :: Prelude.Text
}
deriving (ListProfileObjectTypes -> ListProfileObjectTypes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListProfileObjectTypes -> ListProfileObjectTypes -> Bool
$c/= :: ListProfileObjectTypes -> ListProfileObjectTypes -> Bool
== :: ListProfileObjectTypes -> ListProfileObjectTypes -> Bool
$c== :: ListProfileObjectTypes -> ListProfileObjectTypes -> Bool
Prelude.Eq, ReadPrec [ListProfileObjectTypes]
ReadPrec ListProfileObjectTypes
Int -> ReadS ListProfileObjectTypes
ReadS [ListProfileObjectTypes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListProfileObjectTypes]
$creadListPrec :: ReadPrec [ListProfileObjectTypes]
readPrec :: ReadPrec ListProfileObjectTypes
$creadPrec :: ReadPrec ListProfileObjectTypes
readList :: ReadS [ListProfileObjectTypes]
$creadList :: ReadS [ListProfileObjectTypes]
readsPrec :: Int -> ReadS ListProfileObjectTypes
$creadsPrec :: Int -> ReadS ListProfileObjectTypes
Prelude.Read, Int -> ListProfileObjectTypes -> ShowS
[ListProfileObjectTypes] -> ShowS
ListProfileObjectTypes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListProfileObjectTypes] -> ShowS
$cshowList :: [ListProfileObjectTypes] -> ShowS
show :: ListProfileObjectTypes -> String
$cshow :: ListProfileObjectTypes -> String
showsPrec :: Int -> ListProfileObjectTypes -> ShowS
$cshowsPrec :: Int -> ListProfileObjectTypes -> ShowS
Prelude.Show, forall x. Rep ListProfileObjectTypes x -> ListProfileObjectTypes
forall x. ListProfileObjectTypes -> Rep ListProfileObjectTypes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListProfileObjectTypes x -> ListProfileObjectTypes
$cfrom :: forall x. ListProfileObjectTypes -> Rep ListProfileObjectTypes x
Prelude.Generic)
newListProfileObjectTypes ::
Prelude.Text ->
ListProfileObjectTypes
newListProfileObjectTypes :: Text -> ListProfileObjectTypes
newListProfileObjectTypes Text
pDomainName_ =
ListProfileObjectTypes'
{ $sel:maxResults:ListProfileObjectTypes' :: Maybe Natural
maxResults =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListProfileObjectTypes' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:domainName:ListProfileObjectTypes' :: Text
domainName = Text
pDomainName_
}
listProfileObjectTypes_maxResults :: Lens.Lens' ListProfileObjectTypes (Prelude.Maybe Prelude.Natural)
listProfileObjectTypes_maxResults :: Lens' ListProfileObjectTypes (Maybe Natural)
listProfileObjectTypes_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProfileObjectTypes' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListProfileObjectTypes' :: ListProfileObjectTypes -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListProfileObjectTypes
s@ListProfileObjectTypes' {} Maybe Natural
a -> ListProfileObjectTypes
s {$sel:maxResults:ListProfileObjectTypes' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListProfileObjectTypes)
listProfileObjectTypes_nextToken :: Lens.Lens' ListProfileObjectTypes (Prelude.Maybe Prelude.Text)
listProfileObjectTypes_nextToken :: Lens' ListProfileObjectTypes (Maybe Text)
listProfileObjectTypes_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProfileObjectTypes' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListProfileObjectTypes' :: ListProfileObjectTypes -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListProfileObjectTypes
s@ListProfileObjectTypes' {} Maybe Text
a -> ListProfileObjectTypes
s {$sel:nextToken:ListProfileObjectTypes' :: Maybe Text
nextToken = Maybe Text
a} :: ListProfileObjectTypes)
listProfileObjectTypes_domainName :: Lens.Lens' ListProfileObjectTypes Prelude.Text
listProfileObjectTypes_domainName :: Lens' ListProfileObjectTypes Text
listProfileObjectTypes_domainName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProfileObjectTypes' {Text
domainName :: Text
$sel:domainName:ListProfileObjectTypes' :: ListProfileObjectTypes -> Text
domainName} -> Text
domainName) (\s :: ListProfileObjectTypes
s@ListProfileObjectTypes' {} Text
a -> ListProfileObjectTypes
s {$sel:domainName:ListProfileObjectTypes' :: Text
domainName = Text
a} :: ListProfileObjectTypes)
instance Core.AWSRequest ListProfileObjectTypes where
type
AWSResponse ListProfileObjectTypes =
ListProfileObjectTypesResponse
request :: (Service -> Service)
-> ListProfileObjectTypes -> Request ListProfileObjectTypes
request Service -> Service
overrides =
forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListProfileObjectTypes
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListProfileObjectTypes)))
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 [ListProfileObjectTypeItem]
-> Maybe Text -> Int -> ListProfileObjectTypesResponse
ListProfileObjectTypesResponse'
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
"Items" 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 ListProfileObjectTypes where
hashWithSalt :: Int -> ListProfileObjectTypes -> Int
hashWithSalt Int
_salt ListProfileObjectTypes' {Maybe Natural
Maybe Text
Text
domainName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:domainName:ListProfileObjectTypes' :: ListProfileObjectTypes -> Text
$sel:nextToken:ListProfileObjectTypes' :: ListProfileObjectTypes -> Maybe Text
$sel:maxResults:ListProfileObjectTypes' :: ListProfileObjectTypes -> Maybe Natural
..} =
Int
_salt
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
domainName
instance Prelude.NFData ListProfileObjectTypes where
rnf :: ListProfileObjectTypes -> ()
rnf ListProfileObjectTypes' {Maybe Natural
Maybe Text
Text
domainName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:domainName:ListProfileObjectTypes' :: ListProfileObjectTypes -> Text
$sel:nextToken:ListProfileObjectTypes' :: ListProfileObjectTypes -> Maybe Text
$sel:maxResults:ListProfileObjectTypes' :: ListProfileObjectTypes -> Maybe Natural
..} =
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
domainName
instance Data.ToHeaders ListProfileObjectTypes where
toHeaders :: ListProfileObjectTypes -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToPath ListProfileObjectTypes where
toPath :: ListProfileObjectTypes -> ByteString
toPath ListProfileObjectTypes' {Maybe Natural
Maybe Text
Text
domainName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:domainName:ListProfileObjectTypes' :: ListProfileObjectTypes -> Text
$sel:nextToken:ListProfileObjectTypes' :: ListProfileObjectTypes -> Maybe Text
$sel:maxResults:ListProfileObjectTypes' :: ListProfileObjectTypes -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/domains/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
domainName, ByteString
"/object-types"]
instance Data.ToQuery ListProfileObjectTypes where
toQuery :: ListProfileObjectTypes -> QueryString
toQuery ListProfileObjectTypes' {Maybe Natural
Maybe Text
Text
domainName :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:domainName:ListProfileObjectTypes' :: ListProfileObjectTypes -> Text
$sel:nextToken:ListProfileObjectTypes' :: ListProfileObjectTypes -> Maybe Text
$sel:maxResults:ListProfileObjectTypes' :: ListProfileObjectTypes -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"max-results" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
ByteString
"next-token" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
]
data ListProfileObjectTypesResponse = ListProfileObjectTypesResponse'
{
ListProfileObjectTypesResponse -> Maybe [ListProfileObjectTypeItem]
items :: Prelude.Maybe [ListProfileObjectTypeItem],
ListProfileObjectTypesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListProfileObjectTypesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListProfileObjectTypesResponse
-> ListProfileObjectTypesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListProfileObjectTypesResponse
-> ListProfileObjectTypesResponse -> Bool
$c/= :: ListProfileObjectTypesResponse
-> ListProfileObjectTypesResponse -> Bool
== :: ListProfileObjectTypesResponse
-> ListProfileObjectTypesResponse -> Bool
$c== :: ListProfileObjectTypesResponse
-> ListProfileObjectTypesResponse -> Bool
Prelude.Eq, ReadPrec [ListProfileObjectTypesResponse]
ReadPrec ListProfileObjectTypesResponse
Int -> ReadS ListProfileObjectTypesResponse
ReadS [ListProfileObjectTypesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListProfileObjectTypesResponse]
$creadListPrec :: ReadPrec [ListProfileObjectTypesResponse]
readPrec :: ReadPrec ListProfileObjectTypesResponse
$creadPrec :: ReadPrec ListProfileObjectTypesResponse
readList :: ReadS [ListProfileObjectTypesResponse]
$creadList :: ReadS [ListProfileObjectTypesResponse]
readsPrec :: Int -> ReadS ListProfileObjectTypesResponse
$creadsPrec :: Int -> ReadS ListProfileObjectTypesResponse
Prelude.Read, Int -> ListProfileObjectTypesResponse -> ShowS
[ListProfileObjectTypesResponse] -> ShowS
ListProfileObjectTypesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListProfileObjectTypesResponse] -> ShowS
$cshowList :: [ListProfileObjectTypesResponse] -> ShowS
show :: ListProfileObjectTypesResponse -> String
$cshow :: ListProfileObjectTypesResponse -> String
showsPrec :: Int -> ListProfileObjectTypesResponse -> ShowS
$cshowsPrec :: Int -> ListProfileObjectTypesResponse -> ShowS
Prelude.Show, forall x.
Rep ListProfileObjectTypesResponse x
-> ListProfileObjectTypesResponse
forall x.
ListProfileObjectTypesResponse
-> Rep ListProfileObjectTypesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListProfileObjectTypesResponse x
-> ListProfileObjectTypesResponse
$cfrom :: forall x.
ListProfileObjectTypesResponse
-> Rep ListProfileObjectTypesResponse x
Prelude.Generic)
newListProfileObjectTypesResponse ::
Prelude.Int ->
ListProfileObjectTypesResponse
newListProfileObjectTypesResponse :: Int -> ListProfileObjectTypesResponse
newListProfileObjectTypesResponse Int
pHttpStatus_ =
ListProfileObjectTypesResponse'
{ $sel:items:ListProfileObjectTypesResponse' :: Maybe [ListProfileObjectTypeItem]
items =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListProfileObjectTypesResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListProfileObjectTypesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listProfileObjectTypesResponse_items :: Lens.Lens' ListProfileObjectTypesResponse (Prelude.Maybe [ListProfileObjectTypeItem])
listProfileObjectTypesResponse_items :: Lens'
ListProfileObjectTypesResponse (Maybe [ListProfileObjectTypeItem])
listProfileObjectTypesResponse_items = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProfileObjectTypesResponse' {Maybe [ListProfileObjectTypeItem]
items :: Maybe [ListProfileObjectTypeItem]
$sel:items:ListProfileObjectTypesResponse' :: ListProfileObjectTypesResponse -> Maybe [ListProfileObjectTypeItem]
items} -> Maybe [ListProfileObjectTypeItem]
items) (\s :: ListProfileObjectTypesResponse
s@ListProfileObjectTypesResponse' {} Maybe [ListProfileObjectTypeItem]
a -> ListProfileObjectTypesResponse
s {$sel:items:ListProfileObjectTypesResponse' :: Maybe [ListProfileObjectTypeItem]
items = Maybe [ListProfileObjectTypeItem]
a} :: ListProfileObjectTypesResponse) 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
listProfileObjectTypesResponse_nextToken :: Lens.Lens' ListProfileObjectTypesResponse (Prelude.Maybe Prelude.Text)
listProfileObjectTypesResponse_nextToken :: Lens' ListProfileObjectTypesResponse (Maybe Text)
listProfileObjectTypesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProfileObjectTypesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListProfileObjectTypesResponse' :: ListProfileObjectTypesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListProfileObjectTypesResponse
s@ListProfileObjectTypesResponse' {} Maybe Text
a -> ListProfileObjectTypesResponse
s {$sel:nextToken:ListProfileObjectTypesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListProfileObjectTypesResponse)
listProfileObjectTypesResponse_httpStatus :: Lens.Lens' ListProfileObjectTypesResponse Prelude.Int
listProfileObjectTypesResponse_httpStatus :: Lens' ListProfileObjectTypesResponse Int
listProfileObjectTypesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListProfileObjectTypesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListProfileObjectTypesResponse' :: ListProfileObjectTypesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListProfileObjectTypesResponse
s@ListProfileObjectTypesResponse' {} Int
a -> ListProfileObjectTypesResponse
s {$sel:httpStatus:ListProfileObjectTypesResponse' :: Int
httpStatus = Int
a} :: ListProfileObjectTypesResponse)
instance
Prelude.NFData
ListProfileObjectTypesResponse
where
rnf :: ListProfileObjectTypesResponse -> ()
rnf ListProfileObjectTypesResponse' {Int
Maybe [ListProfileObjectTypeItem]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
items :: Maybe [ListProfileObjectTypeItem]
$sel:httpStatus:ListProfileObjectTypesResponse' :: ListProfileObjectTypesResponse -> Int
$sel:nextToken:ListProfileObjectTypesResponse' :: ListProfileObjectTypesResponse -> Maybe Text
$sel:items:ListProfileObjectTypesResponse' :: ListProfileObjectTypesResponse -> Maybe [ListProfileObjectTypeItem]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [ListProfileObjectTypeItem]
items
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