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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RAM.Types.ResourceShareAssociationStatus
import Amazonka.RAM.Types.ResourceShareAssociationType

-- | Describes an association with a resource share.
--
-- /See:/ 'newResourceShareAssociation' smart constructor.
data ResourceShareAssociation = ResourceShareAssociation'
  { -- | The time when the association was created.
    ResourceShareAssociation -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | The status of the association.
    ResourceShareAssociation -> Maybe ResourceShareAssociationStatus
status :: Prelude.Maybe ResourceShareAssociationStatus,
    -- | The Amazon Resource Name (ARN) of the resource share.
    ResourceShareAssociation -> Maybe Text
resourceShareArn :: Prelude.Maybe Prelude.Text,
    -- | The time when the association was last updated.
    ResourceShareAssociation -> Maybe POSIX
lastUpdatedTime :: Prelude.Maybe Core.POSIX,
    -- | Indicates whether the principal belongs to the same organization in
    -- Organizations as the Amazon Web Services account that owns the resource
    -- share.
    ResourceShareAssociation -> Maybe Bool
external :: Prelude.Maybe Prelude.Bool,
    -- | The name of the resource share.
    ResourceShareAssociation -> Maybe Text
resourceShareName :: Prelude.Maybe Prelude.Text,
    -- | The associated entity. For resource associations, this is the Amazon
    -- Resource Name (ARN) of the resource. For principal associations, this is
    -- one of the following:
    --
    -- -   An Amazon Web Services account ID
    --
    -- -   An ARN of an organization in Organizations
    --
    -- -   An ARN of an organizational unit (OU) in Organizations
    --
    -- -   An ARN of an IAM role
    --
    -- -   An ARN of an IAM user
    ResourceShareAssociation -> Maybe Text
associatedEntity :: Prelude.Maybe Prelude.Text,
    -- | The association type.
    ResourceShareAssociation -> Maybe ResourceShareAssociationType
associationType :: Prelude.Maybe ResourceShareAssociationType,
    -- | A message about the status of the association.
    ResourceShareAssociation -> Maybe Text
statusMessage :: Prelude.Maybe Prelude.Text
  }
  deriving (ResourceShareAssociation -> ResourceShareAssociation -> Bool
(ResourceShareAssociation -> ResourceShareAssociation -> Bool)
-> (ResourceShareAssociation -> ResourceShareAssociation -> Bool)
-> Eq ResourceShareAssociation
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResourceShareAssociation -> ResourceShareAssociation -> Bool
$c/= :: ResourceShareAssociation -> ResourceShareAssociation -> Bool
== :: ResourceShareAssociation -> ResourceShareAssociation -> Bool
$c== :: ResourceShareAssociation -> ResourceShareAssociation -> Bool
Prelude.Eq, ReadPrec [ResourceShareAssociation]
ReadPrec ResourceShareAssociation
Int -> ReadS ResourceShareAssociation
ReadS [ResourceShareAssociation]
(Int -> ReadS ResourceShareAssociation)
-> ReadS [ResourceShareAssociation]
-> ReadPrec ResourceShareAssociation
-> ReadPrec [ResourceShareAssociation]
-> Read ResourceShareAssociation
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResourceShareAssociation]
$creadListPrec :: ReadPrec [ResourceShareAssociation]
readPrec :: ReadPrec ResourceShareAssociation
$creadPrec :: ReadPrec ResourceShareAssociation
readList :: ReadS [ResourceShareAssociation]
$creadList :: ReadS [ResourceShareAssociation]
readsPrec :: Int -> ReadS ResourceShareAssociation
$creadsPrec :: Int -> ReadS ResourceShareAssociation
Prelude.Read, Int -> ResourceShareAssociation -> ShowS
[ResourceShareAssociation] -> ShowS
ResourceShareAssociation -> String
(Int -> ResourceShareAssociation -> ShowS)
-> (ResourceShareAssociation -> String)
-> ([ResourceShareAssociation] -> ShowS)
-> Show ResourceShareAssociation
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResourceShareAssociation] -> ShowS
$cshowList :: [ResourceShareAssociation] -> ShowS
show :: ResourceShareAssociation -> String
$cshow :: ResourceShareAssociation -> String
showsPrec :: Int -> ResourceShareAssociation -> ShowS
$cshowsPrec :: Int -> ResourceShareAssociation -> ShowS
Prelude.Show, (forall x.
 ResourceShareAssociation -> Rep ResourceShareAssociation x)
