{-# 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.S3Outposts.ListSharedEndpoints
(
ListSharedEndpoints (..),
newListSharedEndpoints,
listSharedEndpoints_maxResults,
listSharedEndpoints_nextToken,
listSharedEndpoints_outpostId,
ListSharedEndpointsResponse (..),
newListSharedEndpointsResponse,
listSharedEndpointsResponse_endpoints,
listSharedEndpointsResponse_nextToken,
listSharedEndpointsResponse_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.S3Outposts.Types
data ListSharedEndpoints = ListSharedEndpoints'
{
ListSharedEndpoints -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListSharedEndpoints -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListSharedEndpoints -> Text
outpostId :: Prelude.Text
}
deriving (ListSharedEndpoints -> ListSharedEndpoints -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSharedEndpoints -> ListSharedEndpoints -> Bool
$c/= :: ListSharedEndpoints -> ListSharedEndpoints -> Bool
== :: ListSharedEndpoints -> ListSharedEndpoints -> Bool
$c== :: ListSharedEndpoints -> ListSharedEndpoints -> Bool
Prelude.Eq, ReadPrec [ListSharedEndpoints]
ReadPrec ListSharedEndpoints
Int -> ReadS ListSharedEndpoints
ReadS [ListSharedEndpoints]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSharedEndpoints]
$creadListPrec :: ReadPrec [ListSharedEndpoints]
readPrec :: ReadPrec ListSharedEndpoints
$creadPrec :: ReadPrec ListSharedEndpoints
readList :: ReadS [ListSharedEndpoints]
$creadList :: ReadS [ListSharedEndpoints]
readsPrec :: Int -> ReadS ListSharedEndpoints
$creadsPrec :: Int -> ReadS ListSharedEndpoints
Prelude.Read, Int -> ListSharedEndpoints -> ShowS
[ListSharedEndpoints] -> ShowS
ListSharedEndpoints -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSharedEndpoints] -> ShowS
$cshowList :: [ListSharedEndpoints] -> ShowS
show :: ListSharedEndpoints -> String
$cshow :: ListSharedEndpoints -> String
showsPrec :: Int -> ListSharedEndpoints -> ShowS
$cshowsPrec :: Int -> ListSharedEndpoints -> ShowS
Prelude.Show, forall x. Rep ListSharedEndpoints x -> ListSharedEndpoints
forall x. ListSharedEndpoints -> Rep ListSharedEndpoints x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListSharedEndpoints x -> ListSharedEndpoints
$cfrom :: forall x. ListSharedEndpoints -> Rep ListSharedEndpoints x
Prelude.Generic)
newListSharedEndpoints ::
Prelude.Text ->
ListSharedEndpoints
newListSharedEndpoints :: Text -> ListSharedEndpoints
newListSharedEndpoints Text
pOutpostId_ =
ListSharedEndpoints'
{ $sel:maxResults:ListSharedEndpoints' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListSharedEndpoints' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:outpostId:ListSharedEndpoints' :: Text
outpostId = Text
pOutpostId_
}
listSharedEndpoints_maxResults :: Lens.Lens' ListSharedEndpoints (Prelude.Maybe Prelude.Natural)
listSharedEndpoints_maxResults :: Lens' ListSharedEndpoints (Maybe Natural)
listSharedEndpoints_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSharedEndpoints' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListSharedEndpoints' :: ListSharedEndpoints -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListSharedEndpoints
s@ListSharedEndpoints' {} Maybe Natural
a -> ListSharedEndpoints
s {$sel:maxResults:ListSharedEndpoints' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListSharedEndpoints)
listSharedEndpoints_nextToken :: Lens.Lens' ListSharedEndpoints (Prelude.Maybe Prelude.Text)
listSharedEndpoints_nextToken :: Lens' ListSharedEndpoints (Maybe Text)
listSharedEndpoints_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSharedEndpoints' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSharedEndpoints' :: ListSharedEndpoints -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSharedEndpoints
s@ListSharedEndpoints' {} Maybe Text
a -> ListSharedEndpoints
s {$sel:nextToken:ListSharedEndpoints' :: Maybe Text
nextToken = Maybe Text
a} :: ListSharedEndpoints)
listSharedEndpoints_outpostId :: Lens.Lens' ListSharedEndpoints Prelude.Text
listSharedEndpoints_outpostId :: Lens' ListSharedEndpoints Text
listSharedEndpoints_outpostId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSharedEndpoints' {Text
outpostId :: Text
$sel:outpostId:ListSharedEndpoints' :: ListSharedEndpoints -> Text
outpostId} -> Text
outpostId) (\s :: ListSharedEndpoints
s@ListSharedEndpoints' {} Text
a -> ListSharedEndpoints
s {$sel:outpostId:ListSharedEndpoints' :: Text
outpostId = Text
a} :: ListSharedEndpoints)
instance Core.AWSPager ListSharedEndpoints where
page :: ListSharedEndpoints
-> AWSResponse ListSharedEndpoints -> Maybe ListSharedEndpoints
page ListSharedEndpoints
rq AWSResponse ListSharedEndpoints
rs
| forall a. AWSTruncated a => a -> Bool
Core.stop
( AWSResponse ListSharedEndpoints
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListSharedEndpointsResponse (Maybe Text)
listSharedEndpointsResponse_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 ListSharedEndpoints
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListSharedEndpointsResponse (Maybe [Endpoint])
listSharedEndpointsResponse_endpoints
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.$ ListSharedEndpoints
rq
forall a b. a -> (a -> b) -> b
Prelude.& Lens' ListSharedEndpoints (Maybe Text)
listSharedEndpoints_nextToken
forall s t a b. ASetter s t a b -> b -> s -> t
Lens..~ AWSResponse ListSharedEndpoints
rs
forall s a. s -> Getting (First a) s a -> Maybe a
Lens.^? Lens' ListSharedEndpointsResponse (Maybe Text)
listSharedEndpointsResponse_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 ListSharedEndpoints where
type
AWSResponse ListSharedEndpoints =
ListSharedEndpointsResponse
request :: (Service -> Service)
-> ListSharedEndpoints -> Request ListSharedEndpoints
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 ListSharedEndpoints
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListSharedEndpoints)))
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 [Endpoint]
-> Maybe Text -> Int -> ListSharedEndpointsResponse
ListSharedEndpointsResponse'
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
"Endpoints" 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 ListSharedEndpoints where
hashWithSalt :: Int -> ListSharedEndpoints -> Int
hashWithSalt Int
_salt ListSharedEndpoints' {Maybe Natural
Maybe Text
Text
outpostId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:outpostId:ListSharedEndpoints' :: ListSharedEndpoints -> Text
$sel:nextToken:ListSharedEndpoints' :: ListSharedEndpoints -> Maybe Text
$sel:maxResults:ListSharedEndpoints' :: ListSharedEndpoints -> 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
outpostId
instance Prelude.NFData ListSharedEndpoints where
rnf :: ListSharedEndpoints -> ()
rnf ListSharedEndpoints' {Maybe Natural
Maybe Text
Text
outpostId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:outpostId:ListSharedEndpoints' :: ListSharedEndpoints -> Text
$sel:nextToken:ListSharedEndpoints' :: ListSharedEndpoints -> Maybe Text
$sel:maxResults:ListSharedEndpoints' :: ListSharedEndpoints -> 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
outpostId
instance Data.ToHeaders ListSharedEndpoints where
toHeaders :: ListSharedEndpoints -> 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 ListSharedEndpoints where
toPath :: ListSharedEndpoints -> ByteString
toPath =
forall a b. a -> b -> a
Prelude.const ByteString
"/S3Outposts/ListSharedEndpoints"
instance Data.ToQuery ListSharedEndpoints where
toQuery :: ListSharedEndpoints -> QueryString
toQuery ListSharedEndpoints' {Maybe Natural
Maybe Text
Text
outpostId :: Text
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:outpostId:ListSharedEndpoints' :: ListSharedEndpoints -> Text
$sel:nextToken:ListSharedEndpoints' :: ListSharedEndpoints -> Maybe Text
$sel:maxResults:ListSharedEndpoints' :: ListSharedEndpoints -> 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,
ByteString
"outpostId" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: Text
outpostId
]
data ListSharedEndpointsResponse = ListSharedEndpointsResponse'
{
ListSharedEndpointsResponse -> Maybe [Endpoint]
endpoints :: Prelude.Maybe [Endpoint],
ListSharedEndpointsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListSharedEndpointsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListSharedEndpointsResponse -> ListSharedEndpointsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSharedEndpointsResponse -> ListSharedEndpointsResponse -> Bool
$c/= :: ListSharedEndpointsResponse -> ListSharedEndpointsResponse -> Bool
== :: ListSharedEndpointsResponse -> ListSharedEndpointsResponse -> Bool
$c== :: ListSharedEndpointsResponse -> ListSharedEndpointsResponse -> Bool
Prelude.Eq, ReadPrec [ListSharedEndpointsResponse]
ReadPrec ListSharedEndpointsResponse
Int -> ReadS ListSharedEndpointsResponse
ReadS [ListSharedEndpointsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSharedEndpointsResponse]
$creadListPrec :: ReadPrec [ListSharedEndpointsResponse]
readPrec :: ReadPrec ListSharedEndpointsResponse
$creadPrec :: ReadPrec ListSharedEndpointsResponse
readList :: ReadS [ListSharedEndpointsResponse]
$creadList :: ReadS [ListSharedEndpointsResponse]
readsPrec :: Int -> ReadS ListSharedEndpointsResponse
$creadsPrec :: Int -> ReadS ListSharedEndpointsResponse
Prelude.Read, Int -> ListSharedEndpointsResponse -> ShowS
[ListSharedEndpointsResponse] -> ShowS
ListSharedEndpointsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSharedEndpointsResponse] -> ShowS
$cshowList :: [ListSharedEndpointsResponse] -> ShowS
show :: ListSharedEndpointsResponse -> String
$cshow :: ListSharedEndpointsResponse -> String
showsPrec :: Int -> ListSharedEndpointsResponse -> ShowS
$cshowsPrec :: Int -> ListSharedEndpointsResponse -> ShowS
Prelude.Show, forall x.
Rep ListSharedEndpointsResponse x -> ListSharedEndpointsResponse
forall x.
ListSharedEndpointsResponse -> Rep ListSharedEndpointsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListSharedEndpointsResponse x -> ListSharedEndpointsResponse
$cfrom :: forall x.
ListSharedEndpointsResponse -> Rep ListSharedEndpointsResponse x
Prelude.Generic)
newListSharedEndpointsResponse ::
Prelude.Int ->
ListSharedEndpointsResponse
newListSharedEndpointsResponse :: Int -> ListSharedEndpointsResponse
newListSharedEndpointsResponse Int
pHttpStatus_ =
ListSharedEndpointsResponse'
{ $sel:endpoints:ListSharedEndpointsResponse' :: Maybe [Endpoint]
endpoints =
forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListSharedEndpointsResponse' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListSharedEndpointsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listSharedEndpointsResponse_endpoints :: Lens.Lens' ListSharedEndpointsResponse (Prelude.Maybe [Endpoint])
listSharedEndpointsResponse_endpoints :: Lens' ListSharedEndpointsResponse (Maybe [Endpoint])
listSharedEndpointsResponse_endpoints = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSharedEndpointsResponse' {Maybe [Endpoint]
endpoints :: Maybe [Endpoint]
$sel:endpoints:ListSharedEndpointsResponse' :: ListSharedEndpointsResponse -> Maybe [Endpoint]
endpoints} -> Maybe [Endpoint]
endpoints) (\s :: ListSharedEndpointsResponse
s@ListSharedEndpointsResponse' {} Maybe [Endpoint]
a -> ListSharedEndpointsResponse
s {$sel:endpoints:ListSharedEndpointsResponse' :: Maybe [Endpoint]
endpoints = Maybe [Endpoint]
a} :: ListSharedEndpointsResponse) 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
listSharedEndpointsResponse_nextToken :: Lens.Lens' ListSharedEndpointsResponse (Prelude.Maybe Prelude.Text)
listSharedEndpointsResponse_nextToken :: Lens' ListSharedEndpointsResponse (Maybe Text)
listSharedEndpointsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSharedEndpointsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSharedEndpointsResponse' :: ListSharedEndpointsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSharedEndpointsResponse
s@ListSharedEndpointsResponse' {} Maybe Text
a -> ListSharedEndpointsResponse
s {$sel:nextToken:ListSharedEndpointsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListSharedEndpointsResponse)
listSharedEndpointsResponse_httpStatus :: Lens.Lens' ListSharedEndpointsResponse Prelude.Int
listSharedEndpointsResponse_httpStatus :: Lens' ListSharedEndpointsResponse Int
listSharedEndpointsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSharedEndpointsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListSharedEndpointsResponse' :: ListSharedEndpointsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListSharedEndpointsResponse
s@ListSharedEndpointsResponse' {} Int
a -> ListSharedEndpointsResponse
s {$sel:httpStatus:ListSharedEndpointsResponse' :: Int
httpStatus = Int
a} :: ListSharedEndpointsResponse)
instance Prelude.NFData ListSharedEndpointsResponse where
rnf :: ListSharedEndpointsResponse -> ()
rnf ListSharedEndpointsResponse' {Int
Maybe [Endpoint]
Maybe Text
httpStatus :: Int
nextToken :: Maybe Text
endpoints :: Maybe [Endpoint]
$sel:httpStatus:ListSharedEndpointsResponse' :: ListSharedEndpointsResponse -> Int
$sel:nextToken:ListSharedEndpointsResponse' :: ListSharedEndpointsResponse -> Maybe Text
$sel:endpoints:ListSharedEndpointsResponse' :: ListSharedEndpointsResponse -> Maybe [Endpoint]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Endpoint]
endpoints
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