{-# 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.RAM.Types.ResourceShareInvitation
-- 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.RAM.Types.ResourceShareInvitation where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RAM.Types.ResourceShareAssociation
import Amazonka.RAM.Types.ResourceShareInvitationStatus

-- | Describes an invitation to join a resource share.
--
-- /See:/ 'newResourceShareInvitation' smart constructor.
data ResourceShareInvitation = ResourceShareInvitation'
  { -- | The status of the invitation.
    ResourceShareInvitation -> Maybe ResourceShareInvitationStatus
status :: Prelude.Maybe ResourceShareInvitationStatus,
    -- | The ID of the Amazon Web Services account that sent the invitation.
    ResourceShareInvitation -> Maybe Text
senderAccountId :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the resource share.
    ResourceShareInvitation -> Maybe Text
resourceShareArn :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Amazon Web Services account that received the invitation.
    ResourceShareInvitation -> Maybe Text
receiverAccountId :: Prelude.Maybe Prelude.Text,
    -- | To view the resources associated with a pending resource share
    -- invitation, use
    -- <https://docs.aws.amazon.com/ram/latest/APIReference/API_ListPendingInvitationResources.html ListPendingInvitationResources>.
    ResourceShareInvitation -> Maybe [ResourceShareAssociation]
resourceShareAssociations :: Prelude.Maybe [ResourceShareAssociation],
    -- | The name of the resource share.
    ResourceShareInvitation -> Maybe Text
resourceShareName :: Prelude.Maybe Prelude.Text,
    -- | The Amazon Resource Name (ARN) of the IAM user or IAM role that received
    -- the invitation.
    ResourceShareInvitation -> Maybe Text
receiverArn :: Prelude.Maybe Prelude.Text,
    -- | The date and time when the invitation was sent.
    ResourceShareInvitation -> Maybe POSIX
invitationTimestamp :: Prelude.Maybe Core.POSIX,
    -- | The Amazon Resource Name (ARN) of the invitation.
    ResourceShareInvitation -> Maybe Text
resourceShareInvitationArn :: Prelude.Maybe Prelude.Text
  }
  deriving (ResourceShareInvitation -> ResourceShareInvitation -> Bool
(ResourceShareInvitation -> ResourceShareInvitation -> Bool)
-> (ResourceShareInvitation -> ResourceShareInvitation -> Bool)
-> Eq ResourceShareInvitation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResourceShareInvitation -> ResourceShareInvitation -> Bool
$c/= :: ResourceShareInvitation -> ResourceShareInvitation -> Bool
== :: ResourceShareInvitation -> ResourceShareInvitation -> Bool
$c== :: ResourceShareInvitation -> ResourceShareInvitation -> Bool
Prelude.Eq, ReadPrec [ResourceShareInvitation]
ReadPrec ResourceShareInvitation
Int -> ReadS ResourceShareInvitation
ReadS [ResourceShareInvitation]
(Int -> ReadS ResourceShareInvitation)
-> ReadS [ResourceShareInvitation]
-> ReadPrec ResourceShareInvitation
-> ReadPrec [ResourceShareInvitation]
-> Read ResourceShareInvitation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResourceShareInvitation]
$creadListPrec :: ReadPrec [ResourceShareInvitation]
readPrec :: ReadPrec ResourceShareInvitation
$creadPrec :: ReadPrec ResourceShareInvitation
readList :: ReadS [ResourceShareInvitation]
$creadList :: ReadS [ResourceShareInvitation]
readsPrec :: Int -> ReadS ResourceShareInvitation
$creadsPrec :: Int -> ReadS ResourceShareInvitation
Prelude.Read, Int -> ResourceShareInvitation -> ShowS
[ResourceShareInvitation] -> ShowS
ResourceShareInvitation -> String
(Int -> ResourceShareInvitation -> ShowS)
-> (ResourceShareInvitation -> String)
-> ([ResourceShareInvitation] -> ShowS)
-> Show ResourceShareInvitation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResourceShareInvitation] -> ShowS
$cshowList :: [ResourceShareInvitation] -> ShowS
show :: ResourceShareInvitation -> String
$cshow :: ResourceShareInvitation -> String
showsPrec :: Int -> ResourceShareInvitation -> ShowS
$cshowsPrec :: Int -> ResourceShareInvitation -> ShowS
Prelude.Show, (forall x.
 ResourceShareInvitation -> Rep ResourceShareInvitation x)
-> (forall x.
    Rep ResourceShareInvitation x -> ResourceShareInvitation)