-> (forall x.
    Rep ResourceShareAssociation x -> ResourceShareAssociation)
-> Generic ResourceShareAssociation
forall x.
Rep ResourceShareAssociation x -> ResourceShareAssociation
forall x.
ResourceShareAssociation -> Rep ResourceShareAssociation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ResourceShareAssociation x -> ResourceShareAssociation
$cfrom :: forall x.
ResourceShareAssociation -> Rep ResourceShareAssociation x
Prelude.Generic)

-- |
-- Create a value of 'ResourceShareAssociation' 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:
--
-- 'creationTime', 'resourceShareAssociation_creationTime' - The time when the association was created.
--
-- 'status', 'resourceShareAssociation_status' - The status of the association.
--
-- 'resourceShareArn', 'resourceShareAssociation_resourceShareArn' - The Amazon Resource Name (ARN) of the resource share.
--
-- 'lastUpdatedTime', 'resourceShareAssociation_lastUpdatedTime' - The time when the association was last updated.
--
-- 'external', 'resourceShareAssociation_external' - Indicates whether the principal belongs to the same organization in
-- Organizations as the Amazon Web Services account that owns the resource
-- share.
--
-- 'resourceShareName', 'resourceShareAssociation_resourceShareName' - The name of the resource share.
--
-- 'associatedEntity', 'resourceShareAssociation_associatedEntity' - The associated entity. For resource associations, this is the Amazon
-- Resource Name (ARN) of the resource. For principal associations, this is
-- one of the following:
--
-- -   An Amazon Web Services account ID
--
-- -   An ARN of an organization in Organizations
--
-- -   An ARN of an organizational unit (OU) in Organizations
--
-- -   An ARN of an IAM role
--
-- -   An ARN of an IAM user
--
-- 'associationType', 'resourceShareAssociation_associationType' - The association type.
--
-- 'statusMessage', 'resourceShareAssociation_statusMessage' - A message about the status of the association.
newResourceShareAssociation ::
  ResourceShareAssociation
newResourceShareAssociation :: ResourceShareAssociation
newResourceShareAssociation =
  ResourceShareAssociation' :: Maybe POSIX
