{-# 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.WellArchitected.Types.LensShareSummary
-- 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.WellArchitected.Types.LensShareSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.WellArchitected.Types.ShareStatus

-- | A lens share summary return object.
--
-- /See:/ 'newLensShareSummary' smart constructor.
data LensShareSummary = LensShareSummary'
  { LensShareSummary -> Maybe Text
shareId :: Prelude.Maybe Prelude.Text,
    LensShareSummary -> Maybe Text
sharedWith :: Prelude.Maybe Prelude.Text,
    LensShareSummary -> Maybe ShareStatus
status :: Prelude.Maybe ShareStatus,
    -- | Optional message to compliment the Status field.
    LensShareSummary -> Maybe Text
statusMessage :: Prelude.Maybe Prelude.Text
  }
  deriving (LensShareSummary -> LensShareSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LensShareSummary -> LensShareSummary -> Bool
$c/= :: LensShareSummary -> LensShareSummary -> Bool
== :: LensShareSummary -> LensShareSummary -> Bool
$c== :: LensShareSummary -> LensShareSummary -> Bool
Prelude.Eq, ReadPrec [LensShareSummary]
ReadPrec LensShareSummary
Int -> ReadS LensShareSummary
ReadS [LensShareSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LensShareSummary]
$creadListPrec :: ReadPrec [LensShareSummary]
readPrec :: ReadPrec LensShareSummary
$creadPrec :: ReadPrec LensShareSummary
readList :: ReadS [LensShareSummary]
$creadList :: ReadS [LensShareSummary]
readsPrec :: Int -> ReadS LensShareSummary
$creadsPrec :: Int -> ReadS LensShareSummary
Prelude.Read, Int -> LensShareSummary -> ShowS
[LensShareSummary] -> ShowS
LensShareSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LensShareSummary] -> ShowS
$cshowList :: [LensShareSummary] -> ShowS
show :: LensShareSummary -> String
$cshow :: LensShareSummary -> String
showsPrec :: Int -> LensShareSummary -> ShowS
$cshowsPrec :: Int -> LensShareSummary -> ShowS
Prelude.Show, forall x. Rep LensShareSummary x -> LensShareSummary
forall x. LensShareSummary -> Rep LensShareSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LensShareSummary x -> LensShareSummary
$cfrom :: forall x. LensShareSummary -> Rep LensShareSummary x
Prelude.Generic)

-- |
-- Create a value of 'LensShareSummary' 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:
--
-- 'shareId', 'lensShareSummary_shareId' - Undocumented member.
--
-- 'sharedWith', 'lensShareSummary_sharedWith' - Undocumented member.
--
-- 'status', 'lensShareSummary_status' - Undocumented member.
--
-- 'statusMessage', 'lensShareSummary_statusMessage' - Optional message to compliment the Status field.
newLensShareSummary ::
  LensShareSummary
newLensShareSummary :: LensShareSummary
newLensShareSummary =
  LensShareSummary'
    { $sel:shareId:LensShareSummary' :: Maybe Text
shareId = forall a. Maybe a
Prelude.Nothing,
      $sel:sharedWith:LensShareSummary' :: Maybe Text
sharedWith = forall a. Maybe a
Prelude.Nothing,
      $sel:status:LensShareSummary' :: Maybe ShareStatus
status = forall a. Maybe a
Prelude.Nothing,
      $sel:statusMessage:LensShareSummary' :: Maybe Text
statusMessage = forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
lensShareSummary_shareId :: Lens.Lens' LensShareSummary (Prelude.Maybe Prelude.Text)
lensShareSummary_shareId :: Lens' LensShareSummary (Maybe Text)
lensShareSummary_shareId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LensShareSummary' {Maybe Text
shareId :: Maybe Text
$sel:shareId:LensShareSummary' :: LensShareSummary -> Maybe Text
shareId} -> Maybe Text
shareId) (\s :: LensShareSummary
s@LensShareSummary' {} Maybe Text
a -> LensShareSummary
s {$sel:shareId:LensShareSummary' :: Maybe Text
shareId = Maybe Text
a} :: LensShareSummary)