-> Generic ResourceShareInvitation
forall x. Rep ResourceShareInvitation x -> ResourceShareInvitation
forall x. ResourceShareInvitation -> Rep ResourceShareInvitation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResourceShareInvitation x -> ResourceShareInvitation
$cfrom :: forall x. ResourceShareInvitation -> Rep ResourceShareInvitation x
Prelude.Generic)

-- |
-- Create a value of 'ResourceShareInvitation' 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', 'resourceShareInvitation_status' - The status of the invitation.
--
-- 'senderAccountId', 'resourceShareInvitation_senderAccountId' - The ID of the Amazon Web Services account that sent the invitation.
--
-- 'resourceShareArn', 'resourceShareInvitation_resourceShareArn' - The Amazon Resource Name (ARN) of the resource share.
--
-- 'receiverAccountId', 'resourceShareInvitation_receiverAccountId' - The ID of the Amazon Web Services account that received the invitation.
--
-- 'resourceShareAssociations', 'resourceShareInvitation_resourceShareAssociations' - To view the resources associated with a pending resource share
-- invitation, use
-- <https://docs.aws.amazon.com/ram/latest/APIReference/API_ListPendingInvitationResources.html ListPendingInvitationResources>.
--
-- 'resourceShareName', 'resourceShareInvitation_resourceShareName' - The name of the resource share.
--
-- 'receiverArn', 'resourceShareInvitation_receiverArn' - The Amazon Resource Name (ARN) of the IAM user or IAM role that received
-- the invitation.
--
-- 'invitationTimestamp', 'resourceShareInvitation_invitationTimestamp' - The date and time when the invitation was sent.
--
-- 'resourceShareInvitationArn', 'resourceShareInvitation_resourceShareInvitationArn' - The Amazon Resource Name (ARN) of the invitation.
newResourceShareInvitation ::
  ResourceShareInvitation
newResourceShareInvitation :: ResourceShareInvitation
newResourceShareInvitation =
  ResourceShareInvitation' :: Maybe ResourceShareInvitationStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [ResourceShareAssociation]
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> ResourceShareInvitation
ResourceShareInvitation'
    { $sel:status:ResourceShareInvitation' :: Maybe ResourceShareInvitationStatus
status = Maybe ResourceShareInvitationStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:senderAccountId:ResourceShareInvitation' :: Maybe Text
senderAccountId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceShareArn:ResourceShareInvitation' :: Maybe Text
resourceShareArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:receiverAccountId:ResourceShareInvitation' :: Maybe Text
receiverAccountId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceShareAssociations:ResourceShareInvitation' :: Maybe [ResourceShareAssociation]
resourceShareAssociations = Maybe [ResourceShareAssociation]
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceShareName:ResourceShareInvitation' :: Maybe Text
resourceShareName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:receiverArn:ResourceShareInvitation' :: Maybe Text
receiverArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:invitationTimestamp:ResourceShareInvitation' :: Maybe POSIX
invitationTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceShareInvitationArn:ResourceShareInvitation' :: Maybe Text
resourceShareInvitationArn = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The status of the invitation.
resourceShareInvitation_status :: Lens.Lens' ResourceShareInvitation (Prelude.Maybe ResourceShareInvitationStatus)
resourceShareInvitation_status :: (Maybe ResourceShareInvitationStatus
 -> f (Maybe ResourceShareInvitationStatus))
-> ResourceShareInvitation -> f ResourceShareInvitation
resourceShareInvitation_status = (ResourceShareInvitation -> Maybe ResourceShareInvitationStatus)
-> (ResourceShareInvitation
    -> Maybe ResourceShareInvitationStatus -> ResourceShareInvitation)
-> Lens
     ResourceShareInvitation
     ResourceShareInvitation
     (Maybe ResourceShareInvitationStatus)
     (Maybe ResourceShareInvitationStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceShareInvitation' {Maybe ResourceShareInvitationStatus
status :: Maybe ResourceShareInvitationStatus
$sel:status:ResourceShareInvitation' :: ResourceShareInvitation -> Maybe ResourceShareInvitationStatus
status} -> Maybe ResourceShareInvitationStatus
status) (\s :: ResourceShareInvitation
s@ResourceShareInvitation' {} Maybe ResourceShareInvitationStatus
a -> ResourceShareInvitation
s {$sel:status:ResourceShareInvitation' :: Maybe ResourceShareInvitationStatus
status = Maybe ResourceShareInvitationStatus
a} :: ResourceShareInvitation)

