{-# 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.GroundStation.Types.ConfigListItem
-- 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.GroundStation.Types.ConfigListItem where

import qualified Amazonka.Core as Core
import Amazonka.GroundStation.Types.ConfigCapabilityType
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | An item in a list of @Config@ objects.
--
-- /See:/ 'newConfigListItem' smart constructor.
data ConfigListItem = ConfigListItem'
  { -- | ARN of a @Config@.
    ConfigListItem -> Maybe Text
configArn :: Prelude.Maybe Prelude.Text,
    -- | Name of a @Config@.
    ConfigListItem -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | UUID of a @Config@.
    ConfigListItem -> Maybe Text
configId :: Prelude.Maybe Prelude.Text,
    -- | Type of a @Config@.
    ConfigListItem -> Maybe ConfigCapabilityType
configType :: Prelude.Maybe ConfigCapabilityType
  }
  deriving (ConfigListItem -> ConfigListItem -> Bool
(ConfigListItem -> ConfigListItem -> Bool)
-> (ConfigListItem -> ConfigListItem -> Bool) -> Eq ConfigListItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ConfigListItem -> ConfigListItem -> Bool
$c/= :: ConfigListItem -> ConfigListItem -> Bool
== :: ConfigListItem -> ConfigListItem -> Bool
$c== :: ConfigListItem -> ConfigListItem -> Bool
Prelude.Eq, ReadPrec [ConfigListItem]
ReadPrec ConfigListItem
Int -> ReadS ConfigListItem
ReadS [ConfigListItem]
(Int -> ReadS ConfigListItem)
-> ReadS [ConfigListItem]
-> ReadPrec ConfigListItem
-> ReadPrec [ConfigListItem]
-> Read ConfigListItem
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ConfigListItem]
$creadListPrec :: ReadPrec [ConfigListItem]
readPrec :: ReadPrec ConfigListItem
$creadPrec :: ReadPrec ConfigListItem
readList :: ReadS [ConfigListItem]
$creadList :: ReadS [ConfigListItem]
readsPrec :: Int -> ReadS ConfigListItem
$creadsPrec :: Int -> ReadS ConfigListItem
Prelude.Read, Int -> ConfigListItem -> ShowS
[ConfigListItem] -> ShowS
ConfigListItem -> String
(Int -> ConfigListItem -> ShowS)
-> (ConfigListItem -> String)
-> ([ConfigListItem] -> ShowS)
-> Show ConfigListItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ConfigListItem] -> ShowS
$cshowList :: [ConfigListItem] -> ShowS
show :: ConfigListItem -> String
$cshow :: ConfigListItem -> String
showsPrec :: Int -> ConfigListItem -> ShowS
$cshowsPrec :: Int -> ConfigListItem -> ShowS
Prelude.Show, (forall x. ConfigListItem -> Rep ConfigListItem x)
-> (forall x. Rep ConfigListItem x -> ConfigListItem)
-> Generic ConfigListItem
forall x. Rep ConfigListItem x -> ConfigListItem
forall x. ConfigListItem -> Rep ConfigListItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ConfigListItem x -> ConfigListItem
$cfrom :: forall x. ConfigListItem -> Rep ConfigListItem x
Prelude.Generic)

-- |
-- Create a value of 'ConfigListItem' 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:
--
-- 'configArn', 'configListItem_configArn' - ARN of a @Config@.
--
-- 'name', 'configListItem_name' - Name of a @Config@.
--
-- 'configId', 'configListItem_configId' - UUID of a @Config@.
--
-- 'configType', 'configListItem_configType' - Type of a @Config@.
newConfigListItem ::
  ConfigListItem
newConfigListItem :: ConfigListItem
newConfigListItem =
  ConfigListItem' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ConfigCapabilityType
-> ConfigListItem
ConfigListItem'
    { $sel:configArn:ConfigListItem' :: Maybe Text
configArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ConfigListItem' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:configId:ConfigListItem' :: Maybe Text
configId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:configType:ConfigListItem' :: Maybe ConfigCapabilityType
configType = Maybe ConfigCapabilityType
forall a. Maybe a
Prelude.Nothing
    }

