{-# 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.ImageBuilder.Types.Component
-- 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.ImageBuilder.Types.Component where

import qualified Amazonka.Core as Core
import Amazonka.ImageBuilder.Types.ComponentParameterDetail
import Amazonka.ImageBuilder.Types.ComponentState
import Amazonka.ImageBuilder.Types.ComponentType
import Amazonka.ImageBuilder.Types.Platform
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | A detailed view of a component.
--
-- /See:/ 'newComponent' smart constructor.
data Component = Component'
  { -- | Describes the current status of the component. This is used for
    -- components that are no longer active.
    Component -> Maybe ComponentState
state :: Prelude.Maybe ComponentState,
    -- | The platform of the component.
    Component -> Maybe Platform
platform :: Prelude.Maybe Platform,
    -- | The Amazon Resource Name (ARN) of the component.
    Component -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The data of the component.
    Component -> Maybe Text
data' :: Prelude.Maybe Prelude.Text,
    -- | The operating system (OS) version supported by the component. If the OS
    -- information is available, a prefix match is performed against the base
    -- image OS version during image recipe creation.
    Component -> Maybe (NonEmpty Text)
supportedOsVersions :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
    -- | The encryption status of the component.
    Component -> Maybe Bool
encrypted :: Prelude.Maybe Prelude.Bool,
    -- | The owner of the component.
    Component -> Maybe Text
owner :: Prelude.Maybe Prelude.Text,
    -- | The date that the component was created.
    Component -> Maybe Text
dateCreated :: Prelude.Maybe Prelude.Text,
    -- | The name of the component.
    Component -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The KMS key identifier used to encrypt the component.
    Component -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
    -- | The version of the component.
    Component -> Maybe Text
version :: Prelude.Maybe Prelude.Text,
    -- | Contains parameter details for each of the parameters that are defined
    -- for the component.
    Component -> Maybe [ComponentParameterDetail]
parameters :: Prelude.Maybe [ComponentParameterDetail],
    -- | The change description of the component.
    Component -> Maybe Text
changeDescription :: Prelude.Maybe Prelude.Text,
    -- | The type of the component denotes whether the component is used to build
    -- the image or only to test it.
    Component -> Maybe ComponentType
type' :: Prelude.Maybe ComponentType,
    -- | The description of the component.
    Component -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The tags associated with the component.
    Component -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (Component -> Component -> Bool
(Component -> Component -> Bool)
-> (Component -> Component -> Bool) -> Eq Component
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Component -> Component -> Bool
$c/= :: Component -> Component -> Bool
== :: Component -> Component -> Bool
$c== :: Component -> Component -> Bool
Prelude.Eq, ReadPrec [Component]
ReadPrec Component
Int -> ReadS Component
ReadS [Component]
(Int -> ReadS Component)
-> ReadS [Component]
-> ReadPrec Component
-> ReadPrec [Component]
-> Read Component
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Component]
$creadListPrec :: ReadPrec [Component]
readPrec :: ReadPrec Component
$creadPrec :: ReadPrec Component
readList :: ReadS [Component]
$creadList :: ReadS [Component]
readsPrec :: Int -> ReadS Component
$creadsPrec :: Int -> ReadS Component
Prelude.Read, Int -> Component -> ShowS
[Component] -> ShowS
Component -> String
(Int -> Component -> ShowS)
-> (Component -> String)
-> ([Component] -> ShowS)
-> Show Component
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Component] -> ShowS
$cshowList :: [Component] -> ShowS
show :: Component -> String
$cshow :: Component -> String
showsPrec :: Int -> Component -> ShowS
$cshowsPrec :: Int -> Component -> ShowS
Prelude.Show, (forall x. Component -> Rep Component x)
-> (forall x. Rep Component x -> Component) -> Generic Component
forall x. Rep Component x -> Component
forall x. Component -> Rep Component x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Component x -> Component
$cfrom :: forall x. Component -> Rep Component x
Prelude.Generic)

