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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.RAM.Types.ResourceShareFeatureSet
import Amazonka.RAM.Types.ResourceShareStatus
import Amazonka.RAM.Types.Tag

-- | Describes a resource share.
--
-- /See:/ 'newResourceShare' smart constructor.
data ResourceShare = ResourceShare'
  { -- | The time when the resource share was created.
    ResourceShare -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
    -- | The status of the resource share.
    ResourceShare -> Maybe ResourceShareStatus
status :: Prelude.Maybe ResourceShareStatus,
    -- | The Amazon Resource Name (ARN) of the resource share.
    ResourceShare -> Maybe Text
resourceShareArn :: Prelude.Maybe Prelude.Text,
    -- | The ID of the Amazon Web Services account that owns the resource share.
    ResourceShare -> Maybe Text
owningAccountId :: Prelude.Maybe Prelude.Text,
    -- | The time when the resource share was last updated.
    ResourceShare -> Maybe POSIX
lastUpdatedTime :: Prelude.Maybe Core.POSIX,
    -- | Indicates whether principals outside your organization in Organizations
    -- can be associated with a resource share.
    ResourceShare -> Maybe Bool
allowExternalPrincipals :: Prelude.Maybe Prelude.Bool,
    -- | The name of the resource share.
    ResourceShare -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | A message about the status of the resource share.
    ResourceShare -> Maybe Text
statusMessage :: Prelude.Maybe Prelude.Text,
    -- | Indicates how the resource share was created. Possible values include:
    --
    -- -   @CREATED_FROM_POLICY@ - Indicates that the resource share was
    --     created from an Amazon Web Services Identity and Access Management
    --     (Amazon Web Services IAM) policy attached to a resource. These
    --     resource shares are visible only to the Amazon Web Services account
    --     that created it. They cannot be modified in RAM.
    --
    -- -   @PROMOTING_TO_STANDARD@ - The resource share is in the process of
    --     being promoted. For more information, see
    --     PromoteResourceShareCreatedFromPolicy.
    --
    -- -   @STANDARD@ - Indicates that the resource share was created in RAM
    --     using the console or APIs. These resource shares are visible to all
    --     principals. They can be modified in RAM.
    ResourceShare -> Maybe ResourceShareFeatureSet
featureSet :: Prelude.Maybe ResourceShareFeatureSet,
    -- | The tags for the resource share.
    ResourceShare -> Maybe [Tag]
tags :: Prelude.Maybe [Tag]
  }
  deriving (ResourceShare -> ResourceShare -> Bool
(ResourceShare -> ResourceShare -> Bool)
-> (ResourceShare -> ResourceShare -> Bool) -> Eq ResourceShare
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ResourceShare -> ResourceShare -> Bool
$c/= :: ResourceShare -> ResourceShare -> Bool
== :: ResourceShare -> ResourceShare -> Bool
$c== :: ResourceShare -> ResourceShare -> Bool
Prelude.Eq, ReadPrec [ResourceShare]
ReadPrec ResourceShare
Int -> ReadS ResourceShare
ReadS [ResourceShare]
(Int -> ReadS ResourceShare)
-> ReadS [ResourceShare]
-> ReadPrec ResourceShare
-> ReadPrec [ResourceShare]
-> Read ResourceShare
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ResourceShare]
$creadListPrec :: ReadPrec [ResourceShare]
readPrec :: ReadPrec ResourceShare
$creadPrec :: ReadPrec ResourceShare
readList :: ReadS [ResourceShare]
$creadList :: ReadS [ResourceShare]
readsPrec :: Int -> ReadS ResourceShare
$creadsPrec :: Int -> ReadS ResourceShare
Prelude.Read, Int -> ResourceShare -> ShowS
[ResourceShare] -> ShowS
ResourceShare -> String
(Int -> ResourceShare -> ShowS)
-> (ResourceShare -> String)
-> ([ResourceShare] -> ShowS)
-> Show ResourceShare
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ResourceShare] -> ShowS
$cshowList :: [ResourceShare] -> ShowS
show :: ResourceShare -> String
$cshow :: ResourceShare -> String
showsPrec :: Int -> ResourceShare -> ShowS
$cshowsPrec :: Int -> ResourceShare -> ShowS
Prelude.Show, (forall x. ResourceShare -> Rep ResourceShare x)
-> (forall x. Rep ResourceShare x -> ResourceShare)
-> Generic ResourceShare
forall x. Rep ResourceShare x -> ResourceShare
forall x. ResourceShare -> Rep ResourceShare x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ResourceShare x -> ResourceShare
$cfrom :: forall x. ResourceShare -> Rep ResourceShare x
Prelude.Generic)