-- | The ID of the Amazon Web Services account that sent the invitation.
resourceShareInvitation_senderAccountId :: Lens.Lens' ResourceShareInvitation (Prelude.Maybe Prelude.Text)
resourceShareInvitation_senderAccountId :: (Maybe Text -> f (Maybe Text))
-> ResourceShareInvitation -> f ResourceShareInvitation
resourceShareInvitation_senderAccountId = (ResourceShareInvitation -> Maybe Text)
-> (ResourceShareInvitation
    -> Maybe Text -> ResourceShareInvitation)
-> Lens
     ResourceShareInvitation
     ResourceShareInvitation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceShareInvitation' {Maybe Text
senderAccountId :: Maybe Text
$sel:senderAccountId:ResourceShareInvitation' :: ResourceShareInvitation -> Maybe Text
senderAccountId} -> Maybe Text
senderAccountId) (\s :: ResourceShareInvitation
s@ResourceShareInvitation' {} Maybe Text
a -> ResourceShareInvitation
s {$sel:senderAccountId:ResourceShareInvitation' :: Maybe Text
senderAccountId = Maybe Text
a} :: ResourceShareInvitation)

-- | The Amazon Resource Name (ARN) of the resource share.
resourceShareInvitation_resourceShareArn :: Lens.Lens' ResourceShareInvitation (Prelude.Maybe Prelude.Text)
resourceShareInvitation_resourceShareArn :: (Maybe Text -> f (Maybe Text))
-> ResourceShareInvitation -> f ResourceShareInvitation
resourceShareInvitation_resourceShareArn = (ResourceShareInvitation -> Maybe Text)
-> (ResourceShareInvitation
    -> Maybe Text -> ResourceShareInvitation)
-> Lens
     ResourceShareInvitation
     ResourceShareInvitation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceShareInvitation' {Maybe Text
resourceShareArn :: Maybe Text
$sel:resourceShareArn:ResourceShareInvitation' :: ResourceShareInvitation -> Maybe Text
resourceShareArn} -> Maybe Text
resourceShareArn) (\s :: ResourceShareInvitation
s@ResourceShareInvitation' {} Maybe Text
a -> ResourceShareInvitation
s {$sel:resourceShareArn:ResourceShareInvitation' :: Maybe Text
resourceShareArn = Maybe Text
a} :: ResourceShareInvitation)

-- | The ID of the Amazon Web Services account that received the invitation.
resourceShareInvitation_receiverAccountId :: Lens.Lens' ResourceShareInvitation (Prelude.Maybe Prelude.Text)
resourceShareInvitation_receiverAccountId :: (Maybe Text -> f (Maybe Text))
-> ResourceShareInvitation -> f ResourceShareInvitation
resourceShareInvitation_receiverAccountId = (ResourceShareInvitation -> Maybe Text)
-> (ResourceShareInvitation
    -> Maybe Text -> ResourceShareInvitation)
-> Lens
     ResourceShareInvitation
     ResourceShareInvitation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceShareInvitation' {Maybe Text
receiverAccountId :: Maybe Text
$sel:receiverAccountId:ResourceShareInvitation' :: ResourceShareInvitation -> Maybe Text
receiverAccountId} -> Maybe Text
receiverAccountId) (\s :: ResourceShareInvitation
s@ResourceShareInvitation' {} Maybe Text
a -> ResourceShareInvitation
s {$sel:receiverAccountId:ResourceShareInvitation' :: Maybe Text
receiverAccountId = Maybe Text
a} :: ResourceShareInvitation)

-- | To view the resources associated with a pending resource share
-- invitation, use
-- <https://docs.aws.amazon.com/ram/latest/APIReference/API_ListPendingInvitationResources.html ListPendingInvitationResources>.
resourceShareInvitation_resourceShareAssociations :: Lens.Lens' ResourceShareInvitation (Prelude.Maybe [ResourceShareAssociation])
resourceShareInvitation_resourceShareAssociations :: (Maybe [ResourceShareAssociation]
 -> f (Maybe [ResourceShareAssociation]))
-> ResourceShareInvitation -> f ResourceShareInvitation
resourceShareInvitation_resourceShareAssociations = (ResourceShareInvitation -> Maybe [ResourceShareAssociation])
-> (ResourceShareInvitation
    -> Maybe [ResourceShareAssociation] -> ResourceShareInvitation)
-> Lens
     ResourceShareInvitation
     ResourceShareInvitation
     (Maybe [ResourceShareAssociation])
     (Maybe [ResourceShareAssociation])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceShareInvitation' {Maybe [ResourceShareAssociation]
