{-# 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.Nimble.Types.StreamConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Nimble.Types.StreamingClipboardMode
import Amazonka.Nimble.Types.StreamingInstanceType
import qualified Amazonka.Prelude as Prelude
data StreamConfiguration = StreamConfiguration'
{
StreamConfiguration -> Maybe [Text]
streamingImageIds :: Prelude.Maybe [Prelude.Text],
StreamConfiguration -> Maybe Natural
maxSessionLengthInMinutes :: Prelude.Maybe Prelude.Natural,
StreamConfiguration -> Maybe StreamingClipboardMode
clipboardMode :: Prelude.Maybe StreamingClipboardMode,
StreamConfiguration -> Maybe (NonEmpty StreamingInstanceType)
ec2InstanceTypes :: Prelude.Maybe (Prelude.NonEmpty StreamingInstanceType)
}
deriving (StreamConfiguration -> StreamConfiguration -> Bool
(StreamConfiguration -> StreamConfiguration -> Bool)
-> (StreamConfiguration -> StreamConfiguration -> Bool)
-> Eq StreamConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StreamConfiguration -> StreamConfiguration -> Bool
$c/= :: StreamConfiguration -> StreamConfiguration -> Bool
== :: StreamConfiguration -> StreamConfiguration -> Bool
$c== :: StreamConfiguration -> StreamConfiguration -> Bool
Prelude.Eq, ReadPrec [StreamConfiguration]
ReadPrec StreamConfiguration
Int -> ReadS StreamConfiguration
ReadS [StreamConfiguration]
(Int -> ReadS StreamConfiguration)
-> ReadS [StreamConfiguration]
-> ReadPrec StreamConfiguration
-> ReadPrec [StreamConfiguration]
-> Read StreamConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StreamConfiguration]
$creadListPrec :: ReadPrec [StreamConfiguration]
readPrec :: ReadPrec StreamConfiguration
$creadPrec :: ReadPrec StreamConfiguration
readList :: ReadS [StreamConfiguration]
$creadList :: ReadS [StreamConfiguration]
readsPrec :: Int -> ReadS StreamConfiguration
$creadsPrec :: Int -> ReadS StreamConfiguration
Prelude.Read, Int -> StreamConfiguration -> ShowS
[StreamConfiguration] -> ShowS
StreamConfiguration -> String
(Int -> StreamConfiguration -> ShowS)
-> (StreamConfiguration -> String)
-> ([StreamConfiguration] -> ShowS)
-> Show StreamConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StreamConfiguration] -> ShowS
$cshowList :: [StreamConfiguration] -> ShowS
show :: StreamConfiguration -> String
$cshow :: StreamConfiguration -> String
showsPrec :: Int -> StreamConfiguration -> ShowS
$cshowsPrec :: Int -> StreamConfiguration -> ShowS
Prelude.Show, (forall x. StreamConfiguration -> Rep StreamConfiguration x)
-> (forall x. Rep StreamConfiguration x -> StreamConfiguration)
-> Generic StreamConfiguration
forall x. Rep StreamConfiguration x -> StreamConfiguration
forall x. StreamConfiguration -> Rep StreamConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StreamConfiguration x -> StreamConfiguration
$cfrom :: forall x. StreamConfiguration -> Rep StreamConfiguration x
Prelude.Generic)
newStreamConfiguration ::
StreamConfiguration
newStreamConfiguration :: StreamConfiguration
newStreamConfiguration =
StreamConfiguration' :: Maybe [Text]
-> Maybe Natural
-> Maybe StreamingClipboardMode
-> Maybe (NonEmpty StreamingInstanceType)
-> StreamConfiguration
StreamConfiguration'
{ $sel:streamingImageIds:StreamConfiguration' :: Maybe [Text]
streamingImageIds =
Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:maxSessionLengthInMinutes:StreamConfiguration' :: Maybe Natural
maxSessionLengthInMinutes = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:clipboardMode:StreamConfiguration' :: Maybe StreamingClipboardMode
clipboardMode = Maybe StreamingClipboardMode
forall a. Maybe a
Prelude.Nothing,
$sel:ec2InstanceTypes:StreamConfiguration' :: Maybe (NonEmpty StreamingInstanceType)
ec2InstanceTypes = Maybe (NonEmpty StreamingInstanceType)
forall a. Maybe a
Prelude.Nothing
}
streamConfiguration_streamingImageIds :: Lens.Lens' StreamConfiguration (Prelude.Maybe [Prelude.Text])
streamConfiguration_streamingImageIds :: (Maybe [Text] -> f (Maybe [Text]))
-> StreamConfiguration -> f StreamConfiguration
streamConfiguration_streamingImageIds = (StreamConfiguration -> Maybe [Text])
-> (StreamConfiguration -> Maybe [Text] -> StreamConfiguration)
-> Lens
StreamConfiguration
StreamConfiguration
(Maybe [Text])
(Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamConfiguration' {Maybe [Text]
streamingImageIds :: Maybe [Text]
$sel:streamingImageIds:StreamConfiguration' :: StreamConfiguration -> Maybe [Text]
streamingImageIds} -> Maybe [Text]
streamingImageIds) (\s :: StreamConfiguration
s@StreamConfiguration' {} Maybe [Text]
a -> StreamConfiguration
s {$sel:streamingImageIds:StreamConfiguration' :: Maybe [Text]
streamingImageIds = Maybe [Text]
a} :: StreamConfiguration) ((Maybe [Text] -> f (Maybe [Text]))
-> StreamConfiguration -> f StreamConfiguration)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> StreamConfiguration
-> f StreamConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
streamConfiguration_maxSessionLengthInMinutes :: Lens.Lens' StreamConfiguration (Prelude.Maybe Prelude.Natural)
streamConfiguration_maxSessionLengthInMinutes :: (Maybe Natural -> f (Maybe Natural))
-> StreamConfiguration -> f StreamConfiguration
streamConfiguration_maxSessionLengthInMinutes = (StreamConfiguration -> Maybe Natural)
-> (StreamConfiguration -> Maybe Natural -> StreamConfiguration)
-> Lens
StreamConfiguration
StreamConfiguration
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamConfiguration' {Maybe Natural
maxSessionLengthInMinutes :: Maybe Natural
$sel:maxSessionLengthInMinutes:StreamConfiguration' :: StreamConfiguration -> Maybe Natural
maxSessionLengthInMinutes} -> Maybe Natural
maxSessionLengthInMinutes) (\s :: StreamConfiguration
s@StreamConfiguration' {} Maybe Natural
a -> StreamConfiguration
s {$sel:maxSessionLengthInMinutes:StreamConfiguration' :: Maybe Natural
maxSessionLengthInMinutes = Maybe Natural
a} :: StreamConfiguration)
streamConfiguration_clipboardMode :: Lens.Lens' StreamConfiguration (Prelude.Maybe StreamingClipboardMode)
streamConfiguration_clipboardMode :: (Maybe StreamingClipboardMode -> f (Maybe StreamingClipboardMode))
-> StreamConfiguration -> f StreamConfiguration
streamConfiguration_clipboardMode = (StreamConfiguration -> Maybe StreamingClipboardMode)
-> (StreamConfiguration
-> Maybe StreamingClipboardMode -> StreamConfiguration)
-> Lens
StreamConfiguration
StreamConfiguration
(Maybe StreamingClipboardMode)
(Maybe StreamingClipboardMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamConfiguration' {Maybe StreamingClipboardMode
clipboardMode :: Maybe StreamingClipboardMode
$sel:clipboardMode:StreamConfiguration' :: StreamConfiguration -> Maybe StreamingClipboardMode
clipboardMode} -> Maybe StreamingClipboardMode
clipboardMode) (\s :: StreamConfiguration
s@StreamConfiguration' {} Maybe StreamingClipboardMode
a -> StreamConfiguration
s {$sel:clipboardMode:StreamConfiguration' :: Maybe StreamingClipboardMode
clipboardMode = Maybe StreamingClipboardMode
a} :: StreamConfiguration)
streamConfiguration_ec2InstanceTypes :: Lens.Lens' StreamConfiguration (Prelude.Maybe (Prelude.NonEmpty StreamingInstanceType))
streamConfiguration_ec2InstanceTypes :: (Maybe (NonEmpty StreamingInstanceType)
-> f (Maybe (NonEmpty StreamingInstanceType)))
-> StreamConfiguration -> f StreamConfiguration
streamConfiguration_ec2InstanceTypes = (StreamConfiguration -> Maybe (NonEmpty StreamingInstanceType))
-> (StreamConfiguration
-> Maybe (NonEmpty StreamingInstanceType) -> StreamConfiguration)
-> Lens
StreamConfiguration
StreamConfiguration
(Maybe (NonEmpty StreamingInstanceType))
(Maybe (NonEmpty StreamingInstanceType))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StreamConfiguration' {Maybe (NonEmpty StreamingInstanceType)
ec2InstanceTypes :: Maybe (NonEmpty StreamingInstanceType)
$sel:ec2InstanceTypes:StreamConfiguration' :: StreamConfiguration -> Maybe (NonEmpty StreamingInstanceType)
ec2InstanceTypes} -> Maybe (NonEmpty StreamingInstanceType)
ec2InstanceTypes) (\s :: StreamConfiguration
s@StreamConfiguration' {} Maybe (NonEmpty StreamingInstanceType)
a -> StreamConfiguration
s {$sel:ec2InstanceTypes:StreamConfiguration' :: Maybe (NonEmpty StreamingInstanceType)
ec2InstanceTypes = Maybe (NonEmpty StreamingInstanceType)
a} :: StreamConfiguration) ((Maybe (NonEmpty StreamingInstanceType)
-> f (Maybe (NonEmpty StreamingInstanceType)))
-> StreamConfiguration -> f StreamConfiguration)
-> ((Maybe (NonEmpty StreamingInstanceType)
-> f (Maybe (NonEmpty StreamingInstanceType)))
-> Maybe (NonEmpty StreamingInstanceType)
-> f (Maybe (NonEmpty StreamingInstanceType)))
-> (Maybe (NonEmpty StreamingInstanceType)
-> f (Maybe (NonEmpty StreamingInstanceType)))
-> StreamConfiguration
-> f StreamConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty StreamingInstanceType)
(NonEmpty StreamingInstanceType)
(NonEmpty StreamingInstanceType)
(NonEmpty StreamingInstanceType)
-> Iso
(Maybe (NonEmpty StreamingInstanceType))
(Maybe (NonEmpty StreamingInstanceType))
(Maybe (NonEmpty StreamingInstanceType))
(Maybe (NonEmpty StreamingInstanceType))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
(NonEmpty StreamingInstanceType)
(NonEmpty StreamingInstanceType)
(NonEmpty StreamingInstanceType)
(NonEmpty StreamingInstanceType)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON StreamConfiguration where
parseJSON :: Value -> Parser StreamConfiguration
parseJSON =
String
-> (Object -> Parser StreamConfiguration)
-> Value
-> Parser StreamConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"StreamConfiguration"
( \Object
x ->
Maybe [Text]
-> Maybe Natural
-> Maybe StreamingClipboardMode
-> Maybe (NonEmpty StreamingInstanceType)
-> StreamConfiguration
StreamConfiguration'
(Maybe [Text]
-> Maybe Natural
-> Maybe StreamingClipboardMode
-> Maybe (NonEmpty StreamingInstanceType)
-> StreamConfiguration)
-> Parser (Maybe [Text])
-> Parser
(Maybe Natural
-> Maybe StreamingClipboardMode
-> Maybe (NonEmpty StreamingInstanceType)
-> StreamConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"streamingImageIds"
Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
)
Parser
(Maybe Natural
-> Maybe StreamingClipboardMode
-> Maybe (NonEmpty StreamingInstanceType)
-> StreamConfiguration)
-> Parser (Maybe Natural)
-> Parser
(Maybe StreamingClipboardMode
-> Maybe (NonEmpty StreamingInstanceType) -> StreamConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"maxSessionLengthInMinutes")
Parser
(Maybe StreamingClipboardMode
-> Maybe (NonEmpty StreamingInstanceType) -> StreamConfiguration)
-> Parser (Maybe StreamingClipboardMode)
-> Parser
(Maybe (NonEmpty StreamingInstanceType) -> StreamConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe StreamingClipboardMode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"clipboardMode")
Parser
(Maybe (NonEmpty StreamingInstanceType) -> StreamConfiguration)
-> Parser (Maybe (NonEmpty StreamingInstanceType))
-> Parser StreamConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty StreamingInstanceType))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ec2InstanceTypes")
)
instance Prelude.Hashable StreamConfiguration
instance Prelude.NFData StreamConfiguration