-- |
-- Create a value of 'ResourceShare' 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', 'resourceShare_creationTime' - The time when the resource share was created.
--
-- 'status', 'resourceShare_status' - The status of the resource share.
--
-- 'resourceShareArn', 'resourceShare_resourceShareArn' - The Amazon Resource Name (ARN) of the resource share.
--
-- 'owningAccountId', 'resourceShare_owningAccountId' - The ID of the Amazon Web Services account that owns the resource share.
--
-- 'lastUpdatedTime', 'resourceShare_lastUpdatedTime' - The time when the resource share was last updated.
--
-- 'allowExternalPrincipals', 'resourceShare_allowExternalPrincipals' - Indicates whether principals outside your organization in Organizations
-- can be associated with a resource share.
--
-- 'name', 'resourceShare_name' - The name of the resource share.
--
-- 'statusMessage', 'resourceShare_statusMessage' - A message about the status of the resource share.
--
-- 'featureSet', 'resourceShare_featureSet' - Indicates how the resource share was created. Possible values include:
--
-- -   @CREATED_FROM_POLICY@ - Indicates that the resource share was
--     created from an Amazon Web Services Identity and Access Management
--     (Amazon Web Services IAM) policy attached to a resource. These
--     resource shares are visible only to the Amazon Web Services account
--     that created it. They cannot be modified in RAM.
--
-- -   @PROMOTING_TO_STANDARD@ - The resource share is in the process of
--     being promoted. For more information, see
--     PromoteResourceShareCreatedFromPolicy.
--
-- -   @STANDARD@ - Indicates that the resource share was created in RAM
--     using the console or APIs. These resource shares are visible to all
--     principals. They can be modified in RAM.
--
-- 'tags', 'resourceShare_tags' - The tags for the resource share.
newResourceShare ::
  ResourceShare
newResourceShare :: ResourceShare
newResourceShare =
  ResourceShare' :: Maybe POSIX
-> Maybe ResourceShareStatus
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe ResourceShareFeatureSet
-> Maybe [Tag]
-> ResourceShare
ResourceShare'
    { $sel:creationTime:ResourceShare' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:status:ResourceShare' :: Maybe ResourceShareStatus
status = Maybe ResourceShareStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:resourceShareArn:ResourceShare' :: Maybe Text
resourceShareArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:owningAccountId:ResourceShare' :: Maybe Text
owningAccountId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdatedTime:ResourceShare' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:allowExternalPrincipals:ResourceShare' :: Maybe Bool
allowExternalPrincipals = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:name:ResourceShare' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:statusMessage:ResourceShare' :: Maybe Text
statusMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:featureSet:ResourceShare' :: Maybe ResourceShareFeatureSet
featureSet = Maybe ResourceShareFeatureSet
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:ResourceShare' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing
    }

-- | The time when the resource share was created.
resourceShare_creationTime :: Lens.Lens' ResourceShare (Prelude.Maybe Prelude.UTCTime)
resourceShare_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ResourceShare -> f ResourceShare
resourceShare_creationTime = (ResourceShare -> Maybe POSIX)
-> (ResourceShare -> Maybe POSIX -> ResourceShare)
-> Lens ResourceShare ResourceShare (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceShare' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:ResourceShare' :: ResourceShare -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: ResourceShare
s@ResourceShare' {} Maybe POSIX
a -> ResourceShare
s {$sel:creationTime:ResourceShare' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: ResourceShare) ((Maybe POSIX -> f (Maybe POSIX))
 -> ResourceShare -> f ResourceShare)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ResourceShare
-> f ResourceShare
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 resource share.
resourceShare_status :: Lens.Lens' ResourceShare (Prelude.Maybe ResourceShareStatus)
resourceShare_status :: (Maybe ResourceShareStatus -> f (Maybe ResourceShareStatus))
-> ResourceShare -> f ResourceShare
resourceShare_status = (ResourceShare -> Maybe ResourceShareStatus)
-> (ResourceShare -> Maybe ResourceShareStatus -> ResourceShare)
-> Lens
     ResourceShare
     ResourceShare
     (Maybe ResourceShareStatus)
     (Maybe ResourceShareStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceShare' {Maybe ResourceShareStatus
status :: Maybe ResourceShareStatus
$sel:status:ResourceShare' :: ResourceShare -> Maybe ResourceShareStatus
status} -> Maybe ResourceShareStatus
status) (\s :: ResourceShare
s@ResourceShare' {} Maybe ResourceShareStatus
a -> ResourceShare
s {$sel:status:ResourceShare' :: Maybe ResourceShareStatus
status = Maybe ResourceShareStatus
a} :: ResourceShare)

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

