{-# 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.ShareInvitationSummary
-- 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.ShareInvitationSummary where

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

-- | A share invitation summary return object.
--
-- /See:/ 'newShareInvitationSummary' smart constructor.
data ShareInvitationSummary = ShareInvitationSummary'
  { ShareInvitationSummary -> Maybe Text
sharedBy :: Prelude.Maybe Prelude.Text,
    ShareInvitationSummary -> Maybe Text
sharedWith :: Prelude.Maybe Prelude.Text,
    ShareInvitationSummary -> Maybe PermissionType
permissionType :: Prelude.Maybe PermissionType,
    ShareInvitationSummary -> Maybe Text
workloadId :: Prelude.Maybe Prelude.Text,
    ShareInvitationSummary -> Maybe Text
workloadName :: Prelude.Maybe Prelude.Text,
    -- | The ID assigned to the share invitation.
    ShareInvitationSummary -> Maybe Text
shareInvitationId :: Prelude.Maybe Prelude.Text
  }
  deriving (ShareInvitationSummary -> ShareInvitationSummary -> Bool
(ShareInvitationSummary -> ShareInvitationSummary -> Bool)
-> (ShareInvitationSummary -> ShareInvitationSummary -> Bool)
-> Eq ShareInvitationSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ShareInvitationSummary -> ShareInvitationSummary -> Bool
$c/= :: ShareInvitationSummary -> ShareInvitationSummary -> Bool
== :: ShareInvitationSummary -> ShareInvitationSummary -> Bool
$c== :: ShareInvitationSummary -> ShareInvitationSummary -> Bool
Prelude.Eq, ReadPrec [ShareInvitationSummary]
ReadPrec ShareInvitationSummary
Int -> ReadS ShareInvitationSummary
ReadS [ShareInvitationSummary]
(Int -> ReadS ShareInvitationSummary)
-> ReadS [ShareInvitationSummary]
-> ReadPrec ShareInvitationSummary
-> ReadPrec [ShareInvitationSummary]
-> Read ShareInvitationSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ShareInvitationSummary]
$creadListPrec :: ReadPrec [ShareInvitationSummary]
readPrec :: ReadPrec ShareInvitationSummary
$creadPrec :: ReadPrec ShareInvitationSummary
readList :: ReadS [ShareInvitationSummary]
$creadList :: ReadS [ShareInvitationSummary]
readsPrec :: Int -> ReadS ShareInvitationSummary
$creadsPrec :: Int -> ReadS ShareInvitationSummary
Prelude.Read, Int -> ShareInvitationSummary -> ShowS
[ShareInvitationSummary] -> ShowS
ShareInvitationSummary -> String
(Int -> ShareInvitationSummary -> ShowS)
-> (ShareInvitationSummary -> String)
-> ([ShareInvitationSummary] -> ShowS)
-> Show ShareInvitationSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ShareInvitationSummary] -> ShowS
$cshowList :: [ShareInvitationSummary] -> ShowS
show :: ShareInvitationSummary -> String
$cshow :: ShareInvitationSummary -> String
showsPrec :: Int -> ShareInvitationSummary -> ShowS
$cshowsPrec :: Int -> ShareInvitationSummary -> ShowS
Prelude.Show, (forall x. ShareInvitationSummary -> Rep ShareInvitationSummary x)
-> (forall x.
    Rep ShareInvitationSummary x -> ShareInvitationSummary)
-> Generic ShareInvitationSummary
forall x. Rep ShareInvitationSummary x -> ShareInvitationSummary
forall x. ShareInvitationSummary -> Rep ShareInvitationSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ShareInvitationSummary x -> ShareInvitationSummary
$cfrom :: forall x. ShareInvitationSummary -> Rep ShareInvitationSummary x
Prelude.Generic)