-> Maybe ResourceShareAssociationStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe ResourceShareAssociationType
-> Maybe Text
-> ResourceShareAssociation
ResourceShareAssociation'
    { $sel:creationTime:ResourceShareAssociation' :: Maybe POSIX
creationTime =
        Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:status:ResourceShareAssociation' :: Maybe ResourceShareAssociationStatus
status = Maybe ResourceShareAssociationStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceShareArn:ResourceShareAssociation' :: Maybe Text
resourceShareArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedTime:ResourceShareAssociation' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:external:ResourceShareAssociation' :: Maybe Bool
external = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceShareName:ResourceShareAssociation' :: Maybe Text
resourceShareName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:associatedEntity:ResourceShareAssociation' :: Maybe Text
associatedEntity = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:associationType:ResourceShareAssociation' :: Maybe ResourceShareAssociationType
associationType = Maybe ResourceShareAssociationType
forall a. Maybe a
Prelude.Nothing,
      $sel:statusMessage:ResourceShareAssociation' :: Maybe Text
statusMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The time when the association was created.
resourceShareAssociation_creationTime :: Lens.Lens' ResourceShareAssociation (Prelude.Maybe Prelude.UTCTime)
resourceShareAssociation_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ResourceShareAssociation -> f ResourceShareAssociation
resourceShareAssociation_creationTime = (ResourceShareAssociation -> Maybe POSIX)
-> (ResourceShareAssociation
    -> Maybe POSIX -> ResourceShareAssociation)
-> Lens
     ResourceShareAssociation
     ResourceShareAssociation
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceShareAssociation' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:ResourceShareAssociation' :: ResourceShareAssociation -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: ResourceShareAssociation
s@ResourceShareAssociation' {} Maybe POSIX
a -> ResourceShareAssociation
s {$sel:creationTime:ResourceShareAssociation' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: ResourceShareAssociation) ((Maybe POSIX -> f (Maybe POSIX))
 -> ResourceShareAssociation -> f ResourceShareAssociation)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ResourceShareAssociation
-> f ResourceShareAssociation
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 status of the association.
resourceShareAssociation_status :: Lens.Lens' ResourceShareAssociation (Prelude.Maybe ResourceShareAssociationStatus)
resourceShareAssociation_status :: (Maybe ResourceShareAssociationStatus
 -> f (Maybe ResourceShareAssociationStatus))
-> ResourceShareAssociation -> f ResourceShareAssociation
resourceShareAssociation_status = (ResourceShareAssociation -> Maybe ResourceShareAssociationStatus)
-> (ResourceShareAssociation
    -> Maybe ResourceShareAssociationStatus
    -> ResourceShareAssociation)
-> Lens
     ResourceShareAssociation
     ResourceShareAssociation
     (Maybe ResourceShareAssociationStatus)
     (Maybe ResourceShareAssociationStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceShareAssociation' {Maybe ResourceShareAssociationStatus
status :: Maybe ResourceShareAssociationStatus
$sel:status:ResourceShareAssociation' :: ResourceShareAssociation -> Maybe ResourceShareAssociationStatus
status} -> Maybe ResourceShareAssociationStatus
status) (\s :: ResourceShareAssociation
s@ResourceShareAssociation' {} Maybe ResourceShareAssociationStatus
a -> ResourceShareAssociation
s {$sel:status:ResourceShareAssociation' :: Maybe ResourceShareAssociationStatus
status = Maybe ResourceShareAssociationStatus
a} :: ResourceShareAssociation)

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

-- | The time when the association was last updated.
resourceShareAssociation_lastUpdatedTime :: Lens.Lens' ResourceShareAssociation (Prelude.Maybe Prelude.UTCTime)
resourceShareAssociation_lastUpdatedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ResourceShareAssociation -> f ResourceShareAssociation
resourceShareAssociation_lastUpdatedTime = (ResourceShareAssociation -> Maybe POSIX)
-> (ResourceShareAssociation
    -> Maybe POSIX -> ResourceShareAssociation)
-> Lens
     ResourceShareAssociation
     ResourceShareAssociation
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceShareAssociation' {Maybe POSIX
lastUpdatedTime :: Maybe POSIX
$sel:lastUpdatedTime:ResourceShareAssociation' :: ResourceShareAssociation -> Maybe POSIX
lastUpdatedTime} -> Maybe POSIX
lastUpdatedTime) (\s :: ResourceShareAssociation
s@ResourceShareAssociation' {} Maybe POSIX
a -> ResourceShareAssociation
s {$sel:lastUpdatedTime:ResourceShareAssociation' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
a} :: ResourceShareAssociation) ((Maybe POSIX -> f (Maybe POSIX))
 -> ResourceShareAssociation -> f ResourceShareAssociation)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ResourceShareAssociation
-> f ResourceShareAssociation
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

-- | Indicates whether the principal belongs to the same organization in
-- Organizations as the Amazon Web Services account that owns the resource
-- share.
resourceShareAssociation_external :: Lens.Lens' ResourceShareAssociation (Prelude.Maybe Prelude.Bool)
resourceShareAssociation_external :: (Maybe Bool -> f (Maybe Bool))
-> ResourceShareAssociation -> f ResourceShareAssociation
resourceShareAssociation_external = (ResourceShareAssociation -> Maybe Bool)
-> (ResourceShareAssociation
    -> Maybe Bool -> ResourceShareAssociation)