-- | The ID of the Amazon Web Services account that owns the resource share.
resourceShare_owningAccountId :: Lens.Lens' ResourceShare (Prelude.Maybe Prelude.Text)
resourceShare_owningAccountId :: (Maybe Text -> f (Maybe Text)) -> ResourceShare -> f ResourceShare
resourceShare_owningAccountId = (ResourceShare -> Maybe Text)
-> (ResourceShare -> Maybe Text -> ResourceShare)
-> Lens ResourceShare ResourceShare (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceShare' {Maybe Text
owningAccountId :: Maybe Text
$sel:owningAccountId:ResourceShare' :: ResourceShare -> Maybe Text
owningAccountId} -> Maybe Text
owningAccountId) (\s :: ResourceShare
s@ResourceShare' {} Maybe Text
a -> ResourceShare
s {$sel:owningAccountId:ResourceShare' :: Maybe Text
owningAccountId = Maybe Text
a} :: ResourceShare)

-- | The time when the resource share was last updated.
resourceShare_lastUpdatedTime :: Lens.Lens' ResourceShare (Prelude.Maybe Prelude.UTCTime)
resourceShare_lastUpdatedTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ResourceShare -> f ResourceShare
resourceShare_lastUpdatedTime = (ResourceShare -> Maybe POSIX)
-> (ResourceShare -> Maybe POSIX -> ResourceShare)
-> Lens ResourceShare ResourceShare (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceShare' {Maybe POSIX
lastUpdatedTime :: Maybe POSIX
$sel:lastUpdatedTime:ResourceShare' :: ResourceShare -> Maybe POSIX
lastUpdatedTime} -> Maybe POSIX
lastUpdatedTime) (\s :: ResourceShare
s@ResourceShare' {} Maybe POSIX
a -> ResourceShare
s {$sel:lastUpdatedTime:ResourceShare' :: Maybe POSIX
lastUpdatedTime = Maybe POSIX
a} :: ResourceShare) ((Maybe POSIX -> f (Maybe POSIX))
 -> ResourceShare -> f ResourceShare)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ResourceShare
-> f ResourceShare
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 principals outside your organization in Organizations
-- can be associated with a resource share.
resourceShare_allowExternalPrincipals :: Lens.Lens' ResourceShare (Prelude.Maybe Prelude.Bool)
resourceShare_allowExternalPrincipals :: (Maybe Bool -> f (Maybe Bool)) -> ResourceShare -> f ResourceShare
resourceShare_allowExternalPrincipals = (ResourceShare -> Maybe Bool)
-> (ResourceShare -> Maybe Bool -> ResourceShare)
-> Lens ResourceShare ResourceShare (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceShare' {Maybe Bool
allowExternalPrincipals :: Maybe Bool
$sel:allowExternalPrincipals:ResourceShare' :: ResourceShare -> Maybe Bool
allowExternalPrincipals} -> Maybe Bool
allowExternalPrincipals) (\s :: ResourceShare
s@ResourceShare' {} Maybe Bool
a -> ResourceShare
s {$sel:allowExternalPrincipals:ResourceShare' :: Maybe Bool
allowExternalPrincipals = Maybe Bool
a} :: ResourceShare)

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

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

-- | Indicates how the resource share was created. Possible values include:
--
-- -   @CREATED_FROM_POLICY@ - Indicates that the resource share was
--     created from an Amazon Web Services Identity and Access Management
--     (Amazon Web Services IAM) policy attached to a resource. These
--     resource shares are visible only to the Amazon Web Services account
--     that created it. They cannot be modified in RAM.
--
-- -   @PROMOTING_TO_STANDARD@ - The resource share is in the process of
--     being promoted. For more information, see
--     PromoteResourceShareCreatedFromPolicy.
--
-- -   @STANDARD@ - Indicates that the resource share was created in RAM
--     using the console or APIs. These resource shares are visible to all
--     principals. They can be modified in RAM.
resourceShare_featureSet :: Lens.Lens' ResourceShare (Prelude.Maybe ResourceShareFeatureSet)
resourceShare_featureSet :: (Maybe ResourceShareFeatureSet
 -> f (Maybe ResourceShareFeatureSet))
-> ResourceShare -> f ResourceShare
resourceShare_featureSet = (ResourceShare -> Maybe ResourceShareFeatureSet)
-> (ResourceShare
    -> Maybe ResourceShareFeatureSet -> ResourceShare)
-> Lens
     ResourceShare
     ResourceShare
     (Maybe ResourceShareFeatureSet)
     (Maybe ResourceShareFeatureSet)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceShare' {Maybe ResourceShareFeatureSet
