{-# 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.ResourceExplorer2.Types.Index 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 Amazonka.ResourceExplorer2.Types.IndexType
data Index = Index'
{
Index -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
Index -> Maybe Text
region :: Prelude.Maybe Prelude.Text,
Index -> Maybe IndexType
type' :: Prelude.Maybe IndexType
}
deriving (Index -> Index -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Index -> Index -> Bool
$c/= :: Index -> Index -> Bool
== :: Index -> Index -> Bool
$c== :: Index -> Index -> Bool
Prelude.Eq, ReadPrec [Index]
ReadPrec Index
Int -> ReadS Index
ReadS [Index]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Index]
$creadListPrec :: ReadPrec [Index]
readPrec :: ReadPrec Index
$creadPrec :: ReadPrec Index
readList :: ReadS [Index]
$creadList :: ReadS [Index]
readsPrec :: Int -> ReadS Index
$creadsPrec :: Int -> ReadS Index
Prelude.Read, Int -> Index -> ShowS
[Index] -> ShowS
Index -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Index] -> ShowS
$cshowList :: [Index] -> ShowS
show :: Index -> String
$cshow :: Index -> String
showsPrec :: Int -> Index -> ShowS
$cshowsPrec :: Int -> Index -> ShowS
Prelude.Show, forall x. Rep Index x -> Index
forall x. Index -> Rep Index x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Index x -> Index
$cfrom :: forall x. Index -> Rep Index x
Prelude.Generic)
newIndex ::
Index
newIndex :: Index
newIndex =
Index'
{ $sel:arn:Index' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
$sel:region:Index' :: Maybe Text
region = forall a. Maybe a
Prelude.Nothing,
$sel:type':Index' :: Maybe IndexType
type' = forall a. Maybe a
Prelude.Nothing
}
index_arn :: Lens.Lens' Index (Prelude.Maybe Prelude.Text)
index_arn :: Lens' Index (Maybe Text)
index_arn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Index' {Maybe Text
arn :: Maybe Text
$sel:arn:Index' :: Index -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Index
s@Index' {} Maybe Text
a -> Index
s {$sel:arn:Index' :: Maybe Text
arn = Maybe Text
a} :: Index)
index_region :: Lens.Lens' Index (Prelude.Maybe Prelude.Text)
index_region :: Lens' Index (Maybe Text)
index_region = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Index' {Maybe Text
region :: Maybe Text
$sel:region:Index' :: Index -> Maybe Text
region} -> Maybe Text
region) (\s :: Index
s@Index' {} Maybe Text
a -> Index
s {$sel:region:Index' :: Maybe Text
region = Maybe Text
a} :: Index)
index_type :: Lens.Lens' Index (Prelude.Maybe IndexType)
index_type :: Lens' Index (Maybe IndexType)
index_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Index' {Maybe IndexType
type' :: Maybe IndexType
$sel:type':Index' :: Index -> Maybe IndexType
type'} -> Maybe IndexType
type') (\s :: Index
s@Index' {} Maybe IndexType
a -> Index
s {$sel:type':Index' :: Maybe IndexType
type' = Maybe IndexType
a} :: Index)
instance Data.FromJSON Index where
parseJSON :: Value -> Parser Index
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Index"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe IndexType -> Index
Index'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Arn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Region")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Type")
)
instance Prelude.Hashable Index where
hashWithSalt :: Int -> Index -> Int
hashWithSalt Int
_salt Index' {Maybe Text
Maybe IndexType
type' :: Maybe IndexType
region :: Maybe Text
arn :: Maybe Text
$sel:type':Index' :: Index -> Maybe IndexType
$sel:region:Index' :: Index -> Maybe Text
$sel:arn:Index' :: Index -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
region
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe IndexType
type'
instance Prelude.NFData Index where
rnf :: Index -> ()
rnf Index' {Maybe Text
Maybe IndexType
type' :: Maybe IndexType
region :: Maybe Text
arn :: Maybe Text
$sel:type':Index' :: Index -> Maybe IndexType
$sel:region:Index' :: Index -> Maybe Text
$sel:arn:Index' :: Index -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
region
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe IndexType
type'