{-# 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.ServiceCatalogAppRegistry.Types.AttributeGroup
-- 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.ServiceCatalogAppRegistry.Types.AttributeGroup where

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

-- | Represents a Amazon Web Services Service Catalog AppRegistry attribute
-- group that is rich metadata which describes an application and its
-- components.
--
-- /See:/ 'newAttributeGroup' smart constructor.
data AttributeGroup = AttributeGroup'
  { -- | The ISO-8601 formatted timestamp of the moment the attribute group was
    -- created.
    AttributeGroup -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | The Amazon resource name (ARN) that specifies the attribute group across
    -- services.
    AttributeGroup -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The name of the attribute group.
    AttributeGroup -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The globally unique attribute group identifier of the attribute group.
    AttributeGroup -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The ISO-8601 formatted timestamp of the moment the attribute group was
    -- last updated. This time is the same as the creationTime for a newly
    -- created attribute group.
    AttributeGroup -> Maybe POSIX
lastUpdateTime :: Prelude.Maybe Core.POSIX,
    -- | The description of the attribute group that the user provides.
    AttributeGroup -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | Key-value pairs you can use to associate with the attribute group.
    AttributeGroup -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text)
  }
  deriving (AttributeGroup -> AttributeGroup -> Bool
(AttributeGroup -> AttributeGroup -> Bool)
-> (AttributeGroup -> AttributeGroup -> Bool) -> Eq AttributeGroup
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AttributeGroup -> AttributeGroup -> Bool
$c/= :: AttributeGroup -> AttributeGroup -> Bool
== :: AttributeGroup -> AttributeGroup -> Bool
$c== :: AttributeGroup -> AttributeGroup -> Bool
Prelude.Eq, ReadPrec [AttributeGroup]
ReadPrec AttributeGroup
Int -> ReadS AttributeGroup
ReadS [AttributeGroup]
(Int -> ReadS AttributeGroup)
-> ReadS [AttributeGroup]
-> ReadPrec AttributeGroup
-> ReadPrec [AttributeGroup]
-> Read AttributeGroup
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AttributeGroup]
$creadListPrec :: ReadPrec [AttributeGroup]
readPrec :: ReadPrec AttributeGroup
$creadPrec :: ReadPrec AttributeGroup
readList :: ReadS [AttributeGroup]
$creadList :: ReadS [AttributeGroup]
readsPrec :: Int -> ReadS AttributeGroup
$creadsPrec :: Int -> ReadS AttributeGroup
Prelude.Read, Int -> AttributeGroup -> ShowS
[AttributeGroup] -> ShowS
AttributeGroup -> String
(Int -> AttributeGroup -> ShowS)
-> (AttributeGroup -> String)
-> ([AttributeGroup] -> ShowS)
-> Show AttributeGroup
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AttributeGroup] -> ShowS
$cshowList :: [AttributeGroup] -> ShowS
show :: AttributeGroup -> String
$cshow :: AttributeGroup -> String
showsPrec :: Int -> AttributeGroup -> ShowS
$cshowsPrec :: Int -> AttributeGroup -> ShowS
Prelude.Show, (forall x. AttributeGroup -> Rep AttributeGroup x)
-> (forall x. Rep AttributeGroup x -> AttributeGroup)
-> Generic AttributeGroup
forall x. Rep AttributeGroup x -> AttributeGroup
forall x. AttributeGroup -> Rep AttributeGroup x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AttributeGroup x -> AttributeGroup
$cfrom :: forall x. AttributeGroup -> Rep AttributeGroup x
Prelude.Generic)

-- |
-- Create a value of 'AttributeGroup' 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:
--
-- 'creationTime', 'attributeGroup_creationTime' - The ISO-8601 formatted timestamp of the moment the attribute group was
-- created.
--
-- 'arn', 'attributeGroup_arn' - The Amazon resource name (ARN) that specifies the attribute group across
-- services.
--
-- 'name', 'attributeGroup_name' - The name of the attribute group.
--
-- 'id', 'attributeGroup_id' - The globally unique attribute group identifier of the attribute group.
--
-- 'lastUpdateTime', 'attributeGroup_lastUpdateTime' - The ISO-8601 formatted timestamp of the moment the attribute group was
-- last updated. This time is the same as the creationTime for a newly
-- created attribute group.
--
-- 'description', 'attributeGroup_description' - The description of the attribute group that the user provides.
--
-- 'tags', 'attributeGroup_tags' - Key-value pairs you can use to associate with the attribute group.
newAttributeGroup ::
  AttributeGroup