-- |
-- Create a value of 'Component' 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:
--
-- 'state', 'component_state' - Describes the current status of the component. This is used for
-- components that are no longer active.
--
-- 'platform', 'component_platform' - The platform of the component.
--
-- 'arn', 'component_arn' - The Amazon Resource Name (ARN) of the component.
--
-- 'data'', 'component_data' - The data of the component.
--
-- 'supportedOsVersions', 'component_supportedOsVersions' - The operating system (OS) version supported by the component. If the OS
-- information is available, a prefix match is performed against the base
-- image OS version during image recipe creation.
--
-- 'encrypted', 'component_encrypted' - The encryption status of the component.
--
-- 'owner', 'component_owner' - The owner of the component.
--
-- 'dateCreated', 'component_dateCreated' - The date that the component was created.
--
-- 'name', 'component_name' - The name of the component.
--
-- 'kmsKeyId', 'component_kmsKeyId' - The KMS key identifier used to encrypt the component.
--
-- 'version', 'component_version' - The version of the component.
--
-- 'parameters', 'component_parameters' - Contains parameter details for each of the parameters that are defined
-- for the component.
--
-- 'changeDescription', 'component_changeDescription' - The change description of the component.
--
-- 'type'', 'component_type' - The type of the component denotes whether the component is used to build
-- the image or only to test it.
--
-- 'description', 'component_description' - The description of the component.
--
-- 'tags', 'component_tags' - The tags associated with the component.
newComponent ::
  Component
newComponent :: Component
newComponent =
  Component' :: Maybe ComponentState
-> Maybe Platform
-> Maybe Text
-> Maybe Text
-> Maybe (NonEmpty Text)
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [ComponentParameterDetail]
-> Maybe Text
-> Maybe ComponentType
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Component
Component'
    { $sel:state:Component' :: Maybe ComponentState
state = Maybe ComponentState
forall a. Maybe a
Prelude.Nothing,
      $sel:platform:Component' :: Maybe Platform
platform = Maybe Platform
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:Component' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:data':Component' :: Maybe Text
data' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:supportedOsVersions:Component' :: Maybe (NonEmpty Text)
supportedOsVersions = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
      $sel:encrypted:Component' :: Maybe Bool
encrypted = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:owner:Component' :: Maybe Text
owner = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:dateCreated:Component' :: Maybe Text
dateCreated = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:Component' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:kmsKeyId:Component' :: Maybe Text
kmsKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:version:Component' :: Maybe Text
version = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:parameters:Component' :: Maybe [ComponentParameterDetail]
parameters = Maybe [ComponentParameterDetail]
forall a. Maybe a
Prelude.Nothing,
      $sel:changeDescription:Component' :: Maybe Text
changeDescription = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:type':Component' :: Maybe ComponentType
type' = Maybe ComponentType
forall a. Maybe a
Prelude.Nothing,
      $sel:description:Component' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:Component' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
    }

-- | Describes the current status of the component. This is used for
-- components that are no longer active.
component_state :: Lens.Lens' Component (Prelude.Maybe ComponentState)
component_state :: (Maybe ComponentState -> f (Maybe ComponentState))
-> Component -> f Component
component_state = (Component -> Maybe ComponentState)
-> (Component -> Maybe ComponentState -> Component)
-> Lens
     Component Component (Maybe ComponentState) (Maybe ComponentState)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Component' {Maybe ComponentState
state :: Maybe ComponentState
$sel:state:Component' :: Component -> Maybe ComponentState
state} -> Maybe ComponentState
state) (\s :: Component
s@Component' {} Maybe ComponentState
a -> Component
s {$sel:state:Component' :: Maybe ComponentState
state = Maybe ComponentState
a} :: Component)

-- | The platform of the component.
component_platform :: Lens.Lens' Component (Prelude.Maybe Platform)
component_platform :: (Maybe Platform -> f (Maybe Platform)) -> Component -> f Component
component_platform = (Component -> Maybe Platform)
-> (Component -> Maybe Platform -> Component)
-> Lens Component Component (Maybe Platform) (Maybe Platform)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Component' {Maybe Platform
platform :: Maybe Platform
$sel:platform:Component' :: Component -> Maybe Platform
platform} -> Maybe Platform
platform) (\s :: Component
s@Component' {} Maybe Platform
a -> Component
s {$sel:platform:Component' :: Maybe Platform
platform = Maybe Platform
a} :: Component)

