{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.IoTDeviceAdvisor.Types.SuiteDefinitionInformation
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.IoTDeviceAdvisor.Types.SuiteDefinitionInformation where

import qualified Amazonka.Core as Core
import Amazonka.IoTDeviceAdvisor.Types.DeviceUnderTest
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Information about the suite definition.
--
-- /See:/ 'newSuiteDefinitionInformation' smart constructor.
data SuiteDefinitionInformation = SuiteDefinitionInformation'
  { -- | Date (in Unix epoch time) when the test suite was created.
    SuiteDefinitionInformation -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    -- | Specifies the devices under test for the test suite.
    SuiteDefinitionInformation -> Maybe [DeviceUnderTest]
defaultDevices :: Prelude.Maybe [DeviceUnderTest],
    -- | Suite definition Id of the test suite.
    SuiteDefinitionInformation -> Maybe Text
suiteDefinitionId :: Prelude.Maybe Prelude.Text,
    -- | Suite name of the test suite.
    SuiteDefinitionInformation -> Maybe Text
suiteDefinitionName :: Prelude.Maybe Prelude.Text,
    -- | Specifies if the test suite is intended for qualification.
    SuiteDefinitionInformation -> Maybe Bool
intendedForQualification :: Prelude.Maybe Prelude.Bool
  }
  deriving (SuiteDefinitionInformation -> SuiteDefinitionInformation -> Bool
(SuiteDefinitionInformation -> SuiteDefinitionInformation -> Bool)
-> (SuiteDefinitionInformation
    -> SuiteDefinitionInformation -> Bool)
-> Eq SuiteDefinitionInformation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SuiteDefinitionInformation -> SuiteDefinitionInformation -> Bool
$c/= :: SuiteDefinitionInformation -> SuiteDefinitionInformation -> Bool
== :: SuiteDefinitionInformation -> SuiteDefinitionInformation -> Bool
$c== :: SuiteDefinitionInformation -> SuiteDefinitionInformation -> Bool
Prelude.Eq, ReadPrec [SuiteDefinitionInformation]
ReadPrec SuiteDefinitionInformation
Int -> ReadS SuiteDefinitionInformation
ReadS [SuiteDefinitionInformation]
(Int -> ReadS SuiteDefinitionInformation)
-> ReadS [SuiteDefinitionInformation]
-> ReadPrec SuiteDefinitionInformation
-> ReadPrec [SuiteDefinitionInformation]
-> Read SuiteDefinitionInformation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SuiteDefinitionInformation]
$creadListPrec :: ReadPrec [SuiteDefinitionInformation]
readPrec :: ReadPrec SuiteDefinitionInformation
$creadPrec :: ReadPrec SuiteDefinitionInformation
readList :: ReadS [SuiteDefinitionInformation]
$creadList :: ReadS [SuiteDefinitionInformation]
readsPrec :: Int -> ReadS SuiteDefinitionInformation
$creadsPrec :: Int -> ReadS SuiteDefinitionInformation
Prelude.Read, Int -> SuiteDefinitionInformation -> ShowS
[SuiteDefinitionInformation] -> ShowS
SuiteDefinitionInformation -> String
(Int -> SuiteDefinitionInformation -> ShowS)
-> (SuiteDefinitionInformation -> String)
-> ([SuiteDefinitionInformation] -> ShowS)
-> Show SuiteDefinitionInformation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SuiteDefinitionInformation] -> ShowS
$cshowList :: [SuiteDefinitionInformation] -> ShowS
show :: SuiteDefinitionInformation -> String
$cshow :: SuiteDefinitionInformation -> String
showsPrec :: Int -> SuiteDefinitionInformation -> ShowS
$cshowsPrec :: Int -> SuiteDefinitionInformation -> ShowS
Prelude.Show, (forall x.
 SuiteDefinitionInformation -> Rep SuiteDefinitionInformation x)
-> (forall x.
    Rep SuiteDefinitionInformation x -> SuiteDefinitionInformation)
