{-# 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.Connect.ListInstanceAttributes
(
ListInstanceAttributes (..),
newListInstanceAttributes,
listInstanceAttributes_maxResults,
listInstanceAttributes_nextToken,
listInstanceAttributes_instanceId,
ListInstanceAttributesResponse (..),
newListInstanceAttributesResponse,
listInstanceAttributesResponse_attributes,
listInstanceAttributesResponse_nextToken,
listInstanceAttributesResponse_httpStatus,
)
where
import Amazonka.Connect.Types
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
data ListInstanceAttributes = ListInstanceAttributes'
{
ListInstanceAttributes -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListInstanceAttributes -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListInstanceAttributes -> Text
instanceId :: Prelude.Text
}
deriving (ListInstanceAttributes -> ListInstanceAttributes -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListInstanceAttributes -> ListInstanceAttributes -> Bool
$c/= :: ListInstanceAttributes -> ListInstanceAttributes -> Bool
== :: ListInstanceAttributes -> ListInstanceAttributes -> Bool
$c== :: ListInstanceAttributes -> ListInstanceAttributes -> Bool
Prelude.Eq, ReadPrec [ListInstanceAttributes]
ReadPrec ListInstanceAttributes
Int -> ReadS ListInstanceAttributes
ReadS [ListInstanceAttributes]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListInstanceAttributes]
$creadListPrec :: ReadPrec [ListInstanceAttributes]
readPrec :: ReadPrec ListInstanceAttributes
$creadPrec :: ReadPrec ListInstanceAttributes
readList :: ReadS [ListInstanceAttributes]
$creadList :: ReadS [ListInstanceAttributes]
readsPrec :: Int -> ReadS ListInstanceAttributes
$creadsPrec :: Int -> ReadS ListInstanceAttributes
Prelude.Read, Int -> ListInstanceAttributes -> ShowS
[ListInstanceAttributes] -> ShowS
ListInstanceAttributes -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListInstanceAttributes] -> ShowS
$cshowList :: [ListInstanceAttributes] -> ShowS
show :: ListInstanceAttributes -> String
$cshow :: ListInstanceAttributes -> String
showsPrec :: Int -> ListInstanceAttributes -> ShowS
$cshowsPrec :: Int -> ListInstanceAttributes -> ShowS
Prelude.Show, forall x. Rep ListInstanceAttributes x -> ListInstanceAttributes
forall x. ListInstanceAttributes -> Rep ListInstanceAttributes x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListInstanceAttributes x -> ListInstanceAttributes
$cfrom :: forall x. ListInstanceAttributes -> Rep ListInstanceAttributes x
Prelude.Generic)
newListInstanceAttributes ::
Prelude.Text ->
ListInstanceAttributes
newListInstanceAttributes :: Text -> ListInstanceAttributes
newListInstanceAttributes Text
pInstanceId_ =
ListInstanceAttributes'
{ $sel:maxResults:ListInstanceAttributes' :: Maybe Natural
maxResults =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListInstanceAttributes' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:instanceId:ListInstanceAttributes' :: Text
instanceId = Text
pInstanceId_
}
listInstanceAttributes_maxResults :: Lens.Lens' ListInstanceAttributes (Prelude.Maybe Prelude.Natural)
listInstanceAttributes_maxResults :: Lens' ListInstanceAttributes (Maybe Natural)
listInstanceAttributes_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstanceAttributes' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListInstanceAttributes' :: ListInstanceAttributes -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListInstanceAttributes
s@ListInstanceAttributes' {} Maybe Natural
a -> ListInstanceAttributes
s {$sel:maxResults:ListInstanceAttributes' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListInstanceAttributes)
listInstanceAttributes_nextToken :: Lens.Lens' ListInstanceAttributes (Prelude.Maybe Prelude.Text)
listInstanceAttributes_nextToken :: Lens' ListInstanceAttributes (Maybe Text)
listInstanceAttributes_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstanceAttributes' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListInstanceAttributes' :: ListInstanceAttributes -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListInstanceAttributes
s@ListInstanceAttributes' {} Maybe Text
a -> ListInstanceAttributes
s {$sel:nextToken:ListInstanceAttributes' :: Maybe Text
nextToken = Maybe Text
a} :: ListInstanceAttributes)
listInstanceAttributes_instanceId :: Lens.Lens' ListInstanceAttributes Prelude.Text
listInstanceAttributes_instanceId :: Lens' ListInstanceAttributes Text
listInstanceAttributes_instanceId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstanceAttributes' {Text
instanceId :: Text
$sel:instanceId:ListInstanceAttributes' :: ListInstanceAttributes -> Text
instanceId} -> Text
instanceId) (\s :: ListInstanceAttributes
s@ListInstanceAttributes' {} Text
a -> ListInstanceAttributes
s {$sel:instanceId:ListInstanceAttributes' :: Text
instanceId = Text
a} :: ListInstanceAttributes)
instance Core.AWSPager ListInstanceAttributes where
page :: ListInstanceAttributes
-> AWSResponse ListInstanceAttributes
-> Maybe ListInstanceAttributes
page ListInstanceAttributes
rq AWSResponse ListInstanceAttributes
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListInstanceAttributes
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListInstanceAttributesResponse (Maybe Text)
listInstanceAttributesResponse_nextToken
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 ListInstanceAttributes
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListInstanceAttributesResponse (Maybe [Attribute])
listInstanceAttributesResponse_attributes
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.$ ListInstanceAttributes
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListInstanceAttributes (Maybe Text)
listInstanceAttributes_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListInstanceAttributes
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListInstanceAttributesResponse (Maybe Text)
listInstanceAttributesResponse_nextToken
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 ListInstanceAttributes where
type
AWSResponse ListInstanceAttributes =
ListInstanceAttributesResponse
request :: (Service -> Service)
-> ListInstanceAttributes -> Request ListInstanceAttributes
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 ListInstanceAttributes
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListInstanceAttributes)))
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 [Attribute]
-> Maybe Text -> Int -> ListInstanceAttributesResponse
ListInstanceAttributesResponse'
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
"Attributes" 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 ListInstanceAttributes where
hashWithSalt :: Int -> ListInstanceAttributes -> Int
hashWithSalt Int
_salt ListInstanceAttributes' {Maybe Natural
Maybe Text
Text
instanceId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:instanceId:ListInstanceAttributes' :: ListInstanceAttributes -> Text
$sel:nextToken:ListInstanceAttributes' :: ListInstanceAttributes -> Maybe Text
$sel:maxResults:ListInstanceAttributes' :: ListInstanceAttributes -> 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
instanceId
instance Prelude.NFData ListInstanceAttributes where
rnf :: ListInstanceAttributes -> ()
rnf ListInstanceAttributes' {Maybe Natural
Maybe Text
Text
instanceId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:instanceId:ListInstanceAttributes' :: ListInstanceAttributes -> Text
$sel:nextToken:ListInstanceAttributes' :: ListInstanceAttributes -> Maybe Text
$sel:maxResults:ListInstanceAttributes' :: ListInstanceAttributes -> 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
instanceId
instance Data.ToHeaders ListInstanceAttributes where
toHeaders :: ListInstanceAttributes -> 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 ListInstanceAttributes where
toPath :: ListInstanceAttributes -> ByteString
toPath ListInstanceAttributes' {Maybe Natural
Maybe Text
Text
instanceId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:instanceId:ListInstanceAttributes' :: ListInstanceAttributes -> Text
$sel:nextToken:ListInstanceAttributes' :: ListInstanceAttributes -> Maybe Text
$sel:maxResults:ListInstanceAttributes' :: ListInstanceAttributes -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/instance/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
instanceId, ByteString
"/attributes"]
instance Data.ToQuery ListInstanceAttributes where
toQuery :: ListInstanceAttributes -> QueryString
toQuery ListInstanceAttributes' {Maybe Natural
Maybe Text
Text
instanceId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:instanceId:ListInstanceAttributes' :: ListInstanceAttributes -> Text
$sel:nextToken:ListInstanceAttributes' :: ListInstanceAttributes -> Maybe Text
$sel:maxResults:ListInstanceAttributes' :: ListInstanceAttributes -> Maybe Natural
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"maxResults" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Natural
maxResults,
ByteString
"nextToken" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Maybe Text
nextToken
]
data ListInstanceAttributesResponse = ListInstanceAttributesResponse'
{
ListInstanceAttributesResponse -> Maybe [Attribute]
attributes :: Prelude.Maybe [Attribute],
ListInstanceAttributesResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListInstanceAttributesResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListInstanceAttributesResponse
-> ListInstanceAttributesResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListInstanceAttributesResponse
-> ListInstanceAttributesResponse -> Bool
$c/= :: ListInstanceAttributesResponse
-> ListInstanceAttributesResponse -> Bool
== :: ListInstanceAttributesResponse
-> ListInstanceAttributesResponse -> Bool
$c== :: ListInstanceAttributesResponse
-> ListInstanceAttributesResponse -> Bool
Prelude.Eq, ReadPrec [ListInstanceAttributesResponse]
ReadPrec ListInstanceAttributesResponse
Int -> ReadS ListInstanceAttributesResponse
ReadS [ListInstanceAttributesResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListInstanceAttributesResponse]
$creadListPrec :: ReadPrec [ListInstanceAttributesResponse]
readPrec :: ReadPrec ListInstanceAttributesResponse
$creadPrec :: ReadPrec ListInstanceAttributesResponse
readList :: ReadS [ListInstanceAttributesResponse]
$creadList :: ReadS [ListInstanceAttributesResponse]
readsPrec :: Int -> ReadS ListInstanceAttributesResponse
$creadsPrec :: Int -> ReadS ListInstanceAttributesResponse
Prelude.Read, Int -> ListInstanceAttributesResponse -> ShowS
[ListInstanceAttributesResponse] -> ShowS
ListInstanceAttributesResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListInstanceAttributesResponse] -> ShowS
$cshowList :: [ListInstanceAttributesResponse] -> ShowS
show :: ListInstanceAttributesResponse -> String
$cshow :: ListInstanceAttributesResponse -> String
showsPrec :: Int -> ListInstanceAttributesResponse -> ShowS
$cshowsPrec :: Int -> ListInstanceAttributesResponse -> ShowS
Prelude.Show, forall x.
Rep ListInstanceAttributesResponse x
-> ListInstanceAttributesResponse
forall x.
ListInstanceAttributesResponse
-> Rep ListInstanceAttributesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListInstanceAttributesResponse x
-> ListInstanceAttributesResponse
$cfrom :: forall x.
ListInstanceAttributesResponse
-> Rep ListInstanceAttributesResponse x
Prelude.Generic)
newListInstanceAttributesResponse ::
Prelude.Int ->
ListInstanceAttributesResponse
newListInstanceAttributesResponse :: Int -> ListInstanceAttributesResponse
newListInstanceAttributesResponse Int
pHttpStatus_ =
ListInstanceAttributesResponse'
{ $sel:attributes:ListInstanceAttributesResponse' :: Maybe [Attribute]
attributes =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListInstanceAttributesResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListInstanceAttributesResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listInstanceAttributesResponse_attributes :: Lens.Lens' ListInstanceAttributesResponse (Prelude.Maybe [Attribute])
listInstanceAttributesResponse_attributes :: Lens' ListInstanceAttributesResponse (Maybe [Attribute])
listInstanceAttributesResponse_attributes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstanceAttributesResponse' {Maybe [Attribute]
attributes :: Maybe [Attribute]
$sel:attributes:ListInstanceAttributesResponse' :: ListInstanceAttributesResponse -> Maybe [Attribute]
attributes} -> Maybe [Attribute]
attributes) (\s :: ListInstanceAttributesResponse
s@ListInstanceAttributesResponse' {} Maybe [Attribute]
a -> ListInstanceAttributesResponse
s {$sel:attributes:ListInstanceAttributesResponse' :: Maybe [Attribute]
attributes = Maybe [Attribute]
a} :: ListInstanceAttributesResponse) 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
listInstanceAttributesResponse_nextToken :: Lens.Lens' ListInstanceAttributesResponse (Prelude.Maybe Prelude.Text)
listInstanceAttributesResponse_nextToken :: Lens' ListInstanceAttributesResponse (Maybe Text)
listInstanceAttributesResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstanceAttributesResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListInstanceAttributesResponse' :: ListInstanceAttributesResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListInstanceAttributesResponse
s@ListInstanceAttributesResponse' {} Maybe Text
a -> ListInstanceAttributesResponse
s {$sel:nextToken:ListInstanceAttributesResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListInstanceAttributesResponse)
listInstanceAttributesResponse_httpStatus :: Lens.Lens' ListInstanceAttributesResponse Prelude.Int
listInstanceAttributesResponse_httpStatus :: Lens' ListInstanceAttributesResponse Int
listInstanceAttributesResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListInstanceAttributesResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListInstanceAttributesResponse' :: ListInstanceAttributesResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListInstanceAttributesResponse
s@ListInstanceAttributesResponse' {} Int
a -> ListInstanceAttributesResponse
s {$sel:httpStatus:ListInstanceAttributesResponse' :: Int
httpStatus = Int
a} :: ListInstanceAttributesResponse)
instance
Prelude.NFData
ListInstanceAttributesResponse
where
rnf :: ListInstanceAttributesResponse -> ()
rnf ListInstanceAttributesResponse' {Int
Maybe [Attribute]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
attributes :: Maybe [Attribute]
$sel:httpStatus:ListInstanceAttributesResponse' :: ListInstanceAttributesResponse -> Int
$sel:nextToken:ListInstanceAttributesResponse' :: ListInstanceAttributesResponse -> Maybe Text
$sel:attributes:ListInstanceAttributesResponse' :: ListInstanceAttributesResponse -> Maybe [Attribute]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Attribute]
attributes
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