{-# 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.GreengrassV2.Types.ComponentVersionListItem
-- 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.GreengrassV2.Types.ComponentVersionListItem where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Contains information about a component version in a list.
--
-- /See:/ 'newComponentVersionListItem' smart constructor.
data ComponentVersionListItem = ComponentVersionListItem'
  { -- | The
    -- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html ARN>
    -- of the component version.
    ComponentVersionListItem -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The version of the component.
    ComponentVersionListItem -> Maybe Text
componentVersion :: Prelude.Maybe Prelude.Text,
    -- | The name of the component.
    ComponentVersionListItem -> Maybe Text
componentName :: Prelude.Maybe Prelude.Text
  }
  deriving (ComponentVersionListItem -> ComponentVersionListItem -> Bool
(ComponentVersionListItem -> ComponentVersionListItem -> Bool)
-> (ComponentVersionListItem -> ComponentVersionListItem -> Bool)
-> Eq ComponentVersionListItem
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ComponentVersionListItem -> ComponentVersionListItem -> Bool
$c/= :: ComponentVersionListItem -> ComponentVersionListItem -> Bool
== :: ComponentVersionListItem -> ComponentVersionListItem -> Bool
$c== :: ComponentVersionListItem -> ComponentVersionListItem -> Bool
Prelude.Eq, ReadPrec [ComponentVersionListItem]
ReadPrec ComponentVersionListItem
Int -> ReadS ComponentVersionListItem
ReadS [ComponentVersionListItem]
(Int -> ReadS ComponentVersionListItem)
-> ReadS [ComponentVersionListItem]
-> ReadPrec ComponentVersionListItem
-> ReadPrec [ComponentVersionListItem]
-> Read ComponentVersionListItem
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ComponentVersionListItem]
$creadListPrec :: ReadPrec [ComponentVersionListItem]
readPrec :: ReadPrec ComponentVersionListItem
$creadPrec :: ReadPrec ComponentVersionListItem
readList :: ReadS [ComponentVersionListItem]
$creadList :: ReadS [ComponentVersionListItem]
readsPrec :: Int -> ReadS ComponentVersionListItem
$creadsPrec :: Int -> ReadS ComponentVersionListItem
Prelude.Read, Int -> ComponentVersionListItem -> ShowS
[ComponentVersionListItem] -> ShowS
ComponentVersionListItem -> String
(Int -> ComponentVersionListItem -> ShowS)
-> (ComponentVersionListItem -> String)
-> ([ComponentVersionListItem] -> ShowS)
-> Show ComponentVersionListItem
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ComponentVersionListItem] -> ShowS
$cshowList :: [ComponentVersionListItem] -> ShowS
show :: ComponentVersionListItem -> String
$cshow :: ComponentVersionListItem -> String
showsPrec :: Int -> ComponentVersionListItem -> ShowS
$cshowsPrec :: Int -> ComponentVersionListItem -> ShowS
Prelude.Show, (forall x.
 ComponentVersionListItem -> Rep ComponentVersionListItem x)
-> (forall x.
    Rep ComponentVersionListItem x -> ComponentVersionListItem)
-> Generic ComponentVersionListItem
forall x.
Rep ComponentVersionListItem x -> ComponentVersionListItem
forall x.
ComponentVersionListItem -> Rep ComponentVersionListItem x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ComponentVersionListItem x -> ComponentVersionListItem
$cfrom :: forall x.
ComponentVersionListItem -> Rep ComponentVersionListItem x
Prelude.Generic)

-- |
-- Create a value of 'ComponentVersionListItem' 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:
--
-- 'arn', 'componentVersionListItem_arn' - The
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html ARN>
-- of the component version.
--
-- 'componentVersion', 'componentVersionListItem_componentVersion' - The version of the component.
--
-- 'componentName', 'componentVersionListItem_componentName' - The name of the component.
newComponentVersionListItem ::
  ComponentVersionListItem
newComponentVersionListItem :: ComponentVersionListItem
newComponentVersionListItem =
  ComponentVersionListItem' :: Maybe Text -> Maybe Text -> Maybe Text -> ComponentVersionListItem