newAttributeGroup :: AttributeGroup
newAttributeGroup =
  AttributeGroup' :: Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe (HashMap Text Text)
-> AttributeGroup
AttributeGroup'
    { $sel:creationTime:AttributeGroup' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:arn:AttributeGroup' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:AttributeGroup' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:AttributeGroup' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdateTime:AttributeGroup' :: Maybe POSIX
lastUpdateTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:description:AttributeGroup' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:AttributeGroup' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing
    }

-- | The ISO-8601 formatted timestamp of the moment the attribute group was
-- created.
attributeGroup_creationTime :: Lens.Lens' AttributeGroup (Prelude.Maybe Prelude.UTCTime)
attributeGroup_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> AttributeGroup -> f AttributeGroup
attributeGroup_creationTime = (AttributeGroup -> Maybe POSIX)
-> (AttributeGroup -> Maybe POSIX -> AttributeGroup)
-> Lens AttributeGroup AttributeGroup (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttributeGroup' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:AttributeGroup' :: AttributeGroup -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: AttributeGroup
s@AttributeGroup' {} Maybe POSIX
a -> AttributeGroup
s {$sel:creationTime:AttributeGroup' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: AttributeGroup) ((Maybe POSIX -> f (Maybe POSIX))
 -> AttributeGroup -> f AttributeGroup)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> AttributeGroup
-> f AttributeGroup
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

-- | The Amazon resource name (ARN) that specifies the attribute group across
-- services.
attributeGroup_arn :: Lens.Lens' AttributeGroup (Prelude.Maybe Prelude.Text)
attributeGroup_arn :: (Maybe Text -> f (Maybe Text))
-> AttributeGroup -> f AttributeGroup
attributeGroup_arn = (AttributeGroup -> Maybe Text)
-> (AttributeGroup -> Maybe Text -> AttributeGroup)
-> Lens AttributeGroup AttributeGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttributeGroup' {Maybe Text
arn :: Maybe Text
$sel:arn:AttributeGroup' :: AttributeGroup -> Maybe Text
arn} -> Maybe Text
arn) (\s :: AttributeGroup
s@AttributeGroup' {} Maybe Text
a -> AttributeGroup
s {$sel:arn:AttributeGroup' :: Maybe Text
arn = Maybe Text
a} :: AttributeGroup)

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

-- | The globally unique attribute group identifier of the attribute group.
attributeGroup_id :: Lens.Lens' AttributeGroup (Prelude.Maybe Prelude.Text)
attributeGroup_id :: (Maybe Text -> f (Maybe Text))
-> AttributeGroup -> f AttributeGroup
attributeGroup_id = (AttributeGroup -> Maybe Text)
-> (AttributeGroup -> Maybe Text -> AttributeGroup)
-> Lens AttributeGroup AttributeGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttributeGroup' {Maybe Text
id :: Maybe Text
$sel:id:AttributeGroup' :: AttributeGroup -> Maybe Text
id} -> Maybe Text
id) (\s :: AttributeGroup
s@AttributeGroup' {} Maybe Text
a -> AttributeGroup
s {$sel:id:AttributeGroup' :: Maybe Text
id = Maybe Text
a} :: AttributeGroup)

