{-# 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.WellArchitected.ListShareInvitations
(
ListShareInvitations (..),
newListShareInvitations,
listShareInvitations_nextToken,
listShareInvitations_workloadNamePrefix,
listShareInvitations_maxResults,
ListShareInvitationsResponse (..),
newListShareInvitationsResponse,
listShareInvitationsResponse_shareInvitationSummaries,
listShareInvitationsResponse_nextToken,
listShareInvitationsResponse_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.WellArchitected.Types
data ListShareInvitations = ListShareInvitations'
{ ListShareInvitations -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListShareInvitations -> Maybe Text
workloadNamePrefix :: Prelude.Maybe Prelude.Text,
ListShareInvitations -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural
}
deriving (ListShareInvitations -> ListShareInvitations -> Bool
(ListShareInvitations -> ListShareInvitations -> Bool)
-> (ListShareInvitations -> ListShareInvitations -> Bool)
-> Eq ListShareInvitations
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListShareInvitations -> ListShareInvitations -> Bool
$c/= :: ListShareInvitations -> ListShareInvitations -> Bool
== :: ListShareInvitations -> ListShareInvitations -> Bool
$c== :: ListShareInvitations -> ListShareInvitations -> Bool
Prelude.Eq, ReadPrec [ListShareInvitations]
ReadPrec ListShareInvitations
Int -> ReadS ListShareInvitations
ReadS [ListShareInvitations]
(Int -> ReadS ListShareInvitations)
-> ReadS [ListShareInvitations]
-> ReadPrec ListShareInvitations
-> ReadPrec [ListShareInvitations]
-> Read ListShareInvitations
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListShareInvitations]
$creadListPrec :: ReadPrec [ListShareInvitations]
readPrec :: ReadPrec ListShareInvitations
$creadPrec :: ReadPrec ListShareInvitations
readList :: ReadS [ListShareInvitations]
$creadList :: ReadS [ListShareInvitations]
readsPrec :: Int -> ReadS ListShareInvitations
$creadsPrec :: Int -> ReadS ListShareInvitations
Prelude.Read, Int -> ListShareInvitations -> ShowS
[ListShareInvitations] -> ShowS
ListShareInvitations -> String
(Int -> ListShareInvitations -> ShowS)
-> (ListShareInvitations -> String)
-> ([ListShareInvitations] -> ShowS)
-> Show ListShareInvitations
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListShareInvitations] -> ShowS
$cshowList :: [ListShareInvitations] -> ShowS
show :: ListShareInvitations -> String
$cshow :: ListShareInvitations -> String
showsPrec :: Int -> ListShareInvitations -> ShowS
$cshowsPrec :: Int -> ListShareInvitations -> ShowS
Prelude.Show, (forall x. ListShareInvitations -> Rep ListShareInvitations x)
-> (forall x. Rep ListShareInvitations x -> ListShareInvitations)
-> Generic ListShareInvitations
forall x. Rep ListShareInvitations x -> ListShareInvitations
forall x. ListShareInvitations -> Rep ListShareInvitations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListShareInvitations x -> ListShareInvitations
$cfrom :: forall x. ListShareInvitations -> Rep ListShareInvitations x
Prelude.Generic)
newListShareInvitations ::
ListShareInvitations
newListShareInvitations :: ListShareInvitations
newListShareInvitations =
ListShareInvitations' :: Maybe Text -> Maybe Text -> Maybe Natural -> ListShareInvitations
ListShareInvitations'
{ $sel:nextToken:ListShareInvitations' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:workloadNamePrefix:ListShareInvitations' :: Maybe Text
workloadNamePrefix = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:maxResults:ListShareInvitations' :: Maybe Natural
maxResults = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
listShareInvitations_nextToken :: Lens.Lens' ListShareInvitations (Prelude.Maybe Prelude.Text)
listShareInvitations_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListShareInvitations -> f ListShareInvitations
listShareInvitations_nextToken = (ListShareInvitations -> Maybe Text)
-> (ListShareInvitations -> Maybe Text -> ListShareInvitations)
-> Lens
ListShareInvitations ListShareInvitations (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListShareInvitations' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListShareInvitations' :: ListShareInvitations -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListShareInvitations
s@ListShareInvitations' {} Maybe Text
a -> ListShareInvitations
s {$sel:nextToken:ListShareInvitations' :: Maybe Text
nextToken = Maybe Text
a} :: ListShareInvitations)
listShareInvitations_workloadNamePrefix :: Lens.Lens' ListShareInvitations (Prelude.Maybe Prelude.Text)
listShareInvitations_workloadNamePrefix :: (Maybe Text -> f (Maybe Text))
-> ListShareInvitations -> f ListShareInvitations
listShareInvitations_workloadNamePrefix = (ListShareInvitations -> Maybe Text)
-> (ListShareInvitations -> Maybe Text -> ListShareInvitations)
-> Lens
ListShareInvitations ListShareInvitations (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListShareInvitations' {Maybe Text
workloadNamePrefix :: Maybe Text
$sel:workloadNamePrefix:ListShareInvitations' :: ListShareInvitations -> Maybe Text
workloadNamePrefix} -> Maybe Text
workloadNamePrefix) (\s :: ListShareInvitations
s@ListShareInvitations' {} Maybe Text
a -> ListShareInvitations
s {$sel:workloadNamePrefix:ListShareInvitations' :: Maybe Text
workloadNamePrefix = Maybe Text
a} :: ListShareInvitations)
listShareInvitations_maxResults :: Lens.Lens' ListShareInvitations (Prelude.Maybe Prelude.Natural)
listShareInvitations_maxResults :: (Maybe Natural -> f (Maybe Natural))
-> ListShareInvitations -> f ListShareInvitations
listShareInvitations_maxResults = (ListShareInvitations -> Maybe Natural)
-> (ListShareInvitations -> Maybe Natural -> ListShareInvitations)
-> Lens
ListShareInvitations
ListShareInvitations
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListShareInvitations' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListShareInvitations' :: ListShareInvitations -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListShareInvitations
s@ListShareInvitations' {} Maybe Natural
a -> ListShareInvitations
s {$sel:maxResults:ListShareInvitations' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListShareInvitations)
instance Core.AWSRequest ListShareInvitations where
type
AWSResponse ListShareInvitations =
ListShareInvitationsResponse
request :: ListShareInvitations -> Request ListShareInvitations
request = Service -> ListShareInvitations -> Request ListShareInvitations
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
response :: Logger
-> Service
-> Proxy ListShareInvitations
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListShareInvitations)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either String (AWSResponse ListShareInvitations))
-> Logger
-> Service
-> Proxy ListShareInvitations
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListShareInvitations)))
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 [ShareInvitationSummary]
-> Maybe Text -> Int -> ListShareInvitationsResponse
ListShareInvitationsResponse'
(Maybe [ShareInvitationSummary]
-> Maybe Text -> Int -> ListShareInvitationsResponse)
-> Either String (Maybe [ShareInvitationSummary])
-> Either
String (Maybe Text -> Int -> ListShareInvitationsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object
-> Text -> Either String (Maybe (Maybe [ShareInvitationSummary]))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"ShareInvitationSummaries"
Either String (Maybe (Maybe [ShareInvitationSummary]))
-> Maybe [ShareInvitationSummary]
-> Either String (Maybe [ShareInvitationSummary])
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe [ShareInvitationSummary]
forall a. Monoid a => a
Prelude.mempty
)
Either String (Maybe Text -> Int -> ListShareInvitationsResponse)
-> Either String (Maybe Text)
-> Either String (Int -> ListShareInvitationsResponse)
forall (f :: * -> *) a b. Applicative f => 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
"NextToken")
Either String (Int -> ListShareInvitationsResponse)
-> Either String Int -> Either String ListShareInvitationsResponse
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 ListShareInvitations
instance Prelude.NFData ListShareInvitations
instance Core.ToHeaders ListShareInvitations where
toHeaders :: ListShareInvitations -> ResponseHeaders
toHeaders =
ResponseHeaders -> ListShareInvitations -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ 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.ToPath ListShareInvitations where
toPath :: ListShareInvitations -> ByteString
toPath = ByteString -> ListShareInvitations -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/shareInvitations"
instance Core.ToQuery ListShareInvitations where
toQuery :: ListShareInvitations -> QueryString
toQuery ListShareInvitations' {Maybe Natural
Maybe Text
maxResults :: Maybe Natural
workloadNamePrefix :: Maybe Text
nextToken :: Maybe Text
$sel:maxResults:ListShareInvitations' :: ListShareInvitations -> Maybe Natural
$sel:workloadNamePrefix:ListShareInvitations' :: ListShareInvitations -> Maybe Text
$sel:nextToken:ListShareInvitations' :: ListShareInvitations -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"NextToken" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
nextToken,
ByteString
"WorkloadNamePrefix" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
workloadNamePrefix,
ByteString
"MaxResults" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxResults
]
data ListShareInvitationsResponse = ListShareInvitationsResponse'
{
ListShareInvitationsResponse -> Maybe [ShareInvitationSummary]
shareInvitationSummaries :: Prelude.Maybe [ShareInvitationSummary],
ListShareInvitationsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListShareInvitationsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListShareInvitationsResponse
-> ListShareInvitationsResponse -> Bool
(ListShareInvitationsResponse
-> ListShareInvitationsResponse -> Bool)
-> (ListShareInvitationsResponse
-> ListShareInvitationsResponse -> Bool)
-> Eq ListShareInvitationsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListShareInvitationsResponse
-> ListShareInvitationsResponse -> Bool
$c/= :: ListShareInvitationsResponse
-> ListShareInvitationsResponse -> Bool
== :: ListShareInvitationsResponse
-> ListShareInvitationsResponse -> Bool
$c== :: ListShareInvitationsResponse
-> ListShareInvitationsResponse -> Bool
Prelude.Eq, ReadPrec [ListShareInvitationsResponse]
ReadPrec ListShareInvitationsResponse
Int -> ReadS ListShareInvitationsResponse
ReadS [ListShareInvitationsResponse]
(Int -> ReadS ListShareInvitationsResponse)
-> ReadS [ListShareInvitationsResponse]
-> ReadPrec ListShareInvitationsResponse
-> ReadPrec [ListShareInvitationsResponse]
-> Read ListShareInvitationsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListShareInvitationsResponse]
$creadListPrec :: ReadPrec [ListShareInvitationsResponse]
readPrec :: ReadPrec ListShareInvitationsResponse
$creadPrec :: ReadPrec ListShareInvitationsResponse
readList :: ReadS [ListShareInvitationsResponse]
$creadList :: ReadS [ListShareInvitationsResponse]
readsPrec :: Int -> ReadS ListShareInvitationsResponse
$creadsPrec :: Int -> ReadS ListShareInvitationsResponse
Prelude.Read, Int -> ListShareInvitationsResponse -> ShowS
[ListShareInvitationsResponse] -> ShowS
ListShareInvitationsResponse -> String
(Int -> ListShareInvitationsResponse -> ShowS)
-> (ListShareInvitationsResponse -> String)
-> ([ListShareInvitationsResponse] -> ShowS)
-> Show ListShareInvitationsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListShareInvitationsResponse] -> ShowS
$cshowList :: [ListShareInvitationsResponse] -> ShowS
show :: ListShareInvitationsResponse -> String
$cshow :: ListShareInvitationsResponse -> String
showsPrec :: Int -> ListShareInvitationsResponse -> ShowS
$cshowsPrec :: Int -> ListShareInvitationsResponse -> ShowS
Prelude.Show, (forall x.
ListShareInvitationsResponse -> Rep ListShareInvitationsResponse x)
-> (forall x.
Rep ListShareInvitationsResponse x -> ListShareInvitationsResponse)
-> Generic ListShareInvitationsResponse
forall x.
Rep ListShareInvitationsResponse x -> ListShareInvitationsResponse
forall x.
ListShareInvitationsResponse -> Rep ListShareInvitationsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListShareInvitationsResponse x -> ListShareInvitationsResponse
$cfrom :: forall x.
ListShareInvitationsResponse -> Rep ListShareInvitationsResponse x
Prelude.Generic)
newListShareInvitationsResponse ::
Prelude.Int ->
ListShareInvitationsResponse
newListShareInvitationsResponse :: Int -> ListShareInvitationsResponse
newListShareInvitationsResponse Int
pHttpStatus_ =
ListShareInvitationsResponse' :: Maybe [ShareInvitationSummary]
-> Maybe Text -> Int -> ListShareInvitationsResponse
ListShareInvitationsResponse'
{ $sel:shareInvitationSummaries:ListShareInvitationsResponse' :: Maybe [ShareInvitationSummary]
shareInvitationSummaries =
Maybe [ShareInvitationSummary]
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListShareInvitationsResponse' :: Maybe Text
nextToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListShareInvitationsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listShareInvitationsResponse_shareInvitationSummaries :: Lens.Lens' ListShareInvitationsResponse (Prelude.Maybe [ShareInvitationSummary])
listShareInvitationsResponse_shareInvitationSummaries :: (Maybe [ShareInvitationSummary]
-> f (Maybe [ShareInvitationSummary]))
-> ListShareInvitationsResponse -> f ListShareInvitationsResponse
listShareInvitationsResponse_shareInvitationSummaries = (ListShareInvitationsResponse -> Maybe [ShareInvitationSummary])
-> (ListShareInvitationsResponse
-> Maybe [ShareInvitationSummary] -> ListShareInvitationsResponse)
-> Lens
ListShareInvitationsResponse
ListShareInvitationsResponse
(Maybe [ShareInvitationSummary])
(Maybe [ShareInvitationSummary])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListShareInvitationsResponse' {Maybe [ShareInvitationSummary]
shareInvitationSummaries :: Maybe [ShareInvitationSummary]
$sel:shareInvitationSummaries:ListShareInvitationsResponse' :: ListShareInvitationsResponse -> Maybe [ShareInvitationSummary]
shareInvitationSummaries} -> Maybe [ShareInvitationSummary]
shareInvitationSummaries) (\s :: ListShareInvitationsResponse
s@ListShareInvitationsResponse' {} Maybe [ShareInvitationSummary]
a -> ListShareInvitationsResponse
s {$sel:shareInvitationSummaries:ListShareInvitationsResponse' :: Maybe [ShareInvitationSummary]
shareInvitationSummaries = Maybe [ShareInvitationSummary]
a} :: ListShareInvitationsResponse) ((Maybe [ShareInvitationSummary]
-> f (Maybe [ShareInvitationSummary]))
-> ListShareInvitationsResponse -> f ListShareInvitationsResponse)
-> ((Maybe [ShareInvitationSummary]
-> f (Maybe [ShareInvitationSummary]))
-> Maybe [ShareInvitationSummary]
-> f (Maybe [ShareInvitationSummary]))
-> (Maybe [ShareInvitationSummary]
-> f (Maybe [ShareInvitationSummary]))
-> ListShareInvitationsResponse
-> f ListShareInvitationsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ShareInvitationSummary]
[ShareInvitationSummary]
[ShareInvitationSummary]
[ShareInvitationSummary]
-> Iso
(Maybe [ShareInvitationSummary])
(Maybe [ShareInvitationSummary])
(Maybe [ShareInvitationSummary])
(Maybe [ShareInvitationSummary])
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
[ShareInvitationSummary]
[ShareInvitationSummary]
[ShareInvitationSummary]
[ShareInvitationSummary]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
listShareInvitationsResponse_nextToken :: Lens.Lens' ListShareInvitationsResponse (Prelude.Maybe Prelude.Text)
listShareInvitationsResponse_nextToken :: (Maybe Text -> f (Maybe Text))
-> ListShareInvitationsResponse -> f ListShareInvitationsResponse
listShareInvitationsResponse_nextToken = (ListShareInvitationsResponse -> Maybe Text)
-> (ListShareInvitationsResponse
-> Maybe Text -> ListShareInvitationsResponse)
-> Lens
ListShareInvitationsResponse
ListShareInvitationsResponse
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListShareInvitationsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListShareInvitationsResponse' :: ListShareInvitationsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListShareInvitationsResponse
s@ListShareInvitationsResponse' {} Maybe Text
a -> ListShareInvitationsResponse
s {$sel:nextToken:ListShareInvitationsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListShareInvitationsResponse)
listShareInvitationsResponse_httpStatus :: Lens.Lens' ListShareInvitationsResponse Prelude.Int
listShareInvitationsResponse_httpStatus :: (Int -> f Int)
-> ListShareInvitationsResponse -> f ListShareInvitationsResponse
listShareInvitationsResponse_httpStatus = (ListShareInvitationsResponse -> Int)
-> (ListShareInvitationsResponse
-> Int -> ListShareInvitationsResponse)
-> Lens
ListShareInvitationsResponse ListShareInvitationsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListShareInvitationsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListShareInvitationsResponse' :: ListShareInvitationsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListShareInvitationsResponse
s@ListShareInvitationsResponse' {} Int
a -> ListShareInvitationsResponse
s {$sel:httpStatus:ListShareInvitationsResponse' :: Int
httpStatus = Int
a} :: ListShareInvitationsResponse)
instance Prelude.NFData ListShareInvitationsResponse