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

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

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

-- |
-- Create a value of 'ShareInvitation' 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:
--
-- 'workloadId', 'shareInvitation_workloadId' - Undocumented member.
--
-- 'shareInvitationId', 'shareInvitation_shareInvitationId' - The ID assigned to the share invitation.
newShareInvitation ::
  ShareInvitation
newShareInvitation :: ShareInvitation
newShareInvitation =
  ShareInvitation' :: Maybe Text -> Maybe Text -> ShareInvitation
ShareInvitation'
    { $sel:workloadId:ShareInvitation' :: Maybe Text
workloadId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:shareInvitationId:ShareInvitation' :: Maybe Text
shareInvitationId = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

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

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

instance Core.FromJSON ShareInvitation where
  parseJSON :: Value -> Parser ShareInvitation
parseJSON =
    String
-> (Object -> Parser ShareInvitation)
-> Value
-> Parser ShareInvitation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ShareInvitation"
      ( \Object
x ->
          Maybe Text -> Maybe Text -> ShareInvitation
ShareInvitation'
            (Maybe Text -> Maybe Text -> ShareInvitation)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ShareInvitation)
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
"WorkloadId")
            Parser (Maybe Text -> ShareInvitation)
-> Parser (Maybe Text) -> Parser ShareInvitation
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 ShareInvitation

instance Prelude.NFData ShareInvitation