-> Generic SuiteDefinitionInformation
forall x.
Rep SuiteDefinitionInformation x -> SuiteDefinitionInformation
forall x.
SuiteDefinitionInformation -> Rep SuiteDefinitionInformation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SuiteDefinitionInformation x -> SuiteDefinitionInformation
$cfrom :: forall x.
SuiteDefinitionInformation -> Rep SuiteDefinitionInformation x
Prelude.Generic)

-- |
-- Create a value of 'SuiteDefinitionInformation' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'createdAt', 'suiteDefinitionInformation_createdAt' - Date (in Unix epoch time) when the test suite was created.
--
-- 'defaultDevices', 'suiteDefinitionInformation_defaultDevices' - Specifies the devices under test for the test suite.
--
-- 'suiteDefinitionId', 'suiteDefinitionInformation_suiteDefinitionId' - Suite definition Id of the test suite.
--
-- 'suiteDefinitionName', 'suiteDefinitionInformation_suiteDefinitionName' - Suite name of the test suite.
--
-- 'intendedForQualification', 'suiteDefinitionInformation_intendedForQualification' - Specifies if the test suite is intended for qualification.
newSuiteDefinitionInformation ::
  SuiteDefinitionInformation
newSuiteDefinitionInformation :: SuiteDefinitionInformation
newSuiteDefinitionInformation =
  SuiteDefinitionInformation' :: Maybe POSIX
-> Maybe [DeviceUnderTest]
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> SuiteDefinitionInformation
SuiteDefinitionInformation'
    { $sel:createdAt:SuiteDefinitionInformation' :: Maybe POSIX
createdAt =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:defaultDevices:SuiteDefinitionInformation' :: Maybe [DeviceUnderTest]
defaultDevices = Maybe [DeviceUnderTest]
forall a. Maybe a
Prelude.Nothing,
      $sel:suiteDefinitionId:SuiteDefinitionInformation' :: Maybe Text
suiteDefinitionId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:suiteDefinitionName:SuiteDefinitionInformation' :: Maybe Text
suiteDefinitionName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:intendedForQualification:SuiteDefinitionInformation' :: Maybe Bool
intendedForQualification = Maybe Bool
forall a. Maybe a
Prelude.Nothing
    }

-- | Date (in Unix epoch time) when the test suite was created.
suiteDefinitionInformation_createdAt :: Lens.Lens' SuiteDefinitionInformation (Prelude.Maybe Prelude.UTCTime)
suiteDefinitionInformation_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> SuiteDefinitionInformation -> f SuiteDefinitionInformation
suiteDefinitionInformation_createdAt = (SuiteDefinitionInformation -> Maybe POSIX)
-> (SuiteDefinitionInformation
    -> Maybe POSIX -> SuiteDefinitionInformation)
-> Lens
     SuiteDefinitionInformation
     SuiteDefinitionInformation
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SuiteDefinitionInformation' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:SuiteDefinitionInformation' :: SuiteDefinitionInformation -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: SuiteDefinitionInformation
s@SuiteDefinitionInformation' {} Maybe POSIX
a -> SuiteDefinitionInformation
s {$sel:createdAt:SuiteDefinitionInformation' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: SuiteDefinitionInformation) ((Maybe POSIX -> f (Maybe POSIX))
 -> SuiteDefinitionInformation -> f SuiteDefinitionInformation)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> SuiteDefinitionInformation
-> f SuiteDefinitionInformation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | Specifies the devices under test for the test suite.
suiteDefinitionInformation_defaultDevices :: Lens.Lens' SuiteDefinitionInformation (Prelude.Maybe [DeviceUnderTest])
suiteDefinitionInformation_defaultDevices :: (Maybe [DeviceUnderTest] -> f (Maybe [DeviceUnderTest]))
-> SuiteDefinitionInformation -> f SuiteDefinitionInformation
suiteDefinitionInformation_defaultDevices = (SuiteDefinitionInformation -> Maybe [DeviceUnderTest])
-> (SuiteDefinitionInformation
    -> Maybe [DeviceUnderTest] -> SuiteDefinitionInformation)
