{-# 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.DeviceFarm.Types.InstanceProfile where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data InstanceProfile = InstanceProfile'
{
InstanceProfile -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
InstanceProfile -> Maybe Bool
rebootAfterUse :: Prelude.Maybe Prelude.Bool,
InstanceProfile -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
InstanceProfile -> Maybe Bool
packageCleanup :: Prelude.Maybe Prelude.Bool,
InstanceProfile -> Maybe [Text]
excludeAppPackagesFromCleanup :: Prelude.Maybe [Prelude.Text],
InstanceProfile -> Maybe Text
description :: Prelude.Maybe Prelude.Text
}
deriving (InstanceProfile -> InstanceProfile -> Bool
(InstanceProfile -> InstanceProfile -> Bool)
-> (InstanceProfile -> InstanceProfile -> Bool)
-> Eq InstanceProfile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstanceProfile -> InstanceProfile -> Bool
$c/= :: InstanceProfile -> InstanceProfile -> Bool
== :: InstanceProfile -> InstanceProfile -> Bool
$c== :: InstanceProfile -> InstanceProfile -> Bool
Prelude.Eq, ReadPrec [InstanceProfile]
ReadPrec InstanceProfile
Int -> ReadS InstanceProfile
ReadS [InstanceProfile]
(Int -> ReadS InstanceProfile)
-> ReadS [InstanceProfile]
-> ReadPrec InstanceProfile
-> ReadPrec [InstanceProfile]
-> Read InstanceProfile
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstanceProfile]
$creadListPrec :: ReadPrec [InstanceProfile]
readPrec :: ReadPrec InstanceProfile
$creadPrec :: ReadPrec InstanceProfile
readList :: ReadS [InstanceProfile]
$creadList :: ReadS [InstanceProfile]
readsPrec :: Int -> ReadS InstanceProfile
$creadsPrec :: Int -> ReadS InstanceProfile
Prelude.Read, Int -> InstanceProfile -> ShowS
[InstanceProfile] -> ShowS
InstanceProfile -> String
(Int -> InstanceProfile -> ShowS)
-> (InstanceProfile -> String)
-> ([InstanceProfile] -> ShowS)
-> Show InstanceProfile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstanceProfile] -> ShowS
$cshowList :: [InstanceProfile] -> ShowS
show :: InstanceProfile -> String
$cshow :: InstanceProfile -> String
showsPrec :: Int -> InstanceProfile -> ShowS
$cshowsPrec :: Int -> InstanceProfile -> ShowS
Prelude.Show, (forall x. InstanceProfile -> Rep InstanceProfile x)
-> (forall x. Rep InstanceProfile x -> InstanceProfile)
-> Generic InstanceProfile
forall x. Rep InstanceProfile x -> InstanceProfile
forall x. InstanceProfile -> Rep InstanceProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InstanceProfile x -> InstanceProfile
$cfrom :: forall x. InstanceProfile -> Rep InstanceProfile x
Prelude.Generic)
newInstanceProfile ::
InstanceProfile
newInstanceProfile :: InstanceProfile
newInstanceProfile =
InstanceProfile' :: Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> Maybe [Text]
-> Maybe Text
-> InstanceProfile
InstanceProfile'
{ $sel:arn:InstanceProfile' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:rebootAfterUse:InstanceProfile' :: Maybe Bool
rebootAfterUse = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:name:InstanceProfile' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:packageCleanup:InstanceProfile' :: Maybe Bool
packageCleanup = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:excludeAppPackagesFromCleanup:InstanceProfile' :: Maybe [Text]
excludeAppPackagesFromCleanup = Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
$sel:description:InstanceProfile' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
instanceProfile_arn :: Lens.Lens' InstanceProfile (Prelude.Maybe Prelude.Text)
instanceProfile_arn :: (Maybe Text -> f (Maybe Text))
-> InstanceProfile -> f InstanceProfile
instanceProfile_arn = (InstanceProfile -> Maybe Text)
-> (InstanceProfile -> Maybe Text -> InstanceProfile)
-> Lens InstanceProfile InstanceProfile (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceProfile' {Maybe Text
arn :: Maybe Text
$sel:arn:InstanceProfile' :: InstanceProfile -> Maybe Text
arn} -> Maybe Text
arn) (\s :: InstanceProfile
s@InstanceProfile' {} Maybe Text
a -> InstanceProfile
s {$sel:arn:InstanceProfile' :: Maybe Text
arn = Maybe Text
a} :: InstanceProfile)
instanceProfile_rebootAfterUse :: Lens.Lens' InstanceProfile (Prelude.Maybe Prelude.Bool)
instanceProfile_rebootAfterUse :: (Maybe Bool -> f (Maybe Bool))
-> InstanceProfile -> f InstanceProfile
instanceProfile_rebootAfterUse = (InstanceProfile -> Maybe Bool)
-> (InstanceProfile -> Maybe Bool -> InstanceProfile)
-> Lens InstanceProfile InstanceProfile (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceProfile' {Maybe Bool
rebootAfterUse :: Maybe Bool
$sel:rebootAfterUse:InstanceProfile' :: InstanceProfile -> Maybe Bool
rebootAfterUse} -> Maybe Bool
rebootAfterUse) (\s :: InstanceProfile
s@InstanceProfile' {} Maybe Bool
a -> InstanceProfile
s {$sel:rebootAfterUse:InstanceProfile' :: Maybe Bool
rebootAfterUse = Maybe Bool
a} :: InstanceProfile)
instanceProfile_name :: Lens.Lens' InstanceProfile (Prelude.Maybe Prelude.Text)
instanceProfile_name :: (Maybe Text -> f (Maybe Text))
-> InstanceProfile -> f InstanceProfile
instanceProfile_name = (InstanceProfile -> Maybe Text)
-> (InstanceProfile -> Maybe Text -> InstanceProfile)
-> Lens InstanceProfile InstanceProfile (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceProfile' {Maybe Text
name :: Maybe Text
$sel:name:InstanceProfile' :: InstanceProfile -> Maybe Text
name} -> Maybe Text
name) (\s :: InstanceProfile
s@InstanceProfile' {} Maybe Text
a -> InstanceProfile
s {$sel:name:InstanceProfile' :: Maybe Text
name = Maybe Text
a} :: InstanceProfile)
instanceProfile_packageCleanup :: Lens.Lens' InstanceProfile (Prelude.Maybe Prelude.Bool)
instanceProfile_packageCleanup :: (Maybe Bool -> f (Maybe Bool))
-> InstanceProfile -> f InstanceProfile
instanceProfile_packageCleanup = (InstanceProfile -> Maybe Bool)
-> (InstanceProfile -> Maybe Bool -> InstanceProfile)
-> Lens InstanceProfile InstanceProfile (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceProfile' {Maybe Bool
packageCleanup :: Maybe Bool
$sel:packageCleanup:InstanceProfile' :: InstanceProfile -> Maybe Bool
packageCleanup} -> Maybe Bool
packageCleanup) (\s :: InstanceProfile
s@InstanceProfile' {} Maybe Bool
a -> InstanceProfile
s {$sel:packageCleanup:InstanceProfile' :: Maybe Bool
packageCleanup = Maybe Bool
a} :: InstanceProfile)
instanceProfile_excludeAppPackagesFromCleanup :: Lens.Lens' InstanceProfile (Prelude.Maybe [Prelude.Text])
instanceProfile_excludeAppPackagesFromCleanup :: (Maybe [Text] -> f (Maybe [Text]))
-> InstanceProfile -> f InstanceProfile
instanceProfile_excludeAppPackagesFromCleanup = (InstanceProfile -> Maybe [Text])
-> (InstanceProfile -> Maybe [Text] -> InstanceProfile)
-> Lens
InstanceProfile InstanceProfile (Maybe [Text]) (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceProfile' {Maybe [Text]
excludeAppPackagesFromCleanup :: Maybe [Text]
$sel:excludeAppPackagesFromCleanup:InstanceProfile' :: InstanceProfile -> Maybe [Text]
excludeAppPackagesFromCleanup} -> Maybe [Text]
excludeAppPackagesFromCleanup) (\s :: InstanceProfile
s@InstanceProfile' {} Maybe [Text]
a -> InstanceProfile
s {$sel:excludeAppPackagesFromCleanup:InstanceProfile' :: Maybe [Text]
excludeAppPackagesFromCleanup = Maybe [Text]
a} :: InstanceProfile) ((Maybe [Text] -> f (Maybe [Text]))
-> InstanceProfile -> f InstanceProfile)
-> ((Maybe [Text] -> f (Maybe [Text]))
-> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> InstanceProfile
-> f InstanceProfile
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
instanceProfile_description :: Lens.Lens' InstanceProfile (Prelude.Maybe Prelude.Text)
instanceProfile_description :: (Maybe Text -> f (Maybe Text))
-> InstanceProfile -> f InstanceProfile
instanceProfile_description = (InstanceProfile -> Maybe Text)
-> (InstanceProfile -> Maybe Text -> InstanceProfile)
-> Lens InstanceProfile InstanceProfile (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstanceProfile' {Maybe Text
description :: Maybe Text
$sel:description:InstanceProfile' :: InstanceProfile -> Maybe Text
description} -> Maybe Text
description) (\s :: InstanceProfile
s@InstanceProfile' {} Maybe Text
a -> InstanceProfile
s {$sel:description:InstanceProfile' :: Maybe Text
description = Maybe Text
a} :: InstanceProfile)
instance Core.FromJSON InstanceProfile where
parseJSON :: Value -> Parser InstanceProfile
parseJSON =
String
-> (Object -> Parser InstanceProfile)
-> Value
-> Parser InstanceProfile
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"InstanceProfile"
( \Object
x ->
Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> Maybe [Text]
-> Maybe Text
-> InstanceProfile
InstanceProfile'
(Maybe Text
-> Maybe Bool
-> Maybe Text
-> Maybe Bool
-> Maybe [Text]
-> Maybe Text
-> InstanceProfile)
-> Parser (Maybe Text)
-> Parser
(Maybe Bool
-> Maybe Text
-> Maybe Bool
-> Maybe [Text]
-> Maybe Text
-> InstanceProfile)
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
"arn")
Parser
(Maybe Bool
-> Maybe Text
-> Maybe Bool
-> Maybe [Text]
-> Maybe Text
-> InstanceProfile)
-> Parser (Maybe Bool)
-> Parser
(Maybe Text
-> Maybe Bool -> Maybe [Text] -> Maybe Text -> InstanceProfile)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"rebootAfterUse")
Parser
(Maybe Text
-> Maybe Bool -> Maybe [Text] -> Maybe Text -> InstanceProfile)
-> Parser (Maybe Text)
-> Parser
(Maybe Bool -> Maybe [Text] -> Maybe Text -> InstanceProfile)
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
"name")
Parser
(Maybe Bool -> Maybe [Text] -> Maybe Text -> InstanceProfile)
-> Parser (Maybe Bool)
-> Parser (Maybe [Text] -> Maybe Text -> InstanceProfile)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"packageCleanup")
Parser (Maybe [Text] -> Maybe Text -> InstanceProfile)
-> Parser (Maybe [Text]) -> Parser (Maybe Text -> InstanceProfile)
forall (f :: * -> *) a b. Applicative f => 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
"excludeAppPackagesFromCleanup"
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 Text -> InstanceProfile)
-> Parser (Maybe Text) -> Parser InstanceProfile
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
"description")
)
instance Prelude.Hashable InstanceProfile
instance Prelude.NFData InstanceProfile