featureSet :: Maybe ResourceShareFeatureSet
$sel:featureSet:ResourceShare' :: ResourceShare -> Maybe ResourceShareFeatureSet
featureSet} -> Maybe ResourceShareFeatureSet
featureSet) (\s :: ResourceShare
s@ResourceShare' {} Maybe ResourceShareFeatureSet
a -> ResourceShare
s {$sel:featureSet:ResourceShare' :: Maybe ResourceShareFeatureSet
featureSet = Maybe ResourceShareFeatureSet
a} :: ResourceShare)

-- | The tags for the resource share.
resourceShare_tags :: Lens.Lens' ResourceShare (Prelude.Maybe [Tag])
resourceShare_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> ResourceShare -> f ResourceShare
resourceShare_tags = (ResourceShare -> Maybe [Tag])
-> (ResourceShare -> Maybe [Tag] -> ResourceShare)
-> Lens ResourceShare ResourceShare (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ResourceShare' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:ResourceShare' :: ResourceShare -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: ResourceShare
s@ResourceShare' {} Maybe [Tag]
a -> ResourceShare
s {$sel:tags:ResourceShare' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: ResourceShare) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> ResourceShare -> f ResourceShare)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> ResourceShare
-> f ResourceShare
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON ResourceShare where
  parseJSON :: Value -> Parser ResourceShare
parseJSON =
    String
-> (Object -> Parser ResourceShare)
-> Value
-> Parser ResourceShare
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ResourceShare"
      ( \Object
x ->
          Maybe POSIX
-> Maybe ResourceShareStatus
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Bool
-> Maybe Text
-> Maybe Text
-> Maybe ResourceShareFeatureSet
-> Maybe [Tag]
-> ResourceShare
ResourceShare'
            (Maybe POSIX
 -> Maybe ResourceShareStatus
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Bool
 -> Maybe Text
 -> Maybe Text
 -> Maybe ResourceShareFeatureSet
 -> Maybe [Tag]
 -> ResourceShare)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe ResourceShareStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe ResourceShareFeatureSet
      -> Maybe [Tag]
      -> ResourceShare)
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 ResourceShareStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe ResourceShareFeatureSet
   -> Maybe [Tag]
   -> ResourceShare)
-> Parser (Maybe ResourceShareStatus)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe ResourceShareFeatureSet
      -> Maybe [Tag]
      -> ResourceShare)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResourceShareStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe ResourceShareFeatureSet
   -> Maybe [Tag]
   -> ResourceShare)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe POSIX
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe ResourceShareFeatureSet
      -> Maybe [Tag]
      -> ResourceShare)
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 POSIX
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe ResourceShareFeatureSet
   -> Maybe [Tag]
   -> ResourceShare)
-> Parser (Maybe Text)
-> Parser
     (Maybe POSIX
      -> Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe ResourceShareFeatureSet
      -> Maybe [Tag]
      -> ResourceShare)
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
"owningAccountId")
            Parser
  (Maybe POSIX
   -> Maybe Bool
   -> Maybe Text
   -> Maybe Text
   -> Maybe ResourceShareFeatureSet
   -> Maybe [Tag]
   -> ResourceShare)
-> Parser (Maybe POSIX)
-> Parser
     (Maybe Bool
      -> Maybe Text
      -> Maybe Text
      -> Maybe ResourceShareFeatureSet
      -> Maybe [Tag]
      -> ResourceShare)
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 ResourceShareFeatureSet
   -> Maybe [Tag]
   -> ResourceShare)
-> Parser (Maybe Bool)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe ResourceShareFeatureSet
      -> Maybe [Tag]
      -> ResourceShare)
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
"allowExternalPrincipals")
            Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe ResourceShareFeatureSet
   -> Maybe [Tag]
   -> ResourceShare)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe ResourceShareFeatureSet -> Maybe [Tag] -> ResourceShare)
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
"name")
            Parser
  (Maybe Text
   -> Maybe ResourceShareFeatureSet -> Maybe [Tag] -> ResourceShare)
-> Parser (Maybe Text)
-> Parser
     (Maybe ResourceShareFeatureSet -> Maybe [Tag] -> ResourceShare)
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")
            Parser
  (Maybe ResourceShareFeatureSet -> Maybe [Tag] -> ResourceShare)
-> Parser (Maybe ResourceShareFeatureSet)
-> Parser (Maybe [Tag] -> ResourceShare)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResourceShareFeatureSet)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"featureSet")
            Parser (Maybe [Tag] -> ResourceShare)
-> Parser (Maybe [Tag]) -> Parser ResourceShare
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe [Tag]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe [Tag])) -> Maybe [Tag] -> Parser (Maybe [Tag])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Tag]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable ResourceShare

instance Prelude.NFData ResourceShare