-> Lens
     SuiteDefinitionInformation
     SuiteDefinitionInformation
     (Maybe [DeviceUnderTest])
     (Maybe [DeviceUnderTest])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SuiteDefinitionInformation' {Maybe [DeviceUnderTest]
defaultDevices :: Maybe [DeviceUnderTest]
$sel:defaultDevices:SuiteDefinitionInformation' :: SuiteDefinitionInformation -> Maybe [DeviceUnderTest]
defaultDevices} -> Maybe [DeviceUnderTest]
defaultDevices) (\s :: SuiteDefinitionInformation
s@SuiteDefinitionInformation' {} Maybe [DeviceUnderTest]
a -> SuiteDefinitionInformation
s {$sel:defaultDevices:SuiteDefinitionInformation' :: Maybe [DeviceUnderTest]
defaultDevices = Maybe [DeviceUnderTest]
a} :: SuiteDefinitionInformation) ((Maybe [DeviceUnderTest] -> f (Maybe [DeviceUnderTest]))
 -> SuiteDefinitionInformation -> f SuiteDefinitionInformation)
-> ((Maybe [DeviceUnderTest] -> f (Maybe [DeviceUnderTest]))
    -> Maybe [DeviceUnderTest] -> f (Maybe [DeviceUnderTest]))
-> (Maybe [DeviceUnderTest] -> f (Maybe [DeviceUnderTest]))
-> SuiteDefinitionInformation
-> f SuiteDefinitionInformation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [DeviceUnderTest]
  [DeviceUnderTest]
  [DeviceUnderTest]
  [DeviceUnderTest]
-> Iso
     (Maybe [DeviceUnderTest])
     (Maybe [DeviceUnderTest])
     (Maybe [DeviceUnderTest])
     (Maybe [DeviceUnderTest])
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
  [DeviceUnderTest]
  [DeviceUnderTest]
  [DeviceUnderTest]
  [DeviceUnderTest]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Suite definition Id of the test suite.
suiteDefinitionInformation_suiteDefinitionId :: Lens.Lens' SuiteDefinitionInformation (Prelude.Maybe Prelude.Text)
suiteDefinitionInformation_suiteDefinitionId :: (Maybe Text -> f (Maybe Text))
-> SuiteDefinitionInformation -> f SuiteDefinitionInformation
suiteDefinitionInformation_suiteDefinitionId = (SuiteDefinitionInformation -> Maybe Text)
-> (SuiteDefinitionInformation
    -> Maybe Text -> SuiteDefinitionInformation)
-> Lens
     SuiteDefinitionInformation
     SuiteDefinitionInformation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SuiteDefinitionInformation' {Maybe Text
suiteDefinitionId :: Maybe Text
$sel:suiteDefinitionId:SuiteDefinitionInformation' :: SuiteDefinitionInformation -> Maybe Text
suiteDefinitionId} -> Maybe Text
suiteDefinitionId) (\s :: SuiteDefinitionInformation
s@SuiteDefinitionInformation' {} Maybe Text
a -> SuiteDefinitionInformation
s {$sel:suiteDefinitionId:SuiteDefinitionInformation' :: Maybe Text
suiteDefinitionId = Maybe Text
a} :: SuiteDefinitionInformation)

-- | Suite name of the test suite.
suiteDefinitionInformation_suiteDefinitionName :: Lens.Lens' SuiteDefinitionInformation (Prelude.Maybe Prelude.Text)
suiteDefinitionInformation_suiteDefinitionName :: (Maybe Text -> f (Maybe Text))
-> SuiteDefinitionInformation -> f SuiteDefinitionInformation
suiteDefinitionInformation_suiteDefinitionName = (SuiteDefinitionInformation -> Maybe Text)
-> (SuiteDefinitionInformation
    -> Maybe Text -> SuiteDefinitionInformation)
-> Lens
     SuiteDefinitionInformation
     SuiteDefinitionInformation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SuiteDefinitionInformation' {Maybe Text
