{-# 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.Kendra.Types.DataSourceVpcConfiguration 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 DataSourceVpcConfiguration = DataSourceVpcConfiguration'
{
DataSourceVpcConfiguration -> NonEmpty Text
subnetIds :: Prelude.NonEmpty Prelude.Text,
DataSourceVpcConfiguration -> NonEmpty Text
securityGroupIds :: Prelude.NonEmpty Prelude.Text
}
deriving (DataSourceVpcConfiguration -> DataSourceVpcConfiguration -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DataSourceVpcConfiguration -> DataSourceVpcConfiguration -> Bool
$c/= :: DataSourceVpcConfiguration -> DataSourceVpcConfiguration -> Bool
== :: DataSourceVpcConfiguration -> DataSourceVpcConfiguration -> Bool
$c== :: DataSourceVpcConfiguration -> DataSourceVpcConfiguration -> Bool
Prelude.Eq, ReadPrec [DataSourceVpcConfiguration]
ReadPrec DataSourceVpcConfiguration
Int -> ReadS DataSourceVpcConfiguration
ReadS [DataSourceVpcConfiguration]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DataSourceVpcConfiguration]
$creadListPrec :: ReadPrec [DataSourceVpcConfiguration]
readPrec :: ReadPrec DataSourceVpcConfiguration
$creadPrec :: ReadPrec DataSourceVpcConfiguration
readList :: ReadS [DataSourceVpcConfiguration]
$creadList :: ReadS [DataSourceVpcConfiguration]
readsPrec :: Int -> ReadS DataSourceVpcConfiguration
$creadsPrec :: Int -> ReadS DataSourceVpcConfiguration
Prelude.Read, Int -> DataSourceVpcConfiguration -> ShowS
[DataSourceVpcConfiguration] -> ShowS
DataSourceVpcConfiguration -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DataSourceVpcConfiguration] -> ShowS
$cshowList :: [DataSourceVpcConfiguration] -> ShowS
show :: DataSourceVpcConfiguration -> String
$cshow :: DataSourceVpcConfiguration -> String
showsPrec :: Int -> DataSourceVpcConfiguration -> ShowS
$cshowsPrec :: Int -> DataSourceVpcConfiguration -> ShowS
Prelude.Show, forall x.
Rep DataSourceVpcConfiguration x -> DataSourceVpcConfiguration
forall x.
DataSourceVpcConfiguration -> Rep DataSourceVpcConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DataSourceVpcConfiguration x -> DataSourceVpcConfiguration
$cfrom :: forall x.
DataSourceVpcConfiguration -> Rep DataSourceVpcConfiguration x
Prelude.Generic)
newDataSourceVpcConfiguration ::
Prelude.NonEmpty Prelude.Text ->
Prelude.NonEmpty Prelude.Text ->
DataSourceVpcConfiguration
newDataSourceVpcConfiguration :: NonEmpty Text -> NonEmpty Text -> DataSourceVpcConfiguration
newDataSourceVpcConfiguration
NonEmpty Text
pSubnetIds_
NonEmpty Text
pSecurityGroupIds_ =
DataSourceVpcConfiguration'
{ $sel:subnetIds:DataSourceVpcConfiguration' :: NonEmpty Text
subnetIds =
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
pSubnetIds_,
$sel:securityGroupIds:DataSourceVpcConfiguration' :: NonEmpty Text
securityGroupIds =
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
pSecurityGroupIds_
}
dataSourceVpcConfiguration_subnetIds :: Lens.Lens' DataSourceVpcConfiguration (Prelude.NonEmpty Prelude.Text)
dataSourceVpcConfiguration_subnetIds :: Lens' DataSourceVpcConfiguration (NonEmpty Text)
dataSourceVpcConfiguration_subnetIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataSourceVpcConfiguration' {NonEmpty Text
subnetIds :: NonEmpty Text
$sel:subnetIds:DataSourceVpcConfiguration' :: DataSourceVpcConfiguration -> NonEmpty Text
subnetIds} -> NonEmpty Text
subnetIds) (\s :: DataSourceVpcConfiguration
s@DataSourceVpcConfiguration' {} NonEmpty Text
a -> DataSourceVpcConfiguration
s {$sel:subnetIds:DataSourceVpcConfiguration' :: NonEmpty Text
subnetIds = NonEmpty Text
a} :: DataSourceVpcConfiguration) 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
dataSourceVpcConfiguration_securityGroupIds :: Lens.Lens' DataSourceVpcConfiguration (Prelude.NonEmpty Prelude.Text)
dataSourceVpcConfiguration_securityGroupIds :: Lens' DataSourceVpcConfiguration (NonEmpty Text)
dataSourceVpcConfiguration_securityGroupIds = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DataSourceVpcConfiguration' {NonEmpty Text
securityGroupIds :: NonEmpty Text
$sel:securityGroupIds:DataSourceVpcConfiguration' :: DataSourceVpcConfiguration -> NonEmpty Text
securityGroupIds} -> NonEmpty Text
securityGroupIds) (\s :: DataSourceVpcConfiguration
s@DataSourceVpcConfiguration' {} NonEmpty Text
a -> DataSourceVpcConfiguration
s {$sel:securityGroupIds:DataSourceVpcConfiguration' :: NonEmpty Text
securityGroupIds = NonEmpty Text
a} :: DataSourceVpcConfiguration) 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 Data.FromJSON DataSourceVpcConfiguration where
parseJSON :: Value -> Parser DataSourceVpcConfiguration
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"DataSourceVpcConfiguration"
( \Object
x ->
NonEmpty Text -> NonEmpty Text -> DataSourceVpcConfiguration
DataSourceVpcConfiguration'
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
"SubnetIds")
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
"SecurityGroupIds")
)
instance Prelude.Hashable DataSourceVpcConfiguration where
hashWithSalt :: Int -> DataSourceVpcConfiguration -> Int
hashWithSalt Int
_salt DataSourceVpcConfiguration' {NonEmpty Text
securityGroupIds :: NonEmpty Text
subnetIds :: NonEmpty Text
$sel:securityGroupIds:DataSourceVpcConfiguration' :: DataSourceVpcConfiguration -> NonEmpty Text
$sel:subnetIds:DataSourceVpcConfiguration' :: DataSourceVpcConfiguration -> NonEmpty Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty Text
subnetIds
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` NonEmpty Text
securityGroupIds
instance Prelude.NFData DataSourceVpcConfiguration where
rnf :: DataSourceVpcConfiguration -> ()
rnf DataSourceVpcConfiguration' {NonEmpty Text
securityGroupIds :: NonEmpty Text
subnetIds :: NonEmpty Text
$sel:securityGroupIds:DataSourceVpcConfiguration' :: DataSourceVpcConfiguration -> NonEmpty Text
$sel:subnetIds:DataSourceVpcConfiguration' :: DataSourceVpcConfiguration -> NonEmpty Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf NonEmpty Text
subnetIds
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf NonEmpty Text
securityGroupIds
instance Data.ToJSON DataSourceVpcConfiguration where
toJSON :: DataSourceVpcConfiguration -> Value
toJSON DataSourceVpcConfiguration' {NonEmpty Text
securityGroupIds :: NonEmpty Text
subnetIds :: NonEmpty Text
$sel:securityGroupIds:DataSourceVpcConfiguration' :: DataSourceVpcConfiguration -> NonEmpty Text
$sel:subnetIds:DataSourceVpcConfiguration' :: DataSourceVpcConfiguration -> NonEmpty Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"SubnetIds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty Text
subnetIds),
forall a. a -> Maybe a
Prelude.Just
(Key
"SecurityGroupIds" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= NonEmpty Text
securityGroupIds)
]
)