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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.WellArchitected.Types.PermissionType
import Amazonka.WellArchitected.Types.ShareStatus

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

-- |
-- Create a value of 'WorkloadShareSummary' 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:
--
-- 'status', 'workloadShareSummary_status' - Undocumented member.
--
-- 'sharedWith', 'workloadShareSummary_sharedWith' - Undocumented member.
--
-- 'permissionType', 'workloadShareSummary_permissionType' - Undocumented member.
--
-- 'shareId', 'workloadShareSummary_shareId' - Undocumented member.
newWorkloadShareSummary ::
  WorkloadShareSummary
newWorkloadShareSummary :: WorkloadShareSummary
newWorkloadShareSummary =
  WorkloadShareSummary' :: Maybe ShareStatus
-> Maybe Text
-> Maybe PermissionType
-> Maybe Text
-> WorkloadShareSummary
WorkloadShareSummary'
    { $sel:status:WorkloadShareSummary' :: Maybe ShareStatus
status = Maybe ShareStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:sharedWith:WorkloadShareSummary' :: Maybe Text
sharedWith = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:permissionType:WorkloadShareSummary' :: Maybe PermissionType
permissionType = Maybe PermissionType
forall a. Maybe a
Prelude.Nothing,
      $sel:shareId:WorkloadShareSummary' :: Maybe Text
shareId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

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

-- | Undocumented member.
workloadShareSummary_permissionType :: Lens.Lens' WorkloadShareSummary (Prelude.Maybe PermissionType)
workloadShareSummary_permissionType :: (Maybe PermissionType -> f (Maybe PermissionType))
-> WorkloadShareSummary -> f WorkloadShareSummary
workloadShareSummary_permissionType = (WorkloadShareSummary -> Maybe PermissionType)
-> (WorkloadShareSummary
    -> Maybe PermissionType -> WorkloadShareSummary)
-> Lens
     WorkloadShareSummary
     WorkloadShareSummary
     (Maybe PermissionType)
     (Maybe PermissionType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkloadShareSummary' {Maybe PermissionType
permissionType :: Maybe PermissionType
$sel:permissionType:WorkloadShareSummary' :: WorkloadShareSummary -> Maybe PermissionType
permissionType} -> Maybe PermissionType
permissionType) (\s :: WorkloadShareSummary
s@WorkloadShareSummary' {} Maybe PermissionType
a -> WorkloadShareSummary
s {$sel:permissionType:WorkloadShareSummary' :: Maybe PermissionType
permissionType = Maybe PermissionType
a} :: WorkloadShareSummary)

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

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

instance Prelude.Hashable WorkloadShareSummary

instance Prelude.NFData WorkloadShareSummary