-- | The Amazon Resource Name (ARN) of the component.
component_arn :: Lens.Lens' Component (Prelude.Maybe Prelude.Text)
component_arn :: (Maybe Text -> f (Maybe Text)) -> Component -> f Component
component_arn = (Component -> Maybe Text)
-> (Component -> Maybe Text -> Component)
-> Lens Component Component (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Component' {Maybe Text
arn :: Maybe Text
$sel:arn:Component' :: Component -> Maybe Text
arn} -> Maybe Text
arn) (\s :: Component
s@Component' {} Maybe Text
a -> Component
s {$sel:arn:Component' :: Maybe Text
arn = Maybe Text
a} :: Component)

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

-- | The operating system (OS) version supported by the component. If the OS
-- information is available, a prefix match is performed against the base
-- image OS version during image recipe creation.
component_supportedOsVersions :: Lens.Lens' Component (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
component_supportedOsVersions :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> Component -> f Component
component_supportedOsVersions = (Component -> Maybe (NonEmpty Text))
-> (Component -> Maybe (NonEmpty Text) -> Component)
-> Lens
     Component Component (Maybe (NonEmpty Text)) (Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Component' {Maybe (NonEmpty Text)
supportedOsVersions :: Maybe (NonEmpty Text)
$sel:supportedOsVersions:Component' :: Component -> Maybe (NonEmpty Text)
supportedOsVersions} -> Maybe (NonEmpty Text)
supportedOsVersions) (\s :: Component
s@Component' {} Maybe (NonEmpty Text)
a -> Component
s {$sel:supportedOsVersions:Component' :: Maybe (NonEmpty Text)
supportedOsVersions = Maybe (NonEmpty Text)
a} :: Component) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
 -> Component -> f Component)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
    -> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> Component
-> f Component
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty Text))
     (Maybe (NonEmpty 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
  (NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The encryption status of the component.
component_encrypted :: Lens.Lens' Component (Prelude.Maybe Prelude.Bool)
component_encrypted :: (Maybe Bool -> f (Maybe Bool)) -> Component -> f Component
component_encrypted = (Component -> Maybe Bool)
-> (Component -> Maybe Bool -> Component)
-> Lens Component Component (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Component' {Maybe Bool
encrypted :: Maybe Bool
$sel:encrypted:Component' :: Component -> Maybe Bool
encrypted} -> Maybe Bool
encrypted) (\s :: Component
s@Component' {} Maybe Bool
a -> Component
s {$sel:encrypted:Component' :: Maybe Bool
encrypted = Maybe Bool
a} :: Component)

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

-- | The date that the component was created.
component_dateCreated :: Lens.Lens' Component (Prelude.Maybe Prelude.Text)
component_dateCreated :: (Maybe Text -> f (Maybe Text)) -> Component -> f Component
component_dateCreated = (Component -> Maybe Text)
-> (Component -> Maybe Text -> Component)
-> Lens Component Component (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Component' {Maybe Text
dateCreated :: Maybe Text
$sel:dateCreated:Component' :: Component -> Maybe Text
dateCreated} -> Maybe Text
dateCreated) (\s :: Component
s@Component' {} Maybe Text
a -> Component
s {$sel:dateCreated:Component' :: Maybe Text
dateCreated = Maybe Text
a} :: Component)

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

-- | The KMS key identifier used to encrypt the component.
component_kmsKeyId :: Lens.Lens' Component (Prelude.Maybe Prelude.Text)
component_kmsKeyId :: (Maybe Text -> f (Maybe Text)) -> Component -> f Component
component_kmsKeyId = (Component -> Maybe Text)
-> (Component -> Maybe Text -> Component)
-> Lens Component Component (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Component' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:Component' :: Component -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: Component
s@Component' {} Maybe Text
a -> Component
s {$sel:kmsKeyId:Component' :: Maybe Text
kmsKeyId = Maybe Text
a} :: Component)

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

-- | Contains parameter details for each of the parameters that are defined
-- for the component.
component_parameters :: Lens.Lens' Component (Prelude.Maybe [ComponentParameterDetail])
component_parameters :: (Maybe [ComponentParameterDetail]
 -> f (Maybe [ComponentParameterDetail]))
-> Component -> f Component
component_parameters = (Component -> Maybe [ComponentParameterDetail])
-> (Component -> Maybe [ComponentParameterDetail] -> Component)
-> Lens
     Component
     Component
     (Maybe [ComponentParameterDetail])
     (Maybe [ComponentParameterDetail])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Component' {Maybe [ComponentParameterDetail]
parameters :: Maybe [ComponentParameterDetail]
$sel:parameters:Component' :: Component -> Maybe [ComponentParameterDetail]
parameters} -> Maybe [ComponentParameterDetail]
parameters) (\s :: Component
s@Component' {} Maybe [ComponentParameterDetail]
a -> Component
s {$sel:parameters:Component' :: Maybe [ComponentParameterDetail]
parameters = Maybe [ComponentParameterDetail]
a} :: Component) ((Maybe [ComponentParameterDetail]
  -> f (Maybe [ComponentParameterDetail]))
 -> Component -> f Component)