resourceShareAssociations :: Maybe [ResourceShareAssociation]
$sel:resourceShareAssociations:ResourceShareInvitation' :: ResourceShareInvitation -> Maybe [ResourceShareAssociation]
resourceShareAssociations} -> Maybe [ResourceShareAssociation]
resourceShareAssociations) (\s :: ResourceShareInvitation
s@ResourceShareInvitation' {} Maybe [ResourceShareAssociation]
a -> ResourceShareInvitation
s {$sel:resourceShareAssociations:ResourceShareInvitation' :: Maybe [ResourceShareAssociation]
resourceShareAssociations = Maybe [ResourceShareAssociation]
a} :: ResourceShareInvitation) ((Maybe [ResourceShareAssociation]
  -> f (Maybe [ResourceShareAssociation]))
 -> ResourceShareInvitation -> f ResourceShareInvitation)
-> ((Maybe [ResourceShareAssociation]
     -> f (Maybe [ResourceShareAssociation]))
    -> Maybe [ResourceShareAssociation]
    -> f (Maybe [ResourceShareAssociation]))
-> (Maybe [ResourceShareAssociation]
    -> f (Maybe [ResourceShareAssociation]))
-> ResourceShareInvitation
-> f ResourceShareInvitation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [ResourceShareAssociation]
  [ResourceShareAssociation]
  [ResourceShareAssociation]
  [ResourceShareAssociation]
-> Iso
     (Maybe [ResourceShareAssociation])
     (Maybe [ResourceShareAssociation])
     (Maybe [ResourceShareAssociation])
     (Maybe [ResourceShareAssociation])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [ResourceShareAssociation]
  [ResourceShareAssociation]
  [ResourceShareAssociation]
  [ResourceShareAssociation]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the resource share.
resourceShareInvitation_resourceShareName :: Lens.Lens' ResourceShareInvitation (Prelude.Maybe Prelude.Text)
resourceShareInvitation_resourceShareName :: (Maybe Text -> f (Maybe Text))
-> ResourceShareInvitation -> f ResourceShareInvitation
resourceShareInvitation_resourceShareName = (ResourceShareInvitation -> Maybe Text)
-> (ResourceShareInvitation
    -> Maybe Text -> ResourceShareInvitation)
-> Lens
     ResourceShareInvitation
     ResourceShareInvitation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceShareInvitation' {Maybe Text
resourceShareName :: Maybe Text
$sel:resourceShareName:ResourceShareInvitation' :: ResourceShareInvitation -> Maybe Text
resourceShareName} -> Maybe Text
resourceShareName) (\s :: ResourceShareInvitation
s@ResourceShareInvitation' {} Maybe Text
a -> ResourceShareInvitation
s {$sel:resourceShareName:ResourceShareInvitation' :: Maybe Text
resourceShareName = Maybe Text
a} :: ResourceShareInvitation)

-- | The Amazon Resource Name (ARN) of the IAM user or IAM role that received
-- the invitation.
resourceShareInvitation_receiverArn :: Lens.Lens' ResourceShareInvitation (Prelude.Maybe Prelude.Text)
resourceShareInvitation_receiverArn :: (Maybe Text -> f (Maybe Text))
-> ResourceShareInvitation -> f ResourceShareInvitation
resourceShareInvitation_receiverArn = (ResourceShareInvitation -> Maybe Text)
-> (ResourceShareInvitation
    -> Maybe Text -> ResourceShareInvitation)
-> Lens
     ResourceShareInvitation
     ResourceShareInvitation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceShareInvitation' {Maybe Text
receiverArn :: Maybe Text
$sel:receiverArn:ResourceShareInvitation' :: ResourceShareInvitation -> Maybe Text
receiverArn} -> Maybe Text
receiverArn) (\s :: ResourceShareInvitation
s@ResourceShareInvitation' {} Maybe Text
a -> ResourceShareInvitation
s {$sel:receiverArn:ResourceShareInvitation' :: Maybe Text
receiverArn = Maybe Text
a} :: ResourceShareInvitation)

-- | The date and time when the invitation was sent.
resourceShareInvitation_invitationTimestamp :: Lens.Lens' ResourceShareInvitation (Prelude.Maybe Prelude.UTCTime)
resourceShareInvitation_invitationTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ResourceShareInvitation -> f ResourceShareInvitation
resourceShareInvitation_invitationTimestamp = (ResourceShareInvitation -> Maybe POSIX)
-> (ResourceShareInvitation
    -> Maybe POSIX -> ResourceShareInvitation)