-- | Undocumented member.
lensShareSummary_sharedWith :: Lens.Lens' LensShareSummary (Prelude.Maybe Prelude.Text)
lensShareSummary_sharedWith :: Lens' LensShareSummary (Maybe Text)
lensShareSummary_sharedWith = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LensShareSummary' {Maybe Text
sharedWith :: Maybe Text
$sel:sharedWith:LensShareSummary' :: LensShareSummary -> Maybe Text
sharedWith} -> Maybe Text
sharedWith) (\s :: LensShareSummary
s@LensShareSummary' {} Maybe Text
a -> LensShareSummary
s {$sel:sharedWith:LensShareSummary' :: Maybe Text
sharedWith = Maybe Text
a} :: LensShareSummary)

-- | Undocumented member.
lensShareSummary_status :: Lens.Lens' LensShareSummary (Prelude.Maybe ShareStatus)
lensShareSummary_status :: Lens' LensShareSummary (Maybe ShareStatus)
lensShareSummary_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LensShareSummary' {Maybe ShareStatus
status :: Maybe ShareStatus
$sel:status:LensShareSummary' :: LensShareSummary -> Maybe ShareStatus
status} -> Maybe ShareStatus
status) (\s :: LensShareSummary
s@LensShareSummary' {} Maybe ShareStatus
a -> LensShareSummary
s {$sel:status:LensShareSummary' :: Maybe ShareStatus
status = Maybe ShareStatus
a} :: LensShareSummary)

-- | Optional message to compliment the Status field.
lensShareSummary_statusMessage :: Lens.Lens' LensShareSummary (Prelude.Maybe Prelude.Text)
lensShareSummary_statusMessage :: Lens' LensShareSummary (Maybe Text)
lensShareSummary_statusMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LensShareSummary' {Maybe Text
statusMessage :: Maybe Text
$sel:statusMessage:LensShareSummary' :: LensShareSummary -> Maybe Text
statusMessage} -> Maybe Text
statusMessage) (\s :: LensShareSummary
s@LensShareSummary' {} Maybe Text
a -> LensShareSummary
s {$sel:statusMessage:LensShareSummary' :: Maybe Text
statusMessage = Maybe Text
a} :: LensShareSummary)

instance Data.FromJSON LensShareSummary where
  parseJSON :: Value -> Parser LensShareSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"LensShareSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe ShareStatus
-> Maybe Text
-> LensShareSummary
LensShareSummary'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"ShareId")
            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
"SharedWith")
            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
"Status")
            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
"StatusMessage")
      )

instance Prelude.Hashable LensShareSummary where
  hashWithSalt :: Int -> LensShareSummary -> Int
hashWithSalt Int
_salt LensShareSummary' {Maybe Text
Maybe ShareStatus
statusMessage :: Maybe Text
status :: Maybe ShareStatus
sharedWith :: Maybe Text
shareId :: Maybe Text
$sel:statusMessage:LensShareSummary' :: LensShareSummary -> Maybe Text
$sel:status:LensShareSummary' :: LensShareSummary -> Maybe ShareStatus
$sel:sharedWith:LensShareSummary' :: LensShareSummary -> Maybe Text
$sel:shareId:LensShareSummary' :: LensShareSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
shareId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sharedWith
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ShareStatus
status
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
statusMessage

instance Prelude.NFData LensShareSummary where
  rnf :: LensShareSummary -> ()
rnf LensShareSummary' {Maybe Text
Maybe ShareStatus
statusMessage :: Maybe Text
status :: Maybe ShareStatus
sharedWith :: Maybe Text
shareId :: Maybe Text
$sel:statusMessage:LensShareSummary' :: LensShareSummary -> Maybe Text
$sel:status:LensShareSummary' :: LensShareSummary -> Maybe ShareStatus
$sel:sharedWith:LensShareSummary' :: LensShareSummary -> Maybe Text
$sel:shareId:LensShareSummary' :: LensShareSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
shareId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sharedWith
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ShareStatus
status
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
statusMessage