-> ((Maybe [ComponentParameterDetail]
     -> f (Maybe [ComponentParameterDetail]))
    -> Maybe [ComponentParameterDetail]
    -> f (Maybe [ComponentParameterDetail]))
-> (Maybe [ComponentParameterDetail]
    -> f (Maybe [ComponentParameterDetail]))
-> Component
-> f Component
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ComponentParameterDetail]
  [ComponentParameterDetail]
  [ComponentParameterDetail]
  [ComponentParameterDetail]
-> Iso
     (Maybe [ComponentParameterDetail])
     (Maybe [ComponentParameterDetail])
     (Maybe [ComponentParameterDetail])
     (Maybe [ComponentParameterDetail])
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
  [ComponentParameterDetail]
  [ComponentParameterDetail]
  [ComponentParameterDetail]
  [ComponentParameterDetail]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The change description of the component.
component_changeDescription :: Lens.Lens' Component (Prelude.Maybe Prelude.Text)
component_changeDescription :: (Maybe Text -> f (Maybe Text)) -> Component -> f Component
component_changeDescription = (Component -> Maybe Text)
-> (Component -> Maybe Text -> Component)
-> Lens Component Component (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Component' {Maybe Text
changeDescription :: Maybe Text
$sel:changeDescription:Component' :: Component -> Maybe Text
changeDescription} -> Maybe Text
changeDescription) (\s :: Component
s@Component' {} Maybe Text
a -> Component
s {$sel:changeDescription:Component' :: Maybe Text
changeDescription = Maybe Text
a} :: Component)

-- | The type of the component denotes whether the component is used to build
-- the image or only to test it.
component_type :: Lens.Lens' Component (Prelude.Maybe ComponentType)
component_type :: (Maybe ComponentType -> f (Maybe ComponentType))
-> Component -> f Component
component_type = (Component -> Maybe ComponentType)
-> (Component -> Maybe ComponentType -> Component)
-> Lens
     Component Component (Maybe ComponentType) (Maybe ComponentType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Component' {Maybe ComponentType
type' :: Maybe ComponentType
$sel:type':Component' :: Component -> Maybe ComponentType
type'} -> Maybe ComponentType
type') (\s :: Component
s@Component' {} Maybe ComponentType
a -> Component
s {$sel:type':Component' :: Maybe ComponentType
type' = Maybe ComponentType
a} :: Component)

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

