{-# 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.OpenSearchServerless.BatchGetVpcEndpoint
(
BatchGetVpcEndpoint (..),
newBatchGetVpcEndpoint,
batchGetVpcEndpoint_ids,
BatchGetVpcEndpointResponse (..),
newBatchGetVpcEndpointResponse,
batchGetVpcEndpointResponse_vpcEndpointDetails,
batchGetVpcEndpointResponse_vpcEndpointErrorDetails,
batchGetVpcEndpointResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.OpenSearchServerless.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data BatchGetVpcEndpoint = BatchGetVpcEndpoint'
{
BatchGetVpcEndpoint -> NonEmpty Text
ids :: Prelude.NonEmpty Prelude.Text
}
deriving (BatchGetVpcEndpoint -> BatchGetVpcEndpoint -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetVpcEndpoint -> BatchGetVpcEndpoint -> Bool
$c/= :: BatchGetVpcEndpoint -> BatchGetVpcEndpoint -> Bool
== :: BatchGetVpcEndpoint -> BatchGetVpcEndpoint -> Bool
$c== :: BatchGetVpcEndpoint -> BatchGetVpcEndpoint -> Bool
Prelude.Eq, ReadPrec [BatchGetVpcEndpoint]
ReadPrec BatchGetVpcEndpoint
Int -> ReadS BatchGetVpcEndpoint
ReadS [BatchGetVpcEndpoint]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchGetVpcEndpoint]
$creadListPrec :: ReadPrec [BatchGetVpcEndpoint]
readPrec :: ReadPrec BatchGetVpcEndpoint
$creadPrec :: ReadPrec BatchGetVpcEndpoint
readList :: ReadS [BatchGetVpcEndpoint]
$creadList :: ReadS [BatchGetVpcEndpoint]
readsPrec :: Int -> ReadS BatchGetVpcEndpoint
$creadsPrec :: Int -> ReadS BatchGetVpcEndpoint
Prelude.Read, Int -> BatchGetVpcEndpoint -> ShowS
[BatchGetVpcEndpoint] -> ShowS
BatchGetVpcEndpoint -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetVpcEndpoint] -> ShowS
$cshowList :: [BatchGetVpcEndpoint] -> ShowS
show :: BatchGetVpcEndpoint -> String
$cshow :: BatchGetVpcEndpoint -> String
showsPrec :: Int -> BatchGetVpcEndpoint -> ShowS
$cshowsPrec :: Int -> BatchGetVpcEndpoint -> ShowS
Prelude.Show, forall x. Rep BatchGetVpcEndpoint x -> BatchGetVpcEndpoint
forall x. BatchGetVpcEndpoint -> Rep BatchGetVpcEndpoint x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchGetVpcEndpoint x -> BatchGetVpcEndpoint
$cfrom :: forall x. BatchGetVpcEndpoint -> Rep BatchGetVpcEndpoint x
Prelude.Generic)
newBatchGetVpcEndpoint ::
Prelude.NonEmpty Prelude.Text ->
BatchGetVpcEndpoint
newBatchGetVpcEndpoint :: NonEmpty Text -> BatchGetVpcEndpoint
newBatchGetVpcEndpoint NonEmpty Text
pIds_ =
BatchGetVpcEndpoint'
{ $sel:ids:BatchGetVpcEndpoint' :: NonEmpty Text
ids =
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pIds_
}
batchGetVpcEndpoint_ids :: Lens.Lens' BatchGetVpcEndpoint (Prelude.NonEmpty Prelude.Text)
batchGetVpcEndpoint_ids :: Lens' BatchGetVpcEndpoint (NonEmpty Text)
batchGetVpcEndpoint_ids = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetVpcEndpoint' {NonEmpty Text
ids :: NonEmpty Text
$sel:ids:BatchGetVpcEndpoint' :: BatchGetVpcEndpoint -> NonEmpty Text
ids} -> NonEmpty Text
ids) (\s :: BatchGetVpcEndpoint
s@BatchGetVpcEndpoint' {} NonEmpty Text
a -> BatchGetVpcEndpoint
s {$sel:ids:BatchGetVpcEndpoint' :: NonEmpty Text
ids = NonEmpty Text
a} :: BatchGetVpcEndpoint) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.AWSRequest BatchGetVpcEndpoint where
type
AWSResponse BatchGetVpcEndpoint =
BatchGetVpcEndpointResponse
request :: (Service -> Service)
-> BatchGetVpcEndpoint -> Request BatchGetVpcEndpoint
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy BatchGetVpcEndpoint
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse BatchGetVpcEndpoint)))
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 [VpcEndpointDetail]
-> Maybe [VpcEndpointErrorDetail]
-> Int
-> BatchGetVpcEndpointResponse
BatchGetVpcEndpointResponse'
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
"vpcEndpointDetails"
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
"vpcEndpointErrorDetails"
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.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable BatchGetVpcEndpoint where
hashWithSalt :: Int -> BatchGetVpcEndpoint -> Int
hashWithSalt Int
_salt BatchGetVpcEndpoint' {NonEmpty Text
ids :: NonEmpty Text
$sel:ids:BatchGetVpcEndpoint' :: BatchGetVpcEndpoint -> NonEmpty Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty Text
ids
instance Prelude.NFData BatchGetVpcEndpoint where
rnf :: BatchGetVpcEndpoint -> ()
rnf BatchGetVpcEndpoint' {NonEmpty Text
ids :: NonEmpty Text
$sel:ids:BatchGetVpcEndpoint' :: BatchGetVpcEndpoint -> NonEmpty Text
..} = forall a. NFData a => a -> ()
Prelude.rnf NonEmpty Text
ids
instance Data.ToHeaders BatchGetVpcEndpoint where
toHeaders :: BatchGetVpcEndpoint -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"OpenSearchServerless.BatchGetVpcEndpoint" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON BatchGetVpcEndpoint where
toJSON :: BatchGetVpcEndpoint -> Value
toJSON BatchGetVpcEndpoint' {NonEmpty Text
ids :: NonEmpty Text
$sel:ids:BatchGetVpcEndpoint' :: BatchGetVpcEndpoint -> NonEmpty Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"ids" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty Text
ids)]
)
instance Data.ToPath BatchGetVpcEndpoint where
toPath :: BatchGetVpcEndpoint -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery BatchGetVpcEndpoint where
toQuery :: BatchGetVpcEndpoint -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data BatchGetVpcEndpointResponse = BatchGetVpcEndpointResponse'
{
BatchGetVpcEndpointResponse -> Maybe [VpcEndpointDetail]
vpcEndpointDetails :: Prelude.Maybe [VpcEndpointDetail],
BatchGetVpcEndpointResponse -> Maybe [VpcEndpointErrorDetail]
vpcEndpointErrorDetails :: Prelude.Maybe [VpcEndpointErrorDetail],
BatchGetVpcEndpointResponse -> Int
httpStatus :: Prelude.Int
}
deriving (BatchGetVpcEndpointResponse -> BatchGetVpcEndpointResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchGetVpcEndpointResponse -> BatchGetVpcEndpointResponse -> Bool
$c/= :: BatchGetVpcEndpointResponse -> BatchGetVpcEndpointResponse -> Bool
== :: BatchGetVpcEndpointResponse -> BatchGetVpcEndpointResponse -> Bool
$c== :: BatchGetVpcEndpointResponse -> BatchGetVpcEndpointResponse -> Bool
Prelude.Eq, ReadPrec [BatchGetVpcEndpointResponse]
ReadPrec BatchGetVpcEndpointResponse
Int -> ReadS BatchGetVpcEndpointResponse
ReadS [BatchGetVpcEndpointResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchGetVpcEndpointResponse]
$creadListPrec :: ReadPrec [BatchGetVpcEndpointResponse]
readPrec :: ReadPrec BatchGetVpcEndpointResponse
$creadPrec :: ReadPrec BatchGetVpcEndpointResponse
readList :: ReadS [BatchGetVpcEndpointResponse]
$creadList :: ReadS [BatchGetVpcEndpointResponse]
readsPrec :: Int -> ReadS BatchGetVpcEndpointResponse
$creadsPrec :: Int -> ReadS BatchGetVpcEndpointResponse
Prelude.Read, Int -> BatchGetVpcEndpointResponse -> ShowS
[BatchGetVpcEndpointResponse] -> ShowS
BatchGetVpcEndpointResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchGetVpcEndpointResponse] -> ShowS
$cshowList :: [BatchGetVpcEndpointResponse] -> ShowS
show :: BatchGetVpcEndpointResponse -> String
$cshow :: BatchGetVpcEndpointResponse -> String
showsPrec :: Int -> BatchGetVpcEndpointResponse -> ShowS
$cshowsPrec :: Int -> BatchGetVpcEndpointResponse -> ShowS
Prelude.Show, forall x.
Rep BatchGetVpcEndpointResponse x -> BatchGetVpcEndpointResponse
forall x.
BatchGetVpcEndpointResponse -> Rep BatchGetVpcEndpointResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BatchGetVpcEndpointResponse x -> BatchGetVpcEndpointResponse
$cfrom :: forall x.
BatchGetVpcEndpointResponse -> Rep BatchGetVpcEndpointResponse x
Prelude.Generic)
newBatchGetVpcEndpointResponse ::
Prelude.Int ->
BatchGetVpcEndpointResponse
newBatchGetVpcEndpointResponse :: Int -> BatchGetVpcEndpointResponse
newBatchGetVpcEndpointResponse Int
pHttpStatus_ =
BatchGetVpcEndpointResponse'
{ $sel:vpcEndpointDetails:BatchGetVpcEndpointResponse' :: Maybe [VpcEndpointDetail]
vpcEndpointDetails =
forall a. Maybe a
Prelude.Nothing,
$sel:vpcEndpointErrorDetails:BatchGetVpcEndpointResponse' :: Maybe [VpcEndpointErrorDetail]
vpcEndpointErrorDetails = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:BatchGetVpcEndpointResponse' :: Int
httpStatus = Int
pHttpStatus_
}
batchGetVpcEndpointResponse_vpcEndpointDetails :: Lens.Lens' BatchGetVpcEndpointResponse (Prelude.Maybe [VpcEndpointDetail])
batchGetVpcEndpointResponse_vpcEndpointDetails :: Lens' BatchGetVpcEndpointResponse (Maybe [VpcEndpointDetail])
batchGetVpcEndpointResponse_vpcEndpointDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetVpcEndpointResponse' {Maybe [VpcEndpointDetail]
vpcEndpointDetails :: Maybe [VpcEndpointDetail]
$sel:vpcEndpointDetails:BatchGetVpcEndpointResponse' :: BatchGetVpcEndpointResponse -> Maybe [VpcEndpointDetail]
vpcEndpointDetails} -> Maybe [VpcEndpointDetail]
vpcEndpointDetails) (\s :: BatchGetVpcEndpointResponse
s@BatchGetVpcEndpointResponse' {} Maybe [VpcEndpointDetail]
a -> BatchGetVpcEndpointResponse
s {$sel:vpcEndpointDetails:BatchGetVpcEndpointResponse' :: Maybe [VpcEndpointDetail]
vpcEndpointDetails = Maybe [VpcEndpointDetail]
a} :: BatchGetVpcEndpointResponse) 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
batchGetVpcEndpointResponse_vpcEndpointErrorDetails :: Lens.Lens' BatchGetVpcEndpointResponse (Prelude.Maybe [VpcEndpointErrorDetail])
batchGetVpcEndpointResponse_vpcEndpointErrorDetails :: Lens' BatchGetVpcEndpointResponse (Maybe [VpcEndpointErrorDetail])
batchGetVpcEndpointResponse_vpcEndpointErrorDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetVpcEndpointResponse' {Maybe [VpcEndpointErrorDetail]
vpcEndpointErrorDetails :: Maybe [VpcEndpointErrorDetail]
$sel:vpcEndpointErrorDetails:BatchGetVpcEndpointResponse' :: BatchGetVpcEndpointResponse -> Maybe [VpcEndpointErrorDetail]
vpcEndpointErrorDetails} -> Maybe [VpcEndpointErrorDetail]
vpcEndpointErrorDetails) (\s :: BatchGetVpcEndpointResponse
s@BatchGetVpcEndpointResponse' {} Maybe [VpcEndpointErrorDetail]
a -> BatchGetVpcEndpointResponse
s {$sel:vpcEndpointErrorDetails:BatchGetVpcEndpointResponse' :: Maybe [VpcEndpointErrorDetail]
vpcEndpointErrorDetails = Maybe [VpcEndpointErrorDetail]
a} :: BatchGetVpcEndpointResponse) 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
batchGetVpcEndpointResponse_httpStatus :: Lens.Lens' BatchGetVpcEndpointResponse Prelude.Int
batchGetVpcEndpointResponse_httpStatus :: Lens' BatchGetVpcEndpointResponse Int
batchGetVpcEndpointResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchGetVpcEndpointResponse' {Int
httpStatus :: Int
$sel:httpStatus:BatchGetVpcEndpointResponse' :: BatchGetVpcEndpointResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: BatchGetVpcEndpointResponse
s@BatchGetVpcEndpointResponse' {} Int
a -> BatchGetVpcEndpointResponse
s {$sel:httpStatus:BatchGetVpcEndpointResponse' :: Int
httpStatus = Int
a} :: BatchGetVpcEndpointResponse)
instance Prelude.NFData BatchGetVpcEndpointResponse where
rnf :: BatchGetVpcEndpointResponse -> ()
rnf BatchGetVpcEndpointResponse' {Int
Maybe [VpcEndpointErrorDetail]
Maybe [VpcEndpointDetail]
httpStatus :: Int
vpcEndpointErrorDetails :: Maybe [VpcEndpointErrorDetail]
vpcEndpointDetails :: Maybe [VpcEndpointDetail]
$sel:httpStatus:BatchGetVpcEndpointResponse' :: BatchGetVpcEndpointResponse -> Int
$sel:vpcEndpointErrorDetails:BatchGetVpcEndpointResponse' :: BatchGetVpcEndpointResponse -> Maybe [VpcEndpointErrorDetail]
$sel:vpcEndpointDetails:BatchGetVpcEndpointResponse' :: BatchGetVpcEndpointResponse -> Maybe [VpcEndpointDetail]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [VpcEndpointDetail]
vpcEndpointDetails
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe [VpcEndpointErrorDetail]
vpcEndpointErrorDetails
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus