{-# 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.IotTwinMaker.Types.ComponentPropertyGroupResponse
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.IotTwinMaker.Types.ComponentPropertyGroupResponse where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IotTwinMaker.Types.GroupType
import qualified Amazonka.Prelude as Prelude

-- | The component property group response.
--
-- /See:/ 'newComponentPropertyGroupResponse' smart constructor.
data ComponentPropertyGroupResponse = ComponentPropertyGroupResponse'
  { -- | The group type.
    ComponentPropertyGroupResponse -> GroupType
groupType :: GroupType,
    -- | The names of properties
    ComponentPropertyGroupResponse -> [Text]
propertyNames :: [Prelude.Text],
    -- | A Boolean value that specifies whether the property group is inherited
    -- from a parent entity
    ComponentPropertyGroupResponse -> Bool
isInherited :: Prelude.Bool
  }
  deriving (ComponentPropertyGroupResponse
-> ComponentPropertyGroupResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ComponentPropertyGroupResponse
-> ComponentPropertyGroupResponse -> Bool
$c/= :: ComponentPropertyGroupResponse
-> ComponentPropertyGroupResponse -> Bool
== :: ComponentPropertyGroupResponse
-> ComponentPropertyGroupResponse -> Bool
$c== :: ComponentPropertyGroupResponse
-> ComponentPropertyGroupResponse -> Bool
Prelude.Eq, ReadPrec [ComponentPropertyGroupResponse]
ReadPrec ComponentPropertyGroupResponse
Int -> ReadS ComponentPropertyGroupResponse
ReadS [ComponentPropertyGroupResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ComponentPropertyGroupResponse]
$creadListPrec :: ReadPrec [ComponentPropertyGroupResponse]
readPrec :: ReadPrec ComponentPropertyGroupResponse
$creadPrec :: ReadPrec ComponentPropertyGroupResponse
readList :: ReadS [ComponentPropertyGroupResponse]
$creadList :: ReadS [ComponentPropertyGroupResponse]
readsPrec :: Int -> ReadS ComponentPropertyGroupResponse
$creadsPrec :: Int -> ReadS ComponentPropertyGroupResponse
Prelude.Read, Int -> ComponentPropertyGroupResponse -> ShowS
[ComponentPropertyGroupResponse] -> ShowS
ComponentPropertyGroupResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ComponentPropertyGroupResponse] -> ShowS
$cshowList :: [ComponentPropertyGroupResponse] -> ShowS
show :: ComponentPropertyGroupResponse -> String
$cshow :: ComponentPropertyGroupResponse -> String
showsPrec :: Int -> ComponentPropertyGroupResponse -> ShowS
$cshowsPrec :: Int -> ComponentPropertyGroupResponse -> ShowS
Prelude.Show, forall x.
Rep ComponentPropertyGroupResponse x
-> ComponentPropertyGroupResponse
forall x.
ComponentPropertyGroupResponse
-> Rep ComponentPropertyGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ComponentPropertyGroupResponse x
-> ComponentPropertyGroupResponse
$cfrom :: forall x.
ComponentPropertyGroupResponse
-> Rep ComponentPropertyGroupResponse x
Prelude.Generic)

-- |
-- Create a value of 'ComponentPropertyGroupResponse' 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:
--
-- 'groupType', 'componentPropertyGroupResponse_groupType' - The group type.
--
-- 'propertyNames', 'componentPropertyGroupResponse_propertyNames' - The names of properties
--
-- 'isInherited', 'componentPropertyGroupResponse_isInherited' - A Boolean value that specifies whether the property group is inherited
-- from a parent entity
newComponentPropertyGroupResponse ::
  -- | 'groupType'
  GroupType ->
  -- | 'isInherited'
  Prelude.Bool ->
  ComponentPropertyGroupResponse
newComponentPropertyGroupResponse :: GroupType -> Bool -> ComponentPropertyGroupResponse
newComponentPropertyGroupResponse
  GroupType
pGroupType_
  Bool
pIsInherited_ =
    ComponentPropertyGroupResponse'
      { $sel:groupType:ComponentPropertyGroupResponse' :: GroupType
groupType =
          GroupType
pGroupType_,
        $sel:propertyNames:ComponentPropertyGroupResponse' :: [Text]
propertyNames = forall a. Monoid a => a
Prelude.mempty,
        $sel:isInherited:ComponentPropertyGroupResponse' :: Bool
isInherited = Bool
pIsInherited_
      }

-- | The group type.
componentPropertyGroupResponse_groupType :: Lens.Lens' ComponentPropertyGroupResponse GroupType
componentPropertyGroupResponse_groupType :: Lens' ComponentPropertyGroupResponse GroupType
componentPropertyGroupResponse_groupType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentPropertyGroupResponse' {GroupType
groupType :: GroupType
$sel:groupType:ComponentPropertyGroupResponse' :: ComponentPropertyGroupResponse -> GroupType
groupType} -> GroupType
groupType) (\s :: ComponentPropertyGroupResponse
s@ComponentPropertyGroupResponse' {} GroupType
a -> ComponentPropertyGroupResponse
s {$sel:groupType:ComponentPropertyGroupResponse' :: GroupType
groupType = GroupType
a} :: ComponentPropertyGroupResponse)

-- | The names of properties
componentPropertyGroupResponse_propertyNames :: Lens.Lens' ComponentPropertyGroupResponse [Prelude.Text]
componentPropertyGroupResponse_propertyNames :: Lens' ComponentPropertyGroupResponse [Text]
componentPropertyGroupResponse_propertyNames = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentPropertyGroupResponse' {[Text]
propertyNames :: [Text]
$sel:propertyNames:ComponentPropertyGroupResponse' :: ComponentPropertyGroupResponse -> [Text]
propertyNames} -> [Text]
propertyNames) (\s :: ComponentPropertyGroupResponse
s@ComponentPropertyGroupResponse' {} [Text]
a -> ComponentPropertyGroupResponse
s {$sel:propertyNames:ComponentPropertyGroupResponse' :: [Text]
propertyNames = [Text]
a} :: ComponentPropertyGroupResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A Boolean value that specifies whether the property group is inherited
-- from a parent entity
componentPropertyGroupResponse_isInherited :: Lens.Lens' ComponentPropertyGroupResponse Prelude.Bool
componentPropertyGroupResponse_isInherited :: Lens' ComponentPropertyGroupResponse Bool
componentPropertyGroupResponse_isInherited = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ComponentPropertyGroupResponse' {Bool
isInherited :: Bool
$sel:isInherited:ComponentPropertyGroupResponse' :: ComponentPropertyGroupResponse -> Bool
isInherited} -> Bool
isInherited) (\s :: ComponentPropertyGroupResponse
s@ComponentPropertyGroupResponse' {} Bool
a -> ComponentPropertyGroupResponse
s {$sel:isInherited:ComponentPropertyGroupResponse' :: Bool
isInherited = Bool
a} :: ComponentPropertyGroupResponse)

instance Data.FromJSON ComponentPropertyGroupResponse where
  parseJSON :: Value -> Parser ComponentPropertyGroupResponse
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ComponentPropertyGroupResponse"
      ( \Object
x ->
          GroupType -> [Text] -> Bool -> ComponentPropertyGroupResponse
ComponentPropertyGroupResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"groupType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"propertyNames" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"isInherited")
      )

instance
  Prelude.Hashable
    ComponentPropertyGroupResponse
  where
  hashWithSalt :: Int -> ComponentPropertyGroupResponse -> Int
hashWithSalt
    Int
_salt
    ComponentPropertyGroupResponse' {Bool
[Text]
GroupType
isInherited :: Bool
propertyNames :: [Text]
groupType :: GroupType
$sel:isInherited:ComponentPropertyGroupResponse' :: ComponentPropertyGroupResponse -> Bool
$sel:propertyNames:ComponentPropertyGroupResponse' :: ComponentPropertyGroupResponse -> [Text]
$sel:groupType:ComponentPropertyGroupResponse' :: ComponentPropertyGroupResponse -> GroupType
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` GroupType
groupType
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
propertyNames
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Bool
isInherited

instance
  Prelude.NFData
    ComponentPropertyGroupResponse
  where
  rnf :: ComponentPropertyGroupResponse -> ()
rnf ComponentPropertyGroupResponse' {Bool
[Text]
GroupType
isInherited :: Bool
propertyNames :: [Text]
groupType :: GroupType
$sel:isInherited:ComponentPropertyGroupResponse' :: ComponentPropertyGroupResponse -> Bool
$sel:propertyNames:ComponentPropertyGroupResponse' :: ComponentPropertyGroupResponse -> [Text]
$sel:groupType:ComponentPropertyGroupResponse' :: ComponentPropertyGroupResponse -> GroupType
..} =
    forall a. NFData a => a -> ()
Prelude.rnf GroupType
groupType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [Text]
propertyNames
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Bool
isInherited