-- | The tags associated with the component.
component_tags :: Lens.Lens' Component (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
component_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Component -> f Component
component_tags = (Component -> Maybe (HashMap Text Text))
-> (Component -> Maybe (HashMap Text Text) -> Component)
-> Lens
     Component
     Component
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Component' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:Component' :: Component -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: Component
s@Component' {} Maybe (HashMap Text Text)
a -> Component
s {$sel:tags:Component' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: Component) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> Component -> f Component)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Component
-> f Component
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text 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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON Component where
  parseJSON :: Value -> Parser Component
parseJSON =
    String -> (Object -> Parser Component) -> Value -> Parser Component
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Component"
      ( \Object
x ->
          Maybe ComponentState
-> Maybe Platform
-> Maybe Text
-> Maybe Text
-> Maybe (NonEmpty Text)
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [ComponentParameterDetail]
-> Maybe Text
-> Maybe ComponentType
-> Maybe Text
-> Maybe (HashMap Text Text)
-> Component
Component'
            (Maybe ComponentState
 -> Maybe Platform
 -> Maybe Text
 -> Maybe Text
 -> Maybe (NonEmpty Text)
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe [ComponentParameterDetail]
 -> Maybe Text
 -> Maybe ComponentType
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> Component)
-> Parser (Maybe ComponentState)
-> Parser
     (Maybe Platform
      -> Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [ComponentParameterDetail]
      -> Maybe Text
      -> Maybe ComponentType
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Component)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ComponentState)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"state")
            Parser
  (Maybe Platform
   -> Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [ComponentParameterDetail]
   -> Maybe Text
   -> Maybe ComponentType
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Component)
-> Parser (Maybe Platform)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [ComponentParameterDetail]
      -> Maybe Text
      -> Maybe ComponentType
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Component)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Platform)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"platform")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [ComponentParameterDetail]
   -> Maybe Text
   -> Maybe ComponentType
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Component)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe (NonEmpty Text)
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [ComponentParameterDetail]
      -> Maybe Text
      -> Maybe ComponentType
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Component)
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
"arn")
            Parser
  (Maybe Text
   -> Maybe (NonEmpty Text)
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [ComponentParameterDetail]
   -> Maybe Text
   -> Maybe ComponentType
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Component)
-> Parser (Maybe Text)
-> Parser
     (Maybe (NonEmpty Text)
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [ComponentParameterDetail]
      -> Maybe Text
      -> Maybe ComponentType
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Component)
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
"data")
            Parser
  (Maybe (NonEmpty Text)
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [ComponentParameterDetail]
   -> Maybe Text
   -> Maybe ComponentType
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Component)
-> Parser (Maybe (NonEmpty Text))
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [ComponentParameterDetail]
      -> Maybe Text
      -> Maybe ComponentType
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Component)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty Text))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"supportedOsVersions")
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [ComponentParameterDetail]
   -> Maybe Text
   -> Maybe ComponentType
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Component)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [ComponentParameterDetail]
      -> Maybe Text
      -> Maybe ComponentType
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Component)
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
"encrypted")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [ComponentParameterDetail]
   -> Maybe Text
   -> Maybe ComponentType
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Component)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [ComponentParameterDetail]
      -> Maybe Text
      -> Maybe ComponentType
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Component)
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
"owner")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [ComponentParameterDetail]
   -> Maybe Text
   -> Maybe ComponentType
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Component)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [ComponentParameterDetail]
      -> Maybe Text
      -> Maybe ComponentType
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Component)
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
"dateCreated")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [ComponentParameterDetail]
   -> Maybe Text
   -> Maybe ComponentType
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Component)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe [ComponentParameterDetail]
      -> Maybe Text
      -> Maybe ComponentType
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Component)
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 Text
   -> Maybe [ComponentParameterDetail]
   -> Maybe Text
   -> Maybe ComponentType
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Component)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [ComponentParameterDetail]
      -> Maybe Text
      -> Maybe ComponentType
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Component)
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
"kmsKeyId")
            Parser
  (Maybe Text
   -> Maybe [ComponentParameterDetail]
   -> Maybe Text
   -> Maybe ComponentType
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Component)
-> Parser (Maybe Text)
-> Parser
     (Maybe [ComponentParameterDetail]
      -> Maybe Text
      -> Maybe ComponentType
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Component)
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
"version")
            Parser
  (Maybe [ComponentParameterDetail]
   -> Maybe Text
   -> Maybe ComponentType
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Component)
-> Parser (Maybe [ComponentParameterDetail])
-> Parser
     (Maybe Text
      -> Maybe ComponentType
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> Component)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [ComponentParameterDetail]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"parameters" Parser (Maybe (Maybe [ComponentParameterDetail]))
-> Maybe [ComponentParameterDetail]
-> Parser (Maybe [ComponentParameterDetail])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ComponentParameterDetail]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe ComponentType
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> Component)
-> Parser (Maybe Text)
-> Parser
     (Maybe ComponentType
      -> Maybe Text -> Maybe (HashMap Text Text) -> Component)
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
"changeDescription")
            Parser
  (Maybe ComponentType
   -> Maybe Text -> Maybe (HashMap Text Text) -> Component)
-> Parser (Maybe ComponentType)
-> Parser (Maybe Text -> Maybe (HashMap Text Text) -> Component)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ComponentType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"type")
            Parser (Maybe Text -> Maybe (HashMap Text Text) -> Component)
-> Parser (Maybe Text)
-> Parser (Maybe (HashMap Text Text) -> Component)
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")
            Parser (Maybe (HashMap Text Text) -> Component)
-> Parser (Maybe (HashMap Text Text)) -> Parser Component
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable Component

instance Prelude.NFData Component