{-# 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.OpenSearch.Types.PackageSource where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PackageSource = PackageSource'
{
PackageSource -> Maybe Text
s3Key :: Prelude.Maybe Prelude.Text,
PackageSource -> Maybe Text
s3BucketName :: Prelude.Maybe Prelude.Text
}
deriving (PackageSource -> PackageSource -> Bool
(PackageSource -> PackageSource -> Bool)
-> (PackageSource -> PackageSource -> Bool) -> Eq PackageSource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PackageSource -> PackageSource -> Bool
$c/= :: PackageSource -> PackageSource -> Bool
== :: PackageSource -> PackageSource -> Bool
$c== :: PackageSource -> PackageSource -> Bool
Prelude.Eq, ReadPrec [PackageSource]
ReadPrec PackageSource
Int -> ReadS PackageSource
ReadS [PackageSource]
(Int -> ReadS PackageSource)
-> ReadS [PackageSource]
-> ReadPrec PackageSource
-> ReadPrec [PackageSource]
-> Read PackageSource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PackageSource]
$creadListPrec :: ReadPrec [PackageSource]
readPrec :: ReadPrec PackageSource
$creadPrec :: ReadPrec PackageSource
readList :: ReadS [PackageSource]
$creadList :: ReadS [PackageSource]
readsPrec :: Int -> ReadS PackageSource
$creadsPrec :: Int -> ReadS PackageSource
Prelude.Read, Int -> PackageSource -> ShowS
[PackageSource] -> ShowS
PackageSource -> String
(Int -> PackageSource -> ShowS)
-> (PackageSource -> String)
-> ([PackageSource] -> ShowS)
-> Show PackageSource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PackageSource] -> ShowS
$cshowList :: [PackageSource] -> ShowS
show :: PackageSource -> String
$cshow :: PackageSource -> String
showsPrec :: Int -> PackageSource -> ShowS
$cshowsPrec :: Int -> PackageSource -> ShowS
Prelude.Show, (forall x. PackageSource -> Rep PackageSource x)
-> (forall x. Rep PackageSource x -> PackageSource)
-> Generic PackageSource
forall x. Rep PackageSource x -> PackageSource
forall x. PackageSource -> Rep PackageSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PackageSource x -> PackageSource
$cfrom :: forall x. PackageSource -> Rep PackageSource x
Prelude.Generic)
newPackageSource ::
PackageSource
newPackageSource :: PackageSource
newPackageSource =
PackageSource' :: Maybe Text -> Maybe Text -> PackageSource
PackageSource'
{ $sel:s3Key:PackageSource' :: Maybe Text
s3Key = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:s3BucketName:PackageSource' :: Maybe Text
s3BucketName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
packageSource_s3Key :: Lens.Lens' PackageSource (Prelude.Maybe Prelude.Text)
packageSource_s3Key :: (Maybe Text -> f (Maybe Text)) -> PackageSource -> f PackageSource
packageSource_s3Key = (PackageSource -> Maybe Text)
-> (PackageSource -> Maybe Text -> PackageSource)
-> Lens PackageSource PackageSource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackageSource' {Maybe Text
s3Key :: Maybe Text
$sel:s3Key:PackageSource' :: PackageSource -> Maybe Text
s3Key} -> Maybe Text
s3Key) (\s :: PackageSource
s@PackageSource' {} Maybe Text
a -> PackageSource
s {$sel:s3Key:PackageSource' :: Maybe Text
s3Key = Maybe Text
a} :: PackageSource)
packageSource_s3BucketName :: Lens.Lens' PackageSource (Prelude.Maybe Prelude.Text)
packageSource_s3BucketName :: (Maybe Text -> f (Maybe Text)) -> PackageSource -> f PackageSource
packageSource_s3BucketName = (PackageSource -> Maybe Text)
-> (PackageSource -> Maybe Text -> PackageSource)
-> Lens PackageSource PackageSource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PackageSource' {Maybe Text
s3BucketName :: Maybe Text
$sel:s3BucketName:PackageSource' :: PackageSource -> Maybe Text
s3BucketName} -> Maybe Text
s3BucketName) (\s :: PackageSource
s@PackageSource' {} Maybe Text
a -> PackageSource
s {$sel:s3BucketName:PackageSource' :: Maybe Text
s3BucketName = Maybe Text
a} :: PackageSource)
instance Prelude.Hashable PackageSource
instance Prelude.NFData PackageSource
instance Core.ToJSON PackageSource where
toJSON :: PackageSource -> Value
toJSON PackageSource' {Maybe Text
s3BucketName :: Maybe Text
s3Key :: Maybe Text
$sel:s3BucketName:PackageSource' :: PackageSource -> Maybe Text
$sel:s3Key:PackageSource' :: PackageSource -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"S3Key" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
s3Key,
(Text
"S3BucketName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
s3BucketName
]
)