-- | The ISO-8601 formatted timestamp of the moment the attribute group was
-- last updated. This time is the same as the creationTime for a newly
-- created attribute group.
attributeGroup_lastUpdateTime :: Lens.Lens' AttributeGroup (Prelude.Maybe Prelude.UTCTime)
attributeGroup_lastUpdateTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> AttributeGroup -> f AttributeGroup
attributeGroup_lastUpdateTime = (AttributeGroup -> Maybe POSIX)
-> (AttributeGroup -> Maybe POSIX -> AttributeGroup)
-> Lens AttributeGroup AttributeGroup (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttributeGroup' {Maybe POSIX
lastUpdateTime :: Maybe POSIX
$sel:lastUpdateTime:AttributeGroup' :: AttributeGroup -> Maybe POSIX
lastUpdateTime} -> Maybe POSIX
lastUpdateTime) (\s :: AttributeGroup
s@AttributeGroup' {} Maybe POSIX
a -> AttributeGroup
s {$sel:lastUpdateTime:AttributeGroup' :: Maybe POSIX
lastUpdateTime = Maybe POSIX
a} :: AttributeGroup) ((Maybe POSIX -> f (Maybe POSIX))
 -> AttributeGroup -> f AttributeGroup)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> AttributeGroup
-> f AttributeGroup
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

-- | The description of the attribute group that the user provides.
attributeGroup_description :: Lens.Lens' AttributeGroup (Prelude.Maybe Prelude.Text)
attributeGroup_description :: (Maybe Text -> f (Maybe Text))
-> AttributeGroup -> f AttributeGroup
attributeGroup_description = (AttributeGroup -> Maybe Text)
-> (AttributeGroup -> Maybe Text -> AttributeGroup)
-> Lens AttributeGroup AttributeGroup (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttributeGroup' {Maybe Text
description :: Maybe Text
$sel:description:AttributeGroup' :: AttributeGroup -> Maybe Text
description} -> Maybe Text
description) (\s :: AttributeGroup
s@AttributeGroup' {} Maybe Text
a -> AttributeGroup
s {$sel:description:AttributeGroup' :: Maybe Text
description = Maybe Text
a} :: AttributeGroup)

-- | Key-value pairs you can use to associate with the attribute group.
attributeGroup_tags :: Lens.Lens' AttributeGroup (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
attributeGroup_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> AttributeGroup -> f AttributeGroup
attributeGroup_tags = (AttributeGroup -> Maybe (HashMap Text Text))
-> (AttributeGroup -> Maybe (HashMap Text Text) -> AttributeGroup)
-> Lens
     AttributeGroup
     AttributeGroup
     (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 (\AttributeGroup' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:AttributeGroup' :: AttributeGroup -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: AttributeGroup
s@AttributeGroup' {} Maybe (HashMap Text Text)
a -> AttributeGroup
s {$sel:tags:AttributeGroup' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: AttributeGroup) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> AttributeGroup -> f AttributeGroup)
-> ((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)))
-> AttributeGroup
-> f AttributeGroup
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 AttributeGroup where
  parseJSON :: Value -> Parser AttributeGroup
parseJSON =
    String
-> (Object -> Parser AttributeGroup)
-> Value
-> Parser AttributeGroup
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"AttributeGroup"
      ( \Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe (HashMap Text Text)
-> AttributeGroup
AttributeGroup'
            (Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe (HashMap Text Text)
 -> AttributeGroup)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> AttributeGroup)
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
"creationTime")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> AttributeGroup)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> AttributeGroup)
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 Text
   -> Maybe POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> AttributeGroup)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Maybe (HashMap Text Text)
      -> AttributeGroup)
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 POSIX
   -> Maybe Text
   -> Maybe (HashMap Text Text)
   -> AttributeGroup)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Text -> Maybe (HashMap Text Text) -> AttributeGroup)
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
"id")
            Parser
  (Maybe POSIX
   -> Maybe Text -> Maybe (HashMap Text Text) -> AttributeGroup)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Text -> Maybe (HashMap Text Text) -> AttributeGroup)
forall (f :: * -> *) a b. Applicative f => 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
"lastUpdateTime")
            Parser (Maybe Text -> Maybe (HashMap Text Text) -> AttributeGroup)
-> Parser (Maybe Text)
-> Parser (Maybe (HashMap Text Text) -> AttributeGroup)
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) -> AttributeGroup)
-> Parser (Maybe (HashMap Text Text)) -> Parser AttributeGroup
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 AttributeGroup

instance Prelude.NFData AttributeGroup