ComponentVersionListItem'
    { $sel:arn:ComponentVersionListItem' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:componentVersion:ComponentVersionListItem' :: Maybe Text
componentVersion = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:componentName:ComponentVersionListItem' :: Maybe Text
componentName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The
-- <https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html ARN>
-- of the component version.
componentVersionListItem_arn :: Lens.Lens' ComponentVersionListItem (Prelude.Maybe Prelude.Text)
componentVersionListItem_arn :: (Maybe Text -> f (Maybe Text))
-> ComponentVersionListItem -> f ComponentVersionListItem
componentVersionListItem_arn = (ComponentVersionListItem -> Maybe Text)
-> (ComponentVersionListItem
    -> Maybe Text -> ComponentVersionListItem)
-> Lens
     ComponentVersionListItem
     ComponentVersionListItem
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentVersionListItem' {Maybe Text
arn :: Maybe Text
$sel:arn:ComponentVersionListItem' :: ComponentVersionListItem -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ComponentVersionListItem
s@ComponentVersionListItem' {} Maybe Text
a -> ComponentVersionListItem
s {$sel:arn:ComponentVersionListItem' :: Maybe Text
arn = Maybe Text
a} :: ComponentVersionListItem)

-- | The version of the component.
componentVersionListItem_componentVersion :: Lens.Lens' ComponentVersionListItem (Prelude.Maybe Prelude.Text)
componentVersionListItem_componentVersion :: (Maybe Text -> f (Maybe Text))
-> ComponentVersionListItem -> f ComponentVersionListItem
componentVersionListItem_componentVersion = (ComponentVersionListItem -> Maybe Text)
-> (ComponentVersionListItem
    -> Maybe Text -> ComponentVersionListItem)
-> Lens
     ComponentVersionListItem
     ComponentVersionListItem
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentVersionListItem' {Maybe Text
componentVersion :: Maybe Text
$sel:componentVersion:ComponentVersionListItem' :: ComponentVersionListItem -> Maybe Text
componentVersion} -> Maybe Text
componentVersion) (\s :: ComponentVersionListItem
s@ComponentVersionListItem' {} Maybe Text
a -> ComponentVersionListItem
s {$sel:componentVersion:ComponentVersionListItem' :: Maybe Text
componentVersion = Maybe Text
a} :: ComponentVersionListItem)

-- | The name of the component.
componentVersionListItem_componentName :: Lens.Lens' ComponentVersionListItem (Prelude.Maybe Prelude.Text)
componentVersionListItem_componentName :: (Maybe Text -> f (Maybe Text))
-> ComponentVersionListItem -> f ComponentVersionListItem
componentVersionListItem_componentName = (ComponentVersionListItem -> Maybe Text)
-> (ComponentVersionListItem
    -> Maybe Text -> ComponentVersionListItem)
-> Lens
     ComponentVersionListItem
     ComponentVersionListItem
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentVersionListItem' {Maybe Text
componentName :: Maybe Text
$sel:componentName:ComponentVersionListItem' :: ComponentVersionListItem -> Maybe Text
componentName} -> Maybe Text
componentName) (\s :: ComponentVersionListItem
s@ComponentVersionListItem' {} Maybe Text
a -> ComponentVersionListItem
s {$sel:componentName:ComponentVersionListItem' :: Maybe Text
componentName = Maybe Text
a} :: ComponentVersionListItem)

instance Core.FromJSON ComponentVersionListItem where
  parseJSON :: Value -> Parser ComponentVersionListItem
parseJSON =
    String
-> (Object -> Parser ComponentVersionListItem)
-> Value
-> Parser ComponentVersionListItem
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ComponentVersionListItem"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> Maybe Text -> ComponentVersionListItem
ComponentVersionListItem'
            (Maybe Text
 -> Maybe Text -> Maybe Text -> ComponentVersionListItem)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> ComponentVersionListItem)
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 Text -> Maybe Text -> ComponentVersionListItem)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> ComponentVersionListItem)
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
"componentVersion")
            Parser (Maybe Text -> ComponentVersionListItem)
-> Parser (Maybe Text) -> Parser ComponentVersionListItem
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
"componentName")
      )

instance Prelude.Hashable ComponentVersionListItem

instance Prelude.NFData ComponentVersionListItem