-> Lens
     ResourceShareAssociation
     ResourceShareAssociation
     (Maybe Bool)
     (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceShareAssociation' {Maybe Bool
external :: Maybe Bool
$sel:external:ResourceShareAssociation' :: ResourceShareAssociation -> Maybe Bool
external} -> Maybe Bool
external) (\s :: ResourceShareAssociation
s@ResourceShareAssociation' {} Maybe Bool
a -> ResourceShareAssociation
s {$sel:external:ResourceShareAssociation' :: Maybe Bool
external = Maybe Bool
a} :: ResourceShareAssociation)

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

-- | The associated entity. For resource associations, this is the Amazon
-- Resource Name (ARN) of the resource. For principal associations, this is
-- one of the following:
--
-- -   An Amazon Web Services account ID
--
-- -   An ARN of an organization in Organizations
--
-- -   An ARN of an organizational unit (OU) in Organizations
--
-- -   An ARN of an IAM role
--
-- -   An ARN of an IAM user
resourceShareAssociation_associatedEntity :: Lens.Lens' ResourceShareAssociation (Prelude.Maybe Prelude.Text)
resourceShareAssociation_associatedEntity :: (Maybe Text -> f (Maybe Text))
-> ResourceShareAssociation -> f ResourceShareAssociation
resourceShareAssociation_associatedEntity = (ResourceShareAssociation -> Maybe Text)
-> (ResourceShareAssociation
    -> Maybe Text -> ResourceShareAssociation)
-> Lens
     ResourceShareAssociation
     ResourceShareAssociation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceShareAssociation' {Maybe Text
associatedEntity :: Maybe Text
$sel:associatedEntity:ResourceShareAssociation' :: ResourceShareAssociation -> Maybe Text
associatedEntity} -> Maybe Text
associatedEntity) (\s :: ResourceShareAssociation
s@ResourceShareAssociation' {} Maybe Text
a -> ResourceShareAssociation
s {$sel:associatedEntity:ResourceShareAssociation' :: Maybe Text
associatedEntity = Maybe Text
a} :: ResourceShareAssociation)

-- | The association type.
resourceShareAssociation_associationType :: Lens.Lens' ResourceShareAssociation (Prelude.Maybe ResourceShareAssociationType)
resourceShareAssociation_associationType :: (Maybe ResourceShareAssociationType
 -> f (Maybe ResourceShareAssociationType))
-> ResourceShareAssociation -> f ResourceShareAssociation
resourceShareAssociation_associationType = (ResourceShareAssociation -> Maybe ResourceShareAssociationType)
-> (ResourceShareAssociation
    -> Maybe ResourceShareAssociationType -> ResourceShareAssociation)
-> Lens
     ResourceShareAssociation
     ResourceShareAssociation
     (Maybe ResourceShareAssociationType)
     (Maybe ResourceShareAssociationType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceShareAssociation' {Maybe ResourceShareAssociationType
associationType :: Maybe ResourceShareAssociationType
$sel:associationType:ResourceShareAssociation' :: ResourceShareAssociation -> Maybe ResourceShareAssociationType
associationType} -> Maybe ResourceShareAssociationType
associationType) (\s :: ResourceShareAssociation
s@ResourceShareAssociation' {} Maybe ResourceShareAssociationType
a -> ResourceShareAssociation
s {$sel:associationType:ResourceShareAssociation' :: Maybe ResourceShareAssociationType
associationType = Maybe ResourceShareAssociationType
a} :: ResourceShareAssociation)

