{-# 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.ListSecurityConfigs
(
ListSecurityConfigs (..),
newListSecurityConfigs,
listSecurityConfigs_maxResults,
listSecurityConfigs_nextToken,
listSecurityConfigs_type,
ListSecurityConfigsResponse (..),
newListSecurityConfigsResponse,
listSecurityConfigsResponse_nextToken,
listSecurityConfigsResponse_securityConfigSummaries,
listSecurityConfigsResponse_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 ListSecurityConfigs = ListSecurityConfigs'
{
ListSecurityConfigs -> Maybe Natural
maxResults :: Prelude.Maybe Prelude.Natural,
ListSecurityConfigs -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListSecurityConfigs -> SecurityConfigType
type' :: SecurityConfigType
}
deriving (ListSecurityConfigs -> ListSecurityConfigs -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSecurityConfigs -> ListSecurityConfigs -> Bool
$c/= :: ListSecurityConfigs -> ListSecurityConfigs -> Bool
== :: ListSecurityConfigs -> ListSecurityConfigs -> Bool
$c== :: ListSecurityConfigs -> ListSecurityConfigs -> Bool
Prelude.Eq, ReadPrec [ListSecurityConfigs]
ReadPrec ListSecurityConfigs
Int -> ReadS ListSecurityConfigs
ReadS [ListSecurityConfigs]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSecurityConfigs]
$creadListPrec :: ReadPrec [ListSecurityConfigs]
readPrec :: ReadPrec ListSecurityConfigs
$creadPrec :: ReadPrec ListSecurityConfigs
readList :: ReadS [ListSecurityConfigs]
$creadList :: ReadS [ListSecurityConfigs]
readsPrec :: Int -> ReadS ListSecurityConfigs
$creadsPrec :: Int -> ReadS ListSecurityConfigs
Prelude.Read, Int -> ListSecurityConfigs -> ShowS
[ListSecurityConfigs] -> ShowS
ListSecurityConfigs -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSecurityConfigs] -> ShowS
$cshowList :: [ListSecurityConfigs] -> ShowS
show :: ListSecurityConfigs -> String
$cshow :: ListSecurityConfigs -> String
showsPrec :: Int -> ListSecurityConfigs -> ShowS
$cshowsPrec :: Int -> ListSecurityConfigs -> ShowS
Prelude.Show, forall x. Rep ListSecurityConfigs x -> ListSecurityConfigs
forall x. ListSecurityConfigs -> Rep ListSecurityConfigs x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListSecurityConfigs x -> ListSecurityConfigs
$cfrom :: forall x. ListSecurityConfigs -> Rep ListSecurityConfigs x
Prelude.Generic)
newListSecurityConfigs ::
SecurityConfigType ->
ListSecurityConfigs
newListSecurityConfigs :: SecurityConfigType -> ListSecurityConfigs
newListSecurityConfigs SecurityConfigType
pType_ =
ListSecurityConfigs'
{ $sel:maxResults:ListSecurityConfigs' :: Maybe Natural
maxResults = forall a. Maybe a
Prelude.Nothing,
$sel:nextToken:ListSecurityConfigs' :: Maybe Text
nextToken = forall a. Maybe a
Prelude.Nothing,
$sel:type':ListSecurityConfigs' :: SecurityConfigType
type' = SecurityConfigType
pType_
}
listSecurityConfigs_maxResults :: Lens.Lens' ListSecurityConfigs (Prelude.Maybe Prelude.Natural)
listSecurityConfigs_maxResults :: Lens' ListSecurityConfigs (Maybe Natural)
listSecurityConfigs_maxResults = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSecurityConfigs' {Maybe Natural
maxResults :: Maybe Natural
$sel:maxResults:ListSecurityConfigs' :: ListSecurityConfigs -> Maybe Natural
maxResults} -> Maybe Natural
maxResults) (\s :: ListSecurityConfigs
s@ListSecurityConfigs' {} Maybe Natural
a -> ListSecurityConfigs
s {$sel:maxResults:ListSecurityConfigs' :: Maybe Natural
maxResults = Maybe Natural
a} :: ListSecurityConfigs)
listSecurityConfigs_nextToken :: Lens.Lens' ListSecurityConfigs (Prelude.Maybe Prelude.Text)
listSecurityConfigs_nextToken :: Lens' ListSecurityConfigs (Maybe Text)
listSecurityConfigs_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSecurityConfigs' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSecurityConfigs' :: ListSecurityConfigs -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSecurityConfigs
s@ListSecurityConfigs' {} Maybe Text
a -> ListSecurityConfigs
s {$sel:nextToken:ListSecurityConfigs' :: Maybe Text
nextToken = Maybe Text
a} :: ListSecurityConfigs)
listSecurityConfigs_type :: Lens.Lens' ListSecurityConfigs SecurityConfigType
listSecurityConfigs_type :: Lens' ListSecurityConfigs SecurityConfigType
listSecurityConfigs_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSecurityConfigs' {SecurityConfigType
type' :: SecurityConfigType
$sel:type':ListSecurityConfigs' :: ListSecurityConfigs -> SecurityConfigType
type'} -> SecurityConfigType
type') (\s :: ListSecurityConfigs
s@ListSecurityConfigs' {} SecurityConfigType
a -> ListSecurityConfigs
s {$sel:type':ListSecurityConfigs' :: SecurityConfigType
type' = SecurityConfigType
a} :: ListSecurityConfigs)
instance Core.AWSRequest ListSecurityConfigs where
type
AWSResponse ListSecurityConfigs =
ListSecurityConfigsResponse
request :: (Service -> Service)
-> ListSecurityConfigs -> Request ListSecurityConfigs
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 ListSecurityConfigs
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse ListSecurityConfigs)))
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 Text
-> Maybe [SecurityConfigSummary]
-> Int
-> ListSecurityConfigsResponse
ListSecurityConfigsResponse'
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
"nextToken")
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
"securityConfigSummaries"
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 ListSecurityConfigs where
hashWithSalt :: Int -> ListSecurityConfigs -> Int
hashWithSalt Int
_salt ListSecurityConfigs' {Maybe Natural
Maybe Text
SecurityConfigType
type' :: SecurityConfigType
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:type':ListSecurityConfigs' :: ListSecurityConfigs -> SecurityConfigType
$sel:nextToken:ListSecurityConfigs' :: ListSecurityConfigs -> Maybe Text
$sel:maxResults:ListSecurityConfigs' :: ListSecurityConfigs -> 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` SecurityConfigType
type'
instance Prelude.NFData ListSecurityConfigs where
rnf :: ListSecurityConfigs -> ()
rnf ListSecurityConfigs' {Maybe Natural
Maybe Text
SecurityConfigType
type' :: SecurityConfigType
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:type':ListSecurityConfigs' :: ListSecurityConfigs -> SecurityConfigType
$sel:nextToken:ListSecurityConfigs' :: ListSecurityConfigs -> Maybe Text
$sel:maxResults:ListSecurityConfigs' :: ListSecurityConfigs -> 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 SecurityConfigType
type'
instance Data.ToHeaders ListSecurityConfigs where
toHeaders :: ListSecurityConfigs -> 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.ListSecurityConfigs" ::
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 ListSecurityConfigs where
toJSON :: ListSecurityConfigs -> Value
toJSON ListSecurityConfigs' {Maybe Natural
Maybe Text
SecurityConfigType
type' :: SecurityConfigType
nextToken :: Maybe Text
maxResults :: Maybe Natural
$sel:type':ListSecurityConfigs' :: ListSecurityConfigs -> SecurityConfigType
$sel:nextToken:ListSecurityConfigs' :: ListSecurityConfigs -> Maybe Text
$sel:maxResults:ListSecurityConfigs' :: ListSecurityConfigs -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"maxResults" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxResults,
(Key
"nextToken" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
nextToken,
forall a. a -> Maybe a
Prelude.Just (Key
"type" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= SecurityConfigType
type')
]
)
instance Data.ToPath ListSecurityConfigs where
toPath :: ListSecurityConfigs -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery ListSecurityConfigs where
toQuery :: ListSecurityConfigs -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data ListSecurityConfigsResponse = ListSecurityConfigsResponse'
{
ListSecurityConfigsResponse -> Maybe Text
nextToken :: Prelude.Maybe Prelude.Text,
ListSecurityConfigsResponse -> Maybe [SecurityConfigSummary]
securityConfigSummaries :: Prelude.Maybe [SecurityConfigSummary],
ListSecurityConfigsResponse -> Int
httpStatus :: Prelude.Int
}
deriving (ListSecurityConfigsResponse -> ListSecurityConfigsResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListSecurityConfigsResponse -> ListSecurityConfigsResponse -> Bool
$c/= :: ListSecurityConfigsResponse -> ListSecurityConfigsResponse -> Bool
== :: ListSecurityConfigsResponse -> ListSecurityConfigsResponse -> Bool
$c== :: ListSecurityConfigsResponse -> ListSecurityConfigsResponse -> Bool
Prelude.Eq, ReadPrec [ListSecurityConfigsResponse]
ReadPrec ListSecurityConfigsResponse
Int -> ReadS ListSecurityConfigsResponse
ReadS [ListSecurityConfigsResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListSecurityConfigsResponse]
$creadListPrec :: ReadPrec [ListSecurityConfigsResponse]
readPrec :: ReadPrec ListSecurityConfigsResponse
$creadPrec :: ReadPrec ListSecurityConfigsResponse
readList :: ReadS [ListSecurityConfigsResponse]
$creadList :: ReadS [ListSecurityConfigsResponse]
readsPrec :: Int -> ReadS ListSecurityConfigsResponse
$creadsPrec :: Int -> ReadS ListSecurityConfigsResponse
Prelude.Read, Int -> ListSecurityConfigsResponse -> ShowS
[ListSecurityConfigsResponse] -> ShowS
ListSecurityConfigsResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListSecurityConfigsResponse] -> ShowS
$cshowList :: [ListSecurityConfigsResponse] -> ShowS
show :: ListSecurityConfigsResponse -> String
$cshow :: ListSecurityConfigsResponse -> String
showsPrec :: Int -> ListSecurityConfigsResponse -> ShowS
$cshowsPrec :: Int -> ListSecurityConfigsResponse -> ShowS
Prelude.Show, forall x.
Rep ListSecurityConfigsResponse x -> ListSecurityConfigsResponse
forall x.
ListSecurityConfigsResponse -> Rep ListSecurityConfigsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ListSecurityConfigsResponse x -> ListSecurityConfigsResponse
$cfrom :: forall x.
ListSecurityConfigsResponse -> Rep ListSecurityConfigsResponse x
Prelude.Generic)
newListSecurityConfigsResponse ::
Prelude.Int ->
ListSecurityConfigsResponse
newListSecurityConfigsResponse :: Int -> ListSecurityConfigsResponse
newListSecurityConfigsResponse Int
pHttpStatus_ =
ListSecurityConfigsResponse'
{ $sel:nextToken:ListSecurityConfigsResponse' :: Maybe Text
nextToken =
forall a. Maybe a
Prelude.Nothing,
$sel:securityConfigSummaries:ListSecurityConfigsResponse' :: Maybe [SecurityConfigSummary]
securityConfigSummaries = forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:ListSecurityConfigsResponse' :: Int
httpStatus = Int
pHttpStatus_
}
listSecurityConfigsResponse_nextToken :: Lens.Lens' ListSecurityConfigsResponse (Prelude.Maybe Prelude.Text)
listSecurityConfigsResponse_nextToken :: Lens' ListSecurityConfigsResponse (Maybe Text)
listSecurityConfigsResponse_nextToken = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSecurityConfigsResponse' {Maybe Text
nextToken :: Maybe Text
$sel:nextToken:ListSecurityConfigsResponse' :: ListSecurityConfigsResponse -> Maybe Text
nextToken} -> Maybe Text
nextToken) (\s :: ListSecurityConfigsResponse
s@ListSecurityConfigsResponse' {} Maybe Text
a -> ListSecurityConfigsResponse
s {$sel:nextToken:ListSecurityConfigsResponse' :: Maybe Text
nextToken = Maybe Text
a} :: ListSecurityConfigsResponse)
listSecurityConfigsResponse_securityConfigSummaries :: Lens.Lens' ListSecurityConfigsResponse (Prelude.Maybe [SecurityConfigSummary])
listSecurityConfigsResponse_securityConfigSummaries :: Lens' ListSecurityConfigsResponse (Maybe [SecurityConfigSummary])
listSecurityConfigsResponse_securityConfigSummaries = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSecurityConfigsResponse' {Maybe [SecurityConfigSummary]
securityConfigSummaries :: Maybe [SecurityConfigSummary]
$sel:securityConfigSummaries:ListSecurityConfigsResponse' :: ListSecurityConfigsResponse -> Maybe [SecurityConfigSummary]
securityConfigSummaries} -> Maybe [SecurityConfigSummary]
securityConfigSummaries) (\s :: ListSecurityConfigsResponse
s@ListSecurityConfigsResponse' {} Maybe [SecurityConfigSummary]
a -> ListSecurityConfigsResponse
s {$sel:securityConfigSummaries:ListSecurityConfigsResponse' :: Maybe [SecurityConfigSummary]
securityConfigSummaries = Maybe [SecurityConfigSummary]
a} :: ListSecurityConfigsResponse) 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
listSecurityConfigsResponse_httpStatus :: Lens.Lens' ListSecurityConfigsResponse Prelude.Int
listSecurityConfigsResponse_httpStatus :: Lens' ListSecurityConfigsResponse Int
listSecurityConfigsResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListSecurityConfigsResponse' {Int
httpStatus :: Int
$sel:httpStatus:ListSecurityConfigsResponse' :: ListSecurityConfigsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: ListSecurityConfigsResponse
s@ListSecurityConfigsResponse' {} Int
a -> ListSecurityConfigsResponse
s {$sel:httpStatus:ListSecurityConfigsResponse' :: Int
httpStatus = Int
a} :: ListSecurityConfigsResponse)
instance Prelude.NFData ListSecurityConfigsResponse where
rnf :: ListSecurityConfigsResponse -> ()
rnf ListSecurityConfigsResponse' {Int
Maybe [SecurityConfigSummary]
Maybe Text
httpStatus :: Int
securityConfigSummaries :: Maybe [SecurityConfigSummary]
nextToken :: Maybe Text
$sel:httpStatus:ListSecurityConfigsResponse' :: ListSecurityConfigsResponse -> Int
$sel:securityConfigSummaries:ListSecurityConfigsResponse' :: ListSecurityConfigsResponse -> Maybe [SecurityConfigSummary]
$sel:nextToken:ListSecurityConfigsResponse' :: ListSecurityConfigsResponse -> Maybe Text
..} =
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 Maybe [SecurityConfigSummary]
securityConfigSummaries
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus