{-# 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.WellArchitected.Types.WorkloadShare where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.WellArchitected.Types.PermissionType
import Amazonka.WellArchitected.Types.ShareStatus
data WorkloadShare = WorkloadShare'
{ WorkloadShare -> Maybe ShareStatus
status :: Prelude.Maybe ShareStatus,
WorkloadShare -> Maybe Text
sharedBy :: Prelude.Maybe Prelude.Text,
WorkloadShare -> Maybe Text
sharedWith :: Prelude.Maybe Prelude.Text,
WorkloadShare -> Maybe PermissionType
permissionType :: Prelude.Maybe PermissionType,
WorkloadShare -> Maybe Text
workloadId :: Prelude.Maybe Prelude.Text,
WorkloadShare -> Maybe Text
workloadName :: Prelude.Maybe Prelude.Text,
WorkloadShare -> Maybe Text
shareId :: Prelude.Maybe Prelude.Text
}
deriving (WorkloadShare -> WorkloadShare -> Bool
(WorkloadShare -> WorkloadShare -> Bool)
-> (WorkloadShare -> WorkloadShare -> Bool) -> Eq WorkloadShare
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WorkloadShare -> WorkloadShare -> Bool
$c/= :: WorkloadShare -> WorkloadShare -> Bool
== :: WorkloadShare -> WorkloadShare -> Bool
$c== :: WorkloadShare -> WorkloadShare -> Bool
Prelude.Eq, ReadPrec [WorkloadShare]
ReadPrec WorkloadShare
Int -> ReadS WorkloadShare
ReadS [WorkloadShare]
(Int -> ReadS WorkloadShare)
-> ReadS [WorkloadShare]
-> ReadPrec WorkloadShare
-> ReadPrec [WorkloadShare]
-> Read WorkloadShare
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WorkloadShare]
$creadListPrec :: ReadPrec [WorkloadShare]
readPrec :: ReadPrec WorkloadShare
$creadPrec :: ReadPrec WorkloadShare
readList :: ReadS [WorkloadShare]
$creadList :: ReadS [WorkloadShare]
readsPrec :: Int -> ReadS WorkloadShare
$creadsPrec :: Int -> ReadS WorkloadShare
Prelude.Read, Int -> WorkloadShare -> ShowS
[WorkloadShare] -> ShowS
WorkloadShare -> String
(Int -> WorkloadShare -> ShowS)
-> (WorkloadShare -> String)
-> ([WorkloadShare] -> ShowS)
-> Show WorkloadShare
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WorkloadShare] -> ShowS
$cshowList :: [WorkloadShare] -> ShowS
show :: WorkloadShare -> String
$cshow :: WorkloadShare -> String
showsPrec :: Int -> WorkloadShare -> ShowS
$cshowsPrec :: Int -> WorkloadShare -> ShowS
Prelude.Show, (forall x. WorkloadShare -> Rep WorkloadShare x)
-> (forall x. Rep WorkloadShare x -> WorkloadShare)
-> Generic WorkloadShare
forall x. Rep WorkloadShare x -> WorkloadShare
forall x. WorkloadShare -> Rep WorkloadShare x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WorkloadShare x -> WorkloadShare
$cfrom :: forall x. WorkloadShare -> Rep WorkloadShare x
Prelude.Generic)
newWorkloadShare ::
WorkloadShare
newWorkloadShare :: WorkloadShare
newWorkloadShare =
WorkloadShare' :: Maybe ShareStatus
-> Maybe Text
-> Maybe Text
-> Maybe PermissionType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> WorkloadShare
WorkloadShare'
{ $sel:status:WorkloadShare' :: Maybe ShareStatus
status = Maybe ShareStatus
forall a. Maybe a
Prelude.Nothing,
$sel:sharedBy:WorkloadShare' :: Maybe Text
sharedBy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:sharedWith:WorkloadShare' :: Maybe Text
sharedWith = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:permissionType:WorkloadShare' :: Maybe PermissionType
permissionType = Maybe PermissionType
forall a. Maybe a
Prelude.Nothing,
$sel:workloadId:WorkloadShare' :: Maybe Text
workloadId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:workloadName:WorkloadShare' :: Maybe Text
workloadName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:shareId:WorkloadShare' :: Maybe Text
shareId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
workloadShare_status :: Lens.Lens' WorkloadShare (Prelude.Maybe ShareStatus)
workloadShare_status :: (Maybe ShareStatus -> f (Maybe ShareStatus))
-> WorkloadShare -> f WorkloadShare
workloadShare_status = (WorkloadShare -> Maybe ShareStatus)
-> (WorkloadShare -> Maybe ShareStatus -> WorkloadShare)
-> Lens
WorkloadShare WorkloadShare (Maybe ShareStatus) (Maybe ShareStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkloadShare' {Maybe ShareStatus
status :: Maybe ShareStatus
$sel:status:WorkloadShare' :: WorkloadShare -> Maybe ShareStatus
status} -> Maybe ShareStatus
status) (\s :: WorkloadShare
s@WorkloadShare' {} Maybe ShareStatus
a -> WorkloadShare
s {$sel:status:WorkloadShare' :: Maybe ShareStatus
status = Maybe ShareStatus
a} :: WorkloadShare)
workloadShare_sharedBy :: Lens.Lens' WorkloadShare (Prelude.Maybe Prelude.Text)
workloadShare_sharedBy :: (Maybe Text -> f (Maybe Text)) -> WorkloadShare -> f WorkloadShare
workloadShare_sharedBy = (WorkloadShare -> Maybe Text)
-> (WorkloadShare -> Maybe Text -> WorkloadShare)
-> Lens WorkloadShare WorkloadShare (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkloadShare' {Maybe Text
sharedBy :: Maybe Text
$sel:sharedBy:WorkloadShare' :: WorkloadShare -> Maybe Text
sharedBy} -> Maybe Text
sharedBy) (\s :: WorkloadShare
s@WorkloadShare' {} Maybe Text
a -> WorkloadShare
s {$sel:sharedBy:WorkloadShare' :: Maybe Text
sharedBy = Maybe Text
a} :: WorkloadShare)
workloadShare_sharedWith :: Lens.Lens' WorkloadShare (Prelude.Maybe Prelude.Text)
workloadShare_sharedWith :: (Maybe Text -> f (Maybe Text)) -> WorkloadShare -> f WorkloadShare
workloadShare_sharedWith = (WorkloadShare -> Maybe Text)
-> (WorkloadShare -> Maybe Text -> WorkloadShare)
-> Lens WorkloadShare WorkloadShare (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkloadShare' {Maybe Text
sharedWith :: Maybe Text
$sel:sharedWith:WorkloadShare' :: WorkloadShare -> Maybe Text
sharedWith} -> Maybe Text
sharedWith) (\s :: WorkloadShare
s@WorkloadShare' {} Maybe Text
a -> WorkloadShare
s {$sel:sharedWith:WorkloadShare' :: Maybe Text
sharedWith = Maybe Text
a} :: WorkloadShare)
workloadShare_permissionType :: Lens.Lens' WorkloadShare (Prelude.Maybe PermissionType)
workloadShare_permissionType :: (Maybe PermissionType -> f (Maybe PermissionType))
-> WorkloadShare -> f WorkloadShare
workloadShare_permissionType = (WorkloadShare -> Maybe PermissionType)
-> (WorkloadShare -> Maybe PermissionType -> WorkloadShare)
-> Lens
WorkloadShare
WorkloadShare
(Maybe PermissionType)
(Maybe PermissionType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkloadShare' {Maybe PermissionType
permissionType :: Maybe PermissionType
$sel:permissionType:WorkloadShare' :: WorkloadShare -> Maybe PermissionType
permissionType} -> Maybe PermissionType
permissionType) (\s :: WorkloadShare
s@WorkloadShare' {} Maybe PermissionType
a -> WorkloadShare
s {$sel:permissionType:WorkloadShare' :: Maybe PermissionType
permissionType = Maybe PermissionType
a} :: WorkloadShare)
workloadShare_workloadId :: Lens.Lens' WorkloadShare (Prelude.Maybe Prelude.Text)
workloadShare_workloadId :: (Maybe Text -> f (Maybe Text)) -> WorkloadShare -> f WorkloadShare
workloadShare_workloadId = (WorkloadShare -> Maybe Text)
-> (WorkloadShare -> Maybe Text -> WorkloadShare)
-> Lens WorkloadShare WorkloadShare (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkloadShare' {Maybe Text
workloadId :: Maybe Text
$sel:workloadId:WorkloadShare' :: WorkloadShare -> Maybe Text
workloadId} -> Maybe Text
workloadId) (\s :: WorkloadShare
s@WorkloadShare' {} Maybe Text
a -> WorkloadShare
s {$sel:workloadId:WorkloadShare' :: Maybe Text
workloadId = Maybe Text
a} :: WorkloadShare)
workloadShare_workloadName :: Lens.Lens' WorkloadShare (Prelude.Maybe Prelude.Text)
workloadShare_workloadName :: (Maybe Text -> f (Maybe Text)) -> WorkloadShare -> f WorkloadShare
workloadShare_workloadName = (WorkloadShare -> Maybe Text)
-> (WorkloadShare -> Maybe Text -> WorkloadShare)
-> Lens WorkloadShare WorkloadShare (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkloadShare' {Maybe Text
workloadName :: Maybe Text
$sel:workloadName:WorkloadShare' :: WorkloadShare -> Maybe Text
workloadName} -> Maybe Text
workloadName) (\s :: WorkloadShare
s@WorkloadShare' {} Maybe Text
a -> WorkloadShare
s {$sel:workloadName:WorkloadShare' :: Maybe Text
workloadName = Maybe Text
a} :: WorkloadShare)
workloadShare_shareId :: Lens.Lens' WorkloadShare (Prelude.Maybe Prelude.Text)
workloadShare_shareId :: (Maybe Text -> f (Maybe Text)) -> WorkloadShare -> f WorkloadShare
workloadShare_shareId = (WorkloadShare -> Maybe Text)
-> (WorkloadShare -> Maybe Text -> WorkloadShare)
-> Lens WorkloadShare WorkloadShare (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WorkloadShare' {Maybe Text
shareId :: Maybe Text
$sel:shareId:WorkloadShare' :: WorkloadShare -> Maybe Text
shareId} -> Maybe Text
shareId) (\s :: WorkloadShare
s@WorkloadShare' {} Maybe Text
a -> WorkloadShare
s {$sel:shareId:WorkloadShare' :: Maybe Text
shareId = Maybe Text
a} :: WorkloadShare)
instance Core.FromJSON WorkloadShare where
parseJSON :: Value -> Parser WorkloadShare
parseJSON =
String
-> (Object -> Parser WorkloadShare)
-> Value
-> Parser WorkloadShare
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"WorkloadShare"
( \Object
x ->
Maybe ShareStatus
-> Maybe Text
-> Maybe Text
-> Maybe PermissionType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> WorkloadShare
WorkloadShare'
(Maybe ShareStatus
-> Maybe Text
-> Maybe Text
-> Maybe PermissionType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> WorkloadShare)
-> Parser (Maybe ShareStatus)
-> Parser
(Maybe Text
-> Maybe Text
-> Maybe PermissionType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> WorkloadShare)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ShareStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
Parser
(Maybe Text
-> Maybe Text
-> Maybe PermissionType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> WorkloadShare)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe PermissionType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> WorkloadShare)
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
"SharedBy")
Parser
(Maybe Text
-> Maybe PermissionType
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> WorkloadShare)
-> Parser (Maybe Text)
-> Parser
(Maybe PermissionType
-> Maybe Text -> Maybe Text -> Maybe Text -> WorkloadShare)
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
"SharedWith")
Parser
(Maybe PermissionType
-> Maybe Text -> Maybe Text -> Maybe Text -> WorkloadShare)
-> Parser (Maybe PermissionType)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> WorkloadShare)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe PermissionType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PermissionType")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> WorkloadShare)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> WorkloadShare)
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
"WorkloadId")
Parser (Maybe Text -> Maybe Text -> WorkloadShare)
-> Parser (Maybe Text) -> Parser (Maybe Text -> WorkloadShare)
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
"WorkloadName")
Parser (Maybe Text -> WorkloadShare)
-> Parser (Maybe Text) -> Parser WorkloadShare
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
"ShareId")
)
instance Prelude.Hashable WorkloadShare
instance Prelude.NFData WorkloadShare