-> Lens
     ResourceShareInvitation
     ResourceShareInvitation
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceShareInvitation' {Maybe POSIX
invitationTimestamp :: Maybe POSIX
$sel:invitationTimestamp:ResourceShareInvitation' :: ResourceShareInvitation -> Maybe POSIX
invitationTimestamp} -> Maybe POSIX
invitationTimestamp) (\s :: ResourceShareInvitation
s@ResourceShareInvitation' {} Maybe POSIX
a -> ResourceShareInvitation
s {$sel:invitationTimestamp:ResourceShareInvitation' :: Maybe POSIX
invitationTimestamp = Maybe POSIX
a} :: ResourceShareInvitation) ((Maybe POSIX -> f (Maybe POSIX))
 -> ResourceShareInvitation -> f ResourceShareInvitation)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ResourceShareInvitation
-> f ResourceShareInvitation
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The Amazon Resource Name (ARN) of the invitation.
resourceShareInvitation_resourceShareInvitationArn :: Lens.Lens' ResourceShareInvitation (Prelude.Maybe Prelude.Text)
resourceShareInvitation_resourceShareInvitationArn :: (Maybe Text -> f (Maybe Text))
-> ResourceShareInvitation -> f ResourceShareInvitation
resourceShareInvitation_resourceShareInvitationArn = (ResourceShareInvitation -> Maybe Text)
-> (ResourceShareInvitation
    -> Maybe Text -> ResourceShareInvitation)
-> Lens
     ResourceShareInvitation
     ResourceShareInvitation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceShareInvitation' {Maybe Text
resourceShareInvitationArn :: Maybe Text
$sel:resourceShareInvitationArn:ResourceShareInvitation' :: ResourceShareInvitation -> Maybe Text
resourceShareInvitationArn} -> Maybe Text
resourceShareInvitationArn) (\s :: ResourceShareInvitation
s@ResourceShareInvitation' {} Maybe Text
a -> ResourceShareInvitation
s {$sel:resourceShareInvitationArn:ResourceShareInvitation' :: Maybe Text
resourceShareInvitationArn = Maybe Text
a} :: ResourceShareInvitation)

instance Core.FromJSON ResourceShareInvitation where
  parseJSON :: Value -> Parser ResourceShareInvitation
parseJSON =
    String
-> (Object -> Parser ResourceShareInvitation)
-> Value
-> Parser ResourceShareInvitation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ResourceShareInvitation"
      ( \Object
x ->
          Maybe ResourceShareInvitationStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [ResourceShareAssociation]
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> ResourceShareInvitation
ResourceShareInvitation'
            (Maybe ResourceShareInvitationStatus
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe [ResourceShareAssociation]
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> ResourceShareInvitation)
-> Parser (Maybe ResourceShareInvitationStatus)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> Maybe [ResourceShareAssociation]
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> ResourceShareInvitation)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ResourceShareInvitationStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> Maybe [ResourceShareAssociation]
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> ResourceShareInvitation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe [ResourceShareAssociation]
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> ResourceShareInvitation)
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
"senderAccountId")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe [ResourceShareAssociation]
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> ResourceShareInvitation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe [ResourceShareAssociation]
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> ResourceShareInvitation)
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
"resourceShareArn")
            Parser
  (Maybe Text
   -> Maybe [ResourceShareAssociation]
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> ResourceShareInvitation)
-> Parser (Maybe Text)
-> Parser
     (Maybe [ResourceShareAssociation]
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> ResourceShareInvitation)
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
"receiverAccountId")
            Parser
  (Maybe [ResourceShareAssociation]
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> ResourceShareInvitation)
-> Parser (Maybe [ResourceShareAssociation])
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> ResourceShareInvitation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [ResourceShareAssociation]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"resourceShareAssociations"
                            Parser (Maybe (Maybe [ResourceShareAssociation]))
-> Maybe [ResourceShareAssociation]
-> Parser (Maybe [ResourceShareAssociation])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ResourceShareAssociation]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> ResourceShareInvitation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX -> Maybe Text -> ResourceShareInvitation)
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
"resourceShareName")
            Parser
  (Maybe Text
   -> Maybe POSIX -> Maybe Text -> ResourceShareInvitation)
-> Parser (Maybe Text)
-> Parser (Maybe POSIX -> Maybe Text -> ResourceShareInvitation)
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
"receiverArn")
            Parser (Maybe POSIX -> Maybe Text -> ResourceShareInvitation)
-> Parser (Maybe POSIX)
-> Parser (Maybe Text -> ResourceShareInvitation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"invitationTimestamp")
            Parser (Maybe Text -> ResourceShareInvitation)
-> Parser (Maybe Text) -> Parser ResourceShareInvitation
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
"resourceShareInvitationArn")
      )

instance Prelude.Hashable ResourceShareInvitation

instance Prelude.NFData ResourceShareInvitation