-- | ARN of a @Config@.
configListItem_configArn :: Lens.Lens' ConfigListItem (Prelude.Maybe Prelude.Text)
configListItem_configArn :: (Maybe Text -> f (Maybe Text))
-> ConfigListItem -> f ConfigListItem
configListItem_configArn = (ConfigListItem -> Maybe Text)
-> (ConfigListItem -> Maybe Text -> ConfigListItem)
-> Lens ConfigListItem ConfigListItem (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigListItem' {Maybe Text
configArn :: Maybe Text
$sel:configArn:ConfigListItem' :: ConfigListItem -> Maybe Text
configArn} -> Maybe Text
configArn) (\s :: ConfigListItem
s@ConfigListItem' {} Maybe Text
a -> ConfigListItem
s {$sel:configArn:ConfigListItem' :: Maybe Text
configArn = Maybe Text
a} :: ConfigListItem)

-- | Name of a @Config@.
configListItem_name :: Lens.Lens' ConfigListItem (Prelude.Maybe Prelude.Text)
configListItem_name :: (Maybe Text -> f (Maybe Text))
-> ConfigListItem -> f ConfigListItem
configListItem_name = (ConfigListItem -> Maybe Text)
-> (ConfigListItem -> Maybe Text -> ConfigListItem)
-> Lens ConfigListItem ConfigListItem (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigListItem' {Maybe Text
name :: Maybe Text
$sel:name:ConfigListItem' :: ConfigListItem -> Maybe Text
name} -> Maybe Text
name) (\s :: ConfigListItem
s@ConfigListItem' {} Maybe Text
a -> ConfigListItem
s {$sel:name:ConfigListItem' :: Maybe Text
name = Maybe Text
a} :: ConfigListItem)

-- | UUID of a @Config@.
configListItem_configId :: Lens.Lens' ConfigListItem (Prelude.Maybe Prelude.Text)
configListItem_configId :: (Maybe Text -> f (Maybe Text))
-> ConfigListItem -> f ConfigListItem
configListItem_configId = (ConfigListItem -> Maybe Text)
-> (ConfigListItem -> Maybe Text -> ConfigListItem)
-> Lens ConfigListItem ConfigListItem (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigListItem' {Maybe Text
configId :: Maybe Text
$sel:configId:ConfigListItem' :: ConfigListItem -> Maybe Text
configId} -> Maybe Text
configId) (\s :: ConfigListItem
s@ConfigListItem' {} Maybe Text
a -> ConfigListItem
s {$sel:configId:ConfigListItem' :: Maybe Text
configId = Maybe Text
a} :: ConfigListItem)

-- | Type of a @Config@.
configListItem_configType :: Lens.Lens' ConfigListItem (Prelude.Maybe ConfigCapabilityType)
configListItem_configType :: (Maybe ConfigCapabilityType -> f (Maybe ConfigCapabilityType))
-> ConfigListItem -> f ConfigListItem
configListItem_configType = (ConfigListItem -> Maybe ConfigCapabilityType)
-> (ConfigListItem -> Maybe ConfigCapabilityType -> ConfigListItem)
-> Lens
     ConfigListItem
     ConfigListItem
     (Maybe ConfigCapabilityType)
     (Maybe ConfigCapabilityType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ConfigListItem' {Maybe ConfigCapabilityType
configType :: Maybe ConfigCapabilityType
$sel:configType:ConfigListItem' :: ConfigListItem -> Maybe ConfigCapabilityType
configType} -> Maybe ConfigCapabilityType
configType) (\s :: ConfigListItem
s@ConfigListItem' {} Maybe ConfigCapabilityType
a -> ConfigListItem
s {$sel:configType:ConfigListItem' :: Maybe ConfigCapabilityType
configType = Maybe ConfigCapabilityType
a} :: ConfigListItem)

instance Core.FromJSON ConfigListItem where
  parseJSON :: Value -> Parser ConfigListItem
parseJSON =
    String
-> (Object -> Parser ConfigListItem)
-> Value
-> Parser ConfigListItem
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ConfigListItem"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe ConfigCapabilityType
-> ConfigListItem
ConfigListItem'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe ConfigCapabilityType
 -> ConfigListItem)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe ConfigCapabilityType -> ConfigListItem)
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
"configArn")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe ConfigCapabilityType -> ConfigListItem)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> Maybe ConfigCapabilityType -> ConfigListItem)
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 Text -> Maybe ConfigCapabilityType -> ConfigListItem)
-> Parser (Maybe Text)
-> Parser (Maybe ConfigCapabilityType -> ConfigListItem)
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
"configId")
            Parser (Maybe ConfigCapabilityType -> ConfigListItem)
-> Parser (Maybe ConfigCapabilityType) -> Parser ConfigListItem
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ConfigCapabilityType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"configType")
      )

instance Prelude.Hashable ConfigListItem

instance Prelude.NFData ConfigListItem