-- |
-- Create a value of 'ShareInvitationSummary' 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:
--
-- 'sharedBy', 'shareInvitationSummary_sharedBy' - Undocumented member.
--
-- 'sharedWith', 'shareInvitationSummary_sharedWith' - Undocumented member.
--
-- 'permissionType', 'shareInvitationSummary_permissionType' - Undocumented member.
--
-- 'workloadId', 'shareInvitationSummary_workloadId' - Undocumented member.
--
-- 'workloadName', 'shareInvitationSummary_workloadName' - Undocumented member.
--
-- 'shareInvitationId', 'shareInvitationSummary_shareInvitationId' - The ID assigned to the share invitation.
newShareInvitationSummary ::
  ShareInvitationSummary
newShareInvitationSummary :: ShareInvitationSummary
newShareInvitationSummary =
  ShareInvitationSummary' :: Maybe Text
-> Maybe Text
-> Maybe PermissionType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ShareInvitationSummary
ShareInvitationSummary'
    { $sel:sharedBy:ShareInvitationSummary' :: Maybe Text
sharedBy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:sharedWith:ShareInvitationSummary' :: Maybe Text
sharedWith = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:permissionType:ShareInvitationSummary' :: Maybe PermissionType
permissionType = Maybe PermissionType
forall a. Maybe a
Prelude.Nothing,
      $sel:workloadId:ShareInvitationSummary' :: Maybe Text
workloadId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:workloadName:ShareInvitationSummary' :: Maybe Text
workloadName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:shareInvitationId:ShareInvitationSummary' :: Maybe Text
shareInvitationId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

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

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

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

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

-- | The ID assigned to the share invitation.
shareInvitationSummary_shareInvitationId :: Lens.Lens' ShareInvitationSummary (Prelude.Maybe Prelude.Text)
shareInvitationSummary_shareInvitationId :: (Maybe Text -> f (Maybe Text))
-> ShareInvitationSummary -> f ShareInvitationSummary
shareInvitationSummary_shareInvitationId = (ShareInvitationSummary -> Maybe Text)
-> (ShareInvitationSummary -> Maybe Text -> ShareInvitationSummary)
-> Lens
     ShareInvitationSummary
     ShareInvitationSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ShareInvitationSummary' {Maybe Text
shareInvitationId :: Maybe Text
$sel:shareInvitationId:ShareInvitationSummary' :: ShareInvitationSummary -> Maybe Text
shareInvitationId} -> Maybe Text
shareInvitationId) (\s :: ShareInvitationSummary
s@ShareInvitationSummary' {} Maybe Text
a -> ShareInvitationSummary
s {$sel:shareInvitationId:ShareInvitationSummary' :: Maybe Text
shareInvitationId = Maybe Text
a} :: ShareInvitationSummary)

instance Core.FromJSON ShareInvitationSummary where
  parseJSON :: Value -> Parser ShareInvitationSummary
parseJSON =
    String
-> (Object -> Parser ShareInvitationSummary)
-> Value
-> Parser ShareInvitationSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ShareInvitationSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe PermissionType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ShareInvitationSummary
ShareInvitationSummary'
            (Maybe Text
 -> Maybe Text
 -> Maybe PermissionType
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> ShareInvitationSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe PermissionType
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> ShareInvitationSummary)
forall (f :: * -> *) a b. Functor 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
"SharedBy")
            Parser
  (Maybe Text
   -> Maybe PermissionType
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> ShareInvitationSummary)
-> Parser (Maybe Text)
-> Parser
     (Maybe PermissionType
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> ShareInvitationSummary)
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
   -> Maybe Text
   -> Maybe Text
   -> ShareInvitationSummary)
-> Parser (Maybe PermissionType)
-> Parser
     (Maybe Text -> Maybe Text -> Maybe Text -> ShareInvitationSummary)
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 -> Maybe Text -> Maybe Text -> ShareInvitationSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> ShareInvitationSummary)
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
"WorkloadId")
            Parser (Maybe Text -> Maybe Text -> ShareInvitationSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> ShareInvitationSummary)
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
"WorkloadName")
            Parser (Maybe Text -> ShareInvitationSummary)
-> Parser (Maybe Text) -> Parser ShareInvitationSummary
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
"ShareInvitationId")
      )

instance Prelude.Hashable ShareInvitationSummary

instance Prelude.NFData ShareInvitationSummary