-- | A message about the status of the association.
resourceShareAssociation_statusMessage :: Lens.Lens' ResourceShareAssociation (Prelude.Maybe Prelude.Text)
resourceShareAssociation_statusMessage :: (Maybe Text -> f (Maybe Text))
-> ResourceShareAssociation -> f ResourceShareAssociation
resourceShareAssociation_statusMessage = (ResourceShareAssociation -> Maybe Text)
-> (ResourceShareAssociation
    -> Maybe Text -> ResourceShareAssociation)
-> Lens
     ResourceShareAssociation
     ResourceShareAssociation
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceShareAssociation' {Maybe Text
statusMessage :: Maybe Text
$sel:statusMessage:ResourceShareAssociation' :: ResourceShareAssociation -> Maybe Text
statusMessage} -> Maybe Text
statusMessage) (\s :: ResourceShareAssociation
s@ResourceShareAssociation' {} Maybe Text
a -> ResourceShareAssociation
s {$sel:statusMessage:ResourceShareAssociation' :: Maybe Text
statusMessage = Maybe Text
a} :: ResourceShareAssociation)

instance Core.FromJSON ResourceShareAssociation where
  parseJSON :: Value -> Parser ResourceShareAssociation
parseJSON =
    String
-> (Object -> Parser ResourceShareAssociation)
-> Value
-> Parser ResourceShareAssociation
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ResourceShareAssociation"
      ( \Object
x ->
          Maybe POSIX
-> Maybe ResourceShareAssociationStatus
-> Maybe Text
-> Maybe POSIX
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe ResourceShareAssociationType
-> Maybe Text
-> ResourceShareAssociation
ResourceShareAssociation'
            (Maybe POSIX
 -> Maybe ResourceShareAssociationStatus
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe ResourceShareAssociationType
 -> Maybe Text
 -> ResourceShareAssociation)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe ResourceShareAssociationStatus
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe ResourceShareAssociationType
      -> Maybe Text
      -> ResourceShareAssociation)
forall (f :: * -> *) a b. Functor 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
"creationTime")
            Parser
  (Maybe ResourceShareAssociationStatus
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe ResourceShareAssociationType
   -> Maybe Text
   -> ResourceShareAssociation)
-> Parser (Maybe ResourceShareAssociationStatus)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe ResourceShareAssociationType
      -> Maybe Text
      -> ResourceShareAssociation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResourceShareAssociationStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
            Parser
  (Maybe Text
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe ResourceShareAssociationType
   -> Maybe Text
   -> ResourceShareAssociation)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe ResourceShareAssociationType
      -> Maybe Text
      -> ResourceShareAssociation)
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 POSIX
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe ResourceShareAssociationType
   -> Maybe Text
   -> ResourceShareAssociation)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe ResourceShareAssociationType
      -> Maybe Text
      -> ResourceShareAssociation)
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
"lastUpdatedTime")
            Parser
  (Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe ResourceShareAssociationType
   -> Maybe Text
   -> ResourceShareAssociation)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe ResourceShareAssociationType
      -> Maybe Text
      -> ResourceShareAssociation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Bool)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"external")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe ResourceShareAssociationType
   -> Maybe Text
   -> ResourceShareAssociation)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe ResourceShareAssociationType
      -> Maybe Text
      -> ResourceShareAssociation)
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 ResourceShareAssociationType
   -> Maybe Text
   -> ResourceShareAssociation)
-> Parser (Maybe Text)
-> Parser
     (Maybe ResourceShareAssociationType
      -> Maybe Text -> ResourceShareAssociation)
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
"associatedEntity")
            Parser
  (Maybe ResourceShareAssociationType
   -> Maybe Text -> ResourceShareAssociation)
-> Parser (Maybe ResourceShareAssociationType)
-> Parser (Maybe Text -> ResourceShareAssociation)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResourceShareAssociationType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"associationType")
            Parser (Maybe Text -> ResourceShareAssociation)
-> Parser (Maybe Text) -> Parser ResourceShareAssociation
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
"statusMessage")
      )

instance Prelude.Hashable ResourceShareAssociation

instance Prelude.NFData ResourceShareAssociation