{-# 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.SageMaker.Types.SharingSettings where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.NotebookOutputOption
data SharingSettings = SharingSettings'
{
SharingSettings -> Maybe Text
s3KmsKeyId :: Prelude.Maybe Prelude.Text,
SharingSettings -> Maybe Text
s3OutputPath :: Prelude.Maybe Prelude.Text,
SharingSettings -> Maybe NotebookOutputOption
notebookOutputOption :: Prelude.Maybe NotebookOutputOption
}
deriving (SharingSettings -> SharingSettings -> Bool
(SharingSettings -> SharingSettings -> Bool)
-> (SharingSettings -> SharingSettings -> Bool)
-> Eq SharingSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SharingSettings -> SharingSettings -> Bool
$c/= :: SharingSettings -> SharingSettings -> Bool
== :: SharingSettings -> SharingSettings -> Bool
$c== :: SharingSettings -> SharingSettings -> Bool
Prelude.Eq, ReadPrec [SharingSettings]
ReadPrec SharingSettings
Int -> ReadS SharingSettings
ReadS [SharingSettings]
(Int -> ReadS SharingSettings)
-> ReadS [SharingSettings]
-> ReadPrec SharingSettings
-> ReadPrec [SharingSettings]
-> Read SharingSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SharingSettings]
$creadListPrec :: ReadPrec [SharingSettings]
readPrec :: ReadPrec SharingSettings
$creadPrec :: ReadPrec SharingSettings
readList :: ReadS [SharingSettings]
$creadList :: ReadS [SharingSettings]
readsPrec :: Int -> ReadS SharingSettings
$creadsPrec :: Int -> ReadS SharingSettings
Prelude.Read, Int -> SharingSettings -> ShowS
[SharingSettings] -> ShowS
SharingSettings -> String
(Int -> SharingSettings -> ShowS)
-> (SharingSettings -> String)
-> ([SharingSettings] -> ShowS)
-> Show SharingSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SharingSettings] -> ShowS
$cshowList :: [SharingSettings] -> ShowS
show :: SharingSettings -> String
$cshow :: SharingSettings -> String
showsPrec :: Int -> SharingSettings -> ShowS
$cshowsPrec :: Int -> SharingSettings -> ShowS
Prelude.Show, (forall x. SharingSettings -> Rep SharingSettings x)
-> (forall x. Rep SharingSettings x -> SharingSettings)
-> Generic SharingSettings
forall x. Rep SharingSettings x -> SharingSettings
forall x. SharingSettings -> Rep SharingSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SharingSettings x -> SharingSettings
$cfrom :: forall x. SharingSettings -> Rep SharingSettings x
Prelude.Generic)
newSharingSettings ::
SharingSettings
newSharingSettings :: SharingSettings
newSharingSettings =
SharingSettings' :: Maybe Text
-> Maybe Text -> Maybe NotebookOutputOption -> SharingSettings
SharingSettings'
{ $sel:s3KmsKeyId:SharingSettings' :: Maybe Text
s3KmsKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:s3OutputPath:SharingSettings' :: Maybe Text
s3OutputPath = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:notebookOutputOption:SharingSettings' :: Maybe NotebookOutputOption
notebookOutputOption = Maybe NotebookOutputOption
forall a. Maybe a
Prelude.Nothing
}
sharingSettings_s3KmsKeyId :: Lens.Lens' SharingSettings (Prelude.Maybe Prelude.Text)
sharingSettings_s3KmsKeyId :: (Maybe Text -> f (Maybe Text))
-> SharingSettings -> f SharingSettings
sharingSettings_s3KmsKeyId = (SharingSettings -> Maybe Text)
-> (SharingSettings -> Maybe Text -> SharingSettings)
-> Lens SharingSettings SharingSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SharingSettings' {Maybe Text
s3KmsKeyId :: Maybe Text
$sel:s3KmsKeyId:SharingSettings' :: SharingSettings -> Maybe Text
s3KmsKeyId} -> Maybe Text
s3KmsKeyId) (\s :: SharingSettings
s@SharingSettings' {} Maybe Text
a -> SharingSettings
s {$sel:s3KmsKeyId:SharingSettings' :: Maybe Text
s3KmsKeyId = Maybe Text
a} :: SharingSettings)
sharingSettings_s3OutputPath :: Lens.Lens' SharingSettings (Prelude.Maybe Prelude.Text)
sharingSettings_s3OutputPath :: (Maybe Text -> f (Maybe Text))
-> SharingSettings -> f SharingSettings
sharingSettings_s3OutputPath = (SharingSettings -> Maybe Text)
-> (SharingSettings -> Maybe Text -> SharingSettings)
-> Lens SharingSettings SharingSettings (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SharingSettings' {Maybe Text
s3OutputPath :: Maybe Text
$sel:s3OutputPath:SharingSettings' :: SharingSettings -> Maybe Text
s3OutputPath} -> Maybe Text
s3OutputPath) (\s :: SharingSettings
s@SharingSettings' {} Maybe Text
a -> SharingSettings
s {$sel:s3OutputPath:SharingSettings' :: Maybe Text
s3OutputPath = Maybe Text
a} :: SharingSettings)
sharingSettings_notebookOutputOption :: Lens.Lens' SharingSettings (Prelude.Maybe NotebookOutputOption)
sharingSettings_notebookOutputOption :: (Maybe NotebookOutputOption -> f (Maybe NotebookOutputOption))
-> SharingSettings -> f SharingSettings
sharingSettings_notebookOutputOption = (SharingSettings -> Maybe NotebookOutputOption)
-> (SharingSettings
-> Maybe NotebookOutputOption -> SharingSettings)
-> Lens
SharingSettings
SharingSettings
(Maybe NotebookOutputOption)
(Maybe NotebookOutputOption)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SharingSettings' {Maybe NotebookOutputOption
notebookOutputOption :: Maybe NotebookOutputOption
$sel:notebookOutputOption:SharingSettings' :: SharingSettings -> Maybe NotebookOutputOption
notebookOutputOption} -> Maybe NotebookOutputOption
notebookOutputOption) (\s :: SharingSettings
s@SharingSettings' {} Maybe NotebookOutputOption
a -> SharingSettings
s {$sel:notebookOutputOption:SharingSettings' :: Maybe NotebookOutputOption
notebookOutputOption = Maybe NotebookOutputOption
a} :: SharingSettings)
instance Core.FromJSON SharingSettings where
parseJSON :: Value -> Parser SharingSettings
parseJSON =
String
-> (Object -> Parser SharingSettings)
-> Value
-> Parser SharingSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SharingSettings"
( \Object
x ->
Maybe Text
-> Maybe Text -> Maybe NotebookOutputOption -> SharingSettings
SharingSettings'
(Maybe Text
-> Maybe Text -> Maybe NotebookOutputOption -> SharingSettings)
-> Parser (Maybe Text)
-> Parser
(Maybe Text -> Maybe NotebookOutputOption -> SharingSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"S3KmsKeyId")
Parser
(Maybe Text -> Maybe NotebookOutputOption -> SharingSettings)
-> Parser (Maybe Text)
-> Parser (Maybe NotebookOutputOption -> SharingSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"S3OutputPath")
Parser (Maybe NotebookOutputOption -> SharingSettings)
-> Parser (Maybe NotebookOutputOption) -> Parser SharingSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe NotebookOutputOption)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NotebookOutputOption")
)
instance Prelude.Hashable SharingSettings
instance Prelude.NFData SharingSettings
instance Core.ToJSON SharingSettings where
toJSON :: SharingSettings -> Value
toJSON SharingSettings' {Maybe Text
Maybe NotebookOutputOption
notebookOutputOption :: Maybe NotebookOutputOption
s3OutputPath :: Maybe Text
s3KmsKeyId :: Maybe Text
$sel:notebookOutputOption:SharingSettings' :: SharingSettings -> Maybe NotebookOutputOption
$sel:s3OutputPath:SharingSettings' :: SharingSettings -> Maybe Text
$sel:s3KmsKeyId:SharingSettings' :: SharingSettings -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"S3KmsKeyId" 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
s3KmsKeyId,
(Text
"S3OutputPath" 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
s3OutputPath,
(Text
"NotebookOutputOption" Text -> NotebookOutputOption -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(NotebookOutputOption -> Pair)
-> Maybe NotebookOutputOption -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NotebookOutputOption
notebookOutputOption
]
)