suiteDefinitionName :: Maybe Text
$sel:suiteDefinitionName:SuiteDefinitionInformation' :: SuiteDefinitionInformation -> Maybe Text
suiteDefinitionName} -> Maybe Text
suiteDefinitionName) (\s :: SuiteDefinitionInformation
s@SuiteDefinitionInformation' {} Maybe Text
a -> SuiteDefinitionInformation
s {$sel:suiteDefinitionName:SuiteDefinitionInformation' :: Maybe Text
suiteDefinitionName = Maybe Text
a} :: SuiteDefinitionInformation)

-- | Specifies if the test suite is intended for qualification.
suiteDefinitionInformation_intendedForQualification :: Lens.Lens' SuiteDefinitionInformation (Prelude.Maybe Prelude.Bool)
suiteDefinitionInformation_intendedForQualification :: (Maybe Bool -> f (Maybe Bool))
-> SuiteDefinitionInformation -> f SuiteDefinitionInformation
suiteDefinitionInformation_intendedForQualification = (SuiteDefinitionInformation -> Maybe Bool)
-> (SuiteDefinitionInformation
    -> Maybe Bool -> SuiteDefinitionInformation)
-> Lens
     SuiteDefinitionInformation
     SuiteDefinitionInformation
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SuiteDefinitionInformation' {Maybe Bool
intendedForQualification :: Maybe Bool
$sel:intendedForQualification:SuiteDefinitionInformation' :: SuiteDefinitionInformation -> Maybe Bool
intendedForQualification} -> Maybe Bool
intendedForQualification) (\s :: SuiteDefinitionInformation
s@SuiteDefinitionInformation' {} Maybe Bool
a -> SuiteDefinitionInformation
s {$sel:intendedForQualification:SuiteDefinitionInformation' :: Maybe Bool
intendedForQualification = Maybe Bool
a} :: SuiteDefinitionInformation)

instance Core.FromJSON SuiteDefinitionInformation where
  parseJSON :: Value -> Parser SuiteDefinitionInformation
parseJSON =
    String
-> (Object -> Parser SuiteDefinitionInformation)
-> Value
-> Parser SuiteDefinitionInformation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SuiteDefinitionInformation"
      ( \Object
x ->
          Maybe POSIX
-> Maybe [DeviceUnderTest]
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> SuiteDefinitionInformation
SuiteDefinitionInformation'
            (Maybe POSIX
 -> Maybe [DeviceUnderTest]
 -> Maybe Text
 -> Maybe Text
 -> Maybe Bool
 -> SuiteDefinitionInformation)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe [DeviceUnderTest]
      -> Maybe Text
      -> Maybe Text
      -> Maybe Bool
      -> SuiteDefinitionInformation)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"createdAt")
            Parser
  (Maybe [DeviceUnderTest]
   -> Maybe Text
   -> Maybe Text
   -> Maybe Bool
   -> SuiteDefinitionInformation)
-> Parser (Maybe [DeviceUnderTest])
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Bool -> SuiteDefinitionInformation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [DeviceUnderTest]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"defaultDevices" Parser (Maybe (Maybe [DeviceUnderTest]))
-> Maybe [DeviceUnderTest] -> Parser (Maybe [DeviceUnderTest])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [DeviceUnderTest]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Bool -> SuiteDefinitionInformation)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Bool -> SuiteDefinitionInformation)
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
"suiteDefinitionId")
            Parser (Maybe Text -> Maybe Bool -> SuiteDefinitionInformation)
-> Parser (Maybe Text)
-> Parser (Maybe Bool -> SuiteDefinitionInformation)
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
"suiteDefinitionName")
            Parser (Maybe Bool -> SuiteDefinitionInformation)
-> Parser (Maybe Bool) -> Parser SuiteDefinitionInformation
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
"intendedForQualification")
      )

instance Prelude.Hashable SuiteDefinitionInformation

instance Prelude.NFData SuiteDefinitionInformation