{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.IoT.Types.OpenSearchAction 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
data OpenSearchAction = OpenSearchAction'
{
OpenSearchAction -> Text
roleArn :: Prelude.Text,
OpenSearchAction -> Text
endpoint :: Prelude.Text,
OpenSearchAction -> Text
index :: Prelude.Text,
OpenSearchAction -> Text
type' :: Prelude.Text,
OpenSearchAction -> Text
id :: Prelude.Text
}
deriving (OpenSearchAction -> OpenSearchAction -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OpenSearchAction -> OpenSearchAction -> Bool
$c/= :: OpenSearchAction -> OpenSearchAction -> Bool
== :: OpenSearchAction -> OpenSearchAction -> Bool
$c== :: OpenSearchAction -> OpenSearchAction -> Bool
Prelude.Eq, ReadPrec [OpenSearchAction]
ReadPrec OpenSearchAction
Int -> ReadS OpenSearchAction
ReadS [OpenSearchAction]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OpenSearchAction]
$creadListPrec :: ReadPrec [OpenSearchAction]
readPrec :: ReadPrec OpenSearchAction
$creadPrec :: ReadPrec OpenSearchAction
readList :: ReadS [OpenSearchAction]
$creadList :: ReadS [OpenSearchAction]
readsPrec :: Int -> ReadS OpenSearchAction
$creadsPrec :: Int -> ReadS OpenSearchAction
Prelude.Read, Int -> OpenSearchAction -> ShowS
[OpenSearchAction] -> ShowS
OpenSearchAction -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OpenSearchAction] -> ShowS
$cshowList :: [OpenSearchAction] -> ShowS
show :: OpenSearchAction -> String
$cshow :: OpenSearchAction -> String
showsPrec :: Int -> OpenSearchAction -> ShowS
$cshowsPrec :: Int -> OpenSearchAction -> ShowS
Prelude.Show, forall x. Rep OpenSearchAction x -> OpenSearchAction
forall x. OpenSearchAction -> Rep OpenSearchAction x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OpenSearchAction x -> OpenSearchAction
$cfrom :: forall x. OpenSearchAction -> Rep OpenSearchAction x
Prelude.Generic)
newOpenSearchAction ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
OpenSearchAction
newOpenSearchAction :: Text -> Text -> Text -> Text -> Text -> OpenSearchAction
newOpenSearchAction
Text
pRoleArn_
Text
pEndpoint_
Text
pIndex_
Text
pType_
Text
pId_ =
OpenSearchAction'
{ $sel:roleArn:OpenSearchAction' :: Text
roleArn = Text
pRoleArn_,
$sel:endpoint:OpenSearchAction' :: Text
endpoint = Text
pEndpoint_,
$sel:index:OpenSearchAction' :: Text
index = Text
pIndex_,
$sel:type':OpenSearchAction' :: Text
type' = Text
pType_,
$sel:id:OpenSearchAction' :: Text
id = Text
pId_
}
openSearchAction_roleArn :: Lens.Lens' OpenSearchAction Prelude.Text
openSearchAction_roleArn :: Lens' OpenSearchAction Text
openSearchAction_roleArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OpenSearchAction' {Text
roleArn :: Text
$sel:roleArn:OpenSearchAction' :: OpenSearchAction -> Text
roleArn} -> Text
roleArn) (\s :: OpenSearchAction
s@OpenSearchAction' {} Text
a -> OpenSearchAction
s {$sel:roleArn:OpenSearchAction' :: Text
roleArn = Text
a} :: OpenSearchAction)
openSearchAction_endpoint :: Lens.Lens' OpenSearchAction Prelude.Text
openSearchAction_endpoint :: Lens' OpenSearchAction Text
openSearchAction_endpoint = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OpenSearchAction' {Text
endpoint :: Text
$sel:endpoint:OpenSearchAction' :: OpenSearchAction -> Text
endpoint} -> Text
endpoint) (\s :: OpenSearchAction
s@OpenSearchAction' {} Text
a -> OpenSearchAction
s {$sel:endpoint:OpenSearchAction' :: Text
endpoint = Text
a} :: OpenSearchAction)
openSearchAction_index :: Lens.Lens' OpenSearchAction Prelude.Text
openSearchAction_index :: Lens' OpenSearchAction Text
openSearchAction_index = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OpenSearchAction' {Text
index :: Text
$sel:index:OpenSearchAction' :: OpenSearchAction -> Text
index} -> Text
index) (\s :: OpenSearchAction
s@OpenSearchAction' {} Text
a -> OpenSearchAction
s {$sel:index:OpenSearchAction' :: Text
index = Text
a} :: OpenSearchAction)
openSearchAction_type :: Lens.Lens' OpenSearchAction Prelude.Text
openSearchAction_type :: Lens' OpenSearchAction Text
openSearchAction_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OpenSearchAction' {Text
type' :: Text
$sel:type':OpenSearchAction' :: OpenSearchAction -> Text
type'} -> Text
type') (\s :: OpenSearchAction
s@OpenSearchAction' {} Text
a -> OpenSearchAction
s {$sel:type':OpenSearchAction' :: Text
type' = Text
a} :: OpenSearchAction)
openSearchAction_id :: Lens.Lens' OpenSearchAction Prelude.Text
openSearchAction_id :: Lens' OpenSearchAction Text
openSearchAction_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OpenSearchAction' {Text
id :: Text
$sel:id:OpenSearchAction' :: OpenSearchAction -> Text
id} -> Text
id) (\s :: OpenSearchAction
s@OpenSearchAction' {} Text
a -> OpenSearchAction
s {$sel:id:OpenSearchAction' :: Text
id = Text
a} :: OpenSearchAction)
instance Data.FromJSON OpenSearchAction where
parseJSON :: Value -> Parser OpenSearchAction
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"OpenSearchAction"
( \Object
x ->
Text -> Text -> Text -> Text -> Text -> OpenSearchAction
OpenSearchAction'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"roleArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"endpoint")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"index")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"type")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"id")
)
instance Prelude.Hashable OpenSearchAction where
hashWithSalt :: Int -> OpenSearchAction -> Int
hashWithSalt Int
_salt OpenSearchAction' {Text
id :: Text
type' :: Text
index :: Text
endpoint :: Text
roleArn :: Text
$sel:id:OpenSearchAction' :: OpenSearchAction -> Text
$sel:type':OpenSearchAction' :: OpenSearchAction -> Text
$sel:index:OpenSearchAction' :: OpenSearchAction -> Text
$sel:endpoint:OpenSearchAction' :: OpenSearchAction -> Text
$sel:roleArn:OpenSearchAction' :: OpenSearchAction -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
roleArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
endpoint
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
index
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
type'
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
instance Prelude.NFData OpenSearchAction where
rnf :: OpenSearchAction -> ()
rnf OpenSearchAction' {Text
id :: Text
type' :: Text
index :: Text
endpoint :: Text
roleArn :: Text
$sel:id:OpenSearchAction' :: OpenSearchAction -> Text
$sel:type':OpenSearchAction' :: OpenSearchAction -> Text
$sel:index:OpenSearchAction' :: OpenSearchAction -> Text
$sel:endpoint:OpenSearchAction' :: OpenSearchAction -> Text
$sel:roleArn:OpenSearchAction' :: OpenSearchAction -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
roleArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
endpoint
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
index
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
type'
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
id
instance Data.ToJSON OpenSearchAction where
toJSON :: OpenSearchAction -> Value
toJSON OpenSearchAction' {Text
id :: Text
type' :: Text
index :: Text
endpoint :: Text
roleArn :: Text
$sel:id:OpenSearchAction' :: OpenSearchAction -> Text
$sel:type':OpenSearchAction' :: OpenSearchAction -> Text
$sel:index:OpenSearchAction' :: OpenSearchAction -> Text
$sel:endpoint:OpenSearchAction' :: OpenSearchAction -> Text
$sel:roleArn:OpenSearchAction' :: OpenSearchAction -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"roleArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
roleArn),
forall a. a -> Maybe a
Prelude.Just (Key
"endpoint" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
endpoint),
forall a. a -> Maybe a
Prelude.Just (Key
"index" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
index),
forall a. a -> Maybe a
Prelude.Just (Key
"type" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
type'),
forall a. a -> Maybe a
Prelude.Just (Key
"id" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
id)
]
)