{-# 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 #-}
module Amazonka.SSM.Types.AccountSharingInfo where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AccountSharingInfo = AccountSharingInfo'
{
AccountSharingInfo -> Maybe Text
sharedDocumentVersion :: Prelude.Maybe Prelude.Text,
AccountSharingInfo -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text
}
deriving (AccountSharingInfo -> AccountSharingInfo -> Bool
(AccountSharingInfo -> AccountSharingInfo -> Bool)
-> (AccountSharingInfo -> AccountSharingInfo -> Bool)
-> Eq AccountSharingInfo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AccountSharingInfo -> AccountSharingInfo -> Bool
$c/= :: AccountSharingInfo -> AccountSharingInfo -> Bool
== :: AccountSharingInfo -> AccountSharingInfo -> Bool
$c== :: AccountSharingInfo -> AccountSharingInfo -> Bool
Prelude.Eq, ReadPrec [AccountSharingInfo]
ReadPrec AccountSharingInfo
Int -> ReadS AccountSharingInfo
ReadS [AccountSharingInfo]
(Int -> ReadS AccountSharingInfo)
-> ReadS [AccountSharingInfo]
-> ReadPrec AccountSharingInfo
-> ReadPrec [AccountSharingInfo]
-> Read AccountSharingInfo
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AccountSharingInfo]
$creadListPrec :: ReadPrec [AccountSharingInfo]
readPrec :: ReadPrec AccountSharingInfo
$creadPrec :: ReadPrec AccountSharingInfo
readList :: ReadS [AccountSharingInfo]
$creadList :: ReadS [AccountSharingInfo]
readsPrec :: Int -> ReadS AccountSharingInfo
$creadsPrec :: Int -> ReadS AccountSharingInfo
Prelude.Read, Int -> AccountSharingInfo -> ShowS
[AccountSharingInfo] -> ShowS
AccountSharingInfo -> String
(Int -> AccountSharingInfo -> ShowS)
-> (AccountSharingInfo -> String)
-> ([AccountSharingInfo] -> ShowS)
-> Show AccountSharingInfo
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AccountSharingInfo] -> ShowS
$cshowList :: [AccountSharingInfo] -> ShowS
show :: AccountSharingInfo -> String
$cshow :: AccountSharingInfo -> String
showsPrec :: Int -> AccountSharingInfo -> ShowS
$cshowsPrec :: Int -> AccountSharingInfo -> ShowS
Prelude.Show, (forall x. AccountSharingInfo -> Rep AccountSharingInfo x)
-> (forall x. Rep AccountSharingInfo x -> AccountSharingInfo)
-> Generic AccountSharingInfo
forall x. Rep AccountSharingInfo x -> AccountSharingInfo
forall x. AccountSharingInfo -> Rep AccountSharingInfo x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AccountSharingInfo x -> AccountSharingInfo
$cfrom :: forall x. AccountSharingInfo -> Rep AccountSharingInfo x
Prelude.Generic)
newAccountSharingInfo ::
AccountSharingInfo
newAccountSharingInfo :: AccountSharingInfo
newAccountSharingInfo =
AccountSharingInfo' :: Maybe Text -> Maybe Text -> AccountSharingInfo
AccountSharingInfo'
{ $sel:sharedDocumentVersion:AccountSharingInfo' :: Maybe Text
sharedDocumentVersion =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:accountId:AccountSharingInfo' :: Maybe Text
accountId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
accountSharingInfo_sharedDocumentVersion :: Lens.Lens' AccountSharingInfo (Prelude.Maybe Prelude.Text)
accountSharingInfo_sharedDocumentVersion :: (Maybe Text -> f (Maybe Text))
-> AccountSharingInfo -> f AccountSharingInfo
accountSharingInfo_sharedDocumentVersion = (AccountSharingInfo -> Maybe Text)
-> (AccountSharingInfo -> Maybe Text -> AccountSharingInfo)
-> Lens
AccountSharingInfo AccountSharingInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountSharingInfo' {Maybe Text
sharedDocumentVersion :: Maybe Text
$sel:sharedDocumentVersion:AccountSharingInfo' :: AccountSharingInfo -> Maybe Text
sharedDocumentVersion} -> Maybe Text
sharedDocumentVersion) (\s :: AccountSharingInfo
s@AccountSharingInfo' {} Maybe Text
a -> AccountSharingInfo
s {$sel:sharedDocumentVersion:AccountSharingInfo' :: Maybe Text
sharedDocumentVersion = Maybe Text
a} :: AccountSharingInfo)
accountSharingInfo_accountId :: Lens.Lens' AccountSharingInfo (Prelude.Maybe Prelude.Text)
accountSharingInfo_accountId :: (Maybe Text -> f (Maybe Text))
-> AccountSharingInfo -> f AccountSharingInfo
accountSharingInfo_accountId = (AccountSharingInfo -> Maybe Text)
-> (AccountSharingInfo -> Maybe Text -> AccountSharingInfo)
-> Lens
AccountSharingInfo AccountSharingInfo (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AccountSharingInfo' {Maybe Text
accountId :: Maybe Text
$sel:accountId:AccountSharingInfo' :: AccountSharingInfo -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: AccountSharingInfo
s@AccountSharingInfo' {} Maybe Text
a -> AccountSharingInfo
s {$sel:accountId:AccountSharingInfo' :: Maybe Text
accountId = Maybe Text
a} :: AccountSharingInfo)
instance Core.FromJSON AccountSharingInfo where
parseJSON :: Value -> Parser AccountSharingInfo
parseJSON =
String
-> (Object -> Parser AccountSharingInfo)
-> Value
-> Parser AccountSharingInfo
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AccountSharingInfo"
( \Object
x ->
Maybe Text -> Maybe Text -> AccountSharingInfo
AccountSharingInfo'
(Maybe Text -> Maybe Text -> AccountSharingInfo)
-> Parser (Maybe Text) -> Parser (Maybe Text -> AccountSharingInfo)
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
"SharedDocumentVersion")
Parser (Maybe Text -> AccountSharingInfo)
-> Parser (Maybe Text) -> Parser AccountSharingInfo
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
"AccountId")
)
instance Prelude.Hashable AccountSharingInfo
instance Prelude.NFData AccountSharingInfo