{-# 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.Organizations.Types.HandshakeResource where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.Organizations.Types.HandshakeResourceType
import qualified Amazonka.Prelude as Prelude
data HandshakeResource = HandshakeResource'
{
HandshakeResource -> Maybe [HandshakeResource]
resources :: Prelude.Maybe [HandshakeResource],
HandshakeResource -> Maybe HandshakeResourceType
type' :: Prelude.Maybe HandshakeResourceType,
HandshakeResource -> Maybe (Sensitive Text)
value :: Prelude.Maybe (Data.Sensitive Prelude.Text)
}
deriving (HandshakeResource -> HandshakeResource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HandshakeResource -> HandshakeResource -> Bool
$c/= :: HandshakeResource -> HandshakeResource -> Bool
== :: HandshakeResource -> HandshakeResource -> Bool
$c== :: HandshakeResource -> HandshakeResource -> Bool
Prelude.Eq, Int -> HandshakeResource -> ShowS
[HandshakeResource] -> ShowS
HandshakeResource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HandshakeResource] -> ShowS
$cshowList :: [HandshakeResource] -> ShowS
show :: HandshakeResource -> String
$cshow :: HandshakeResource -> String
showsPrec :: Int -> HandshakeResource -> ShowS
$cshowsPrec :: Int -> HandshakeResource -> ShowS
Prelude.Show, forall x. Rep HandshakeResource x -> HandshakeResource
forall x. HandshakeResource -> Rep HandshakeResource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HandshakeResource x -> HandshakeResource
$cfrom :: forall x. HandshakeResource -> Rep HandshakeResource x
Prelude.Generic)
newHandshakeResource ::
HandshakeResource
newHandshakeResource :: HandshakeResource
newHandshakeResource =
HandshakeResource'
{ $sel:resources:HandshakeResource' :: Maybe [HandshakeResource]
resources = forall a. Maybe a
Prelude.Nothing,
$sel:type':HandshakeResource' :: Maybe HandshakeResourceType
type' = forall a. Maybe a
Prelude.Nothing,
$sel:value:HandshakeResource' :: Maybe (Sensitive Text)
value = forall a. Maybe a
Prelude.Nothing
}
handshakeResource_resources :: Lens.Lens' HandshakeResource (Prelude.Maybe [HandshakeResource])
handshakeResource_resources :: Lens' HandshakeResource (Maybe [HandshakeResource])
handshakeResource_resources = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HandshakeResource' {Maybe [HandshakeResource]
resources :: Maybe [HandshakeResource]
$sel:resources:HandshakeResource' :: HandshakeResource -> Maybe [HandshakeResource]
resources} -> Maybe [HandshakeResource]
resources) (\s :: HandshakeResource
s@HandshakeResource' {} Maybe [HandshakeResource]
a -> HandshakeResource
s {$sel:resources:HandshakeResource' :: Maybe [HandshakeResource]
resources = Maybe [HandshakeResource]
a} :: HandshakeResource) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
handshakeResource_type :: Lens.Lens' HandshakeResource (Prelude.Maybe HandshakeResourceType)
handshakeResource_type :: Lens' HandshakeResource (Maybe HandshakeResourceType)
handshakeResource_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HandshakeResource' {Maybe HandshakeResourceType
type' :: Maybe HandshakeResourceType
$sel:type':HandshakeResource' :: HandshakeResource -> Maybe HandshakeResourceType
type'} -> Maybe HandshakeResourceType
type') (\s :: HandshakeResource
s@HandshakeResource' {} Maybe HandshakeResourceType
a -> HandshakeResource
s {$sel:type':HandshakeResource' :: Maybe HandshakeResourceType
type' = Maybe HandshakeResourceType
a} :: HandshakeResource)
handshakeResource_value :: Lens.Lens' HandshakeResource (Prelude.Maybe Prelude.Text)
handshakeResource_value :: Lens' HandshakeResource (Maybe Text)
handshakeResource_value = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HandshakeResource' {Maybe (Sensitive Text)
value :: Maybe (Sensitive Text)
$sel:value:HandshakeResource' :: HandshakeResource -> Maybe (Sensitive Text)
value} -> Maybe (Sensitive Text)
value) (\s :: HandshakeResource
s@HandshakeResource' {} Maybe (Sensitive Text)
a -> HandshakeResource
s {$sel:value:HandshakeResource' :: Maybe (Sensitive Text)
value = Maybe (Sensitive Text)
a} :: HandshakeResource) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall a. Iso' (Sensitive a) a
Data._Sensitive
instance Data.FromJSON HandshakeResource where
parseJSON :: Value -> Parser HandshakeResource
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"HandshakeResource"
( \Object
x ->
Maybe [HandshakeResource]
-> Maybe HandshakeResourceType
-> Maybe (Sensitive Text)
-> HandshakeResource
HandshakeResource'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Resources" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Type")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Value")
)
instance Prelude.Hashable HandshakeResource where
hashWithSalt :: Int -> HandshakeResource -> Int
hashWithSalt Int
_salt HandshakeResource' {Maybe [HandshakeResource]
Maybe (Sensitive Text)
Maybe HandshakeResourceType
value :: Maybe (Sensitive Text)
type' :: Maybe HandshakeResourceType
resources :: Maybe [HandshakeResource]
$sel:value:HandshakeResource' :: HandshakeResource -> Maybe (Sensitive Text)
$sel:type':HandshakeResource' :: HandshakeResource -> Maybe HandshakeResourceType
$sel:resources:HandshakeResource' :: HandshakeResource -> Maybe [HandshakeResource]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [HandshakeResource]
resources
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HandshakeResourceType
type'
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (Sensitive Text)
value
instance Prelude.NFData HandshakeResource where
rnf :: HandshakeResource -> ()
rnf HandshakeResource' {Maybe [HandshakeResource]
Maybe (Sensitive Text)
Maybe HandshakeResourceType
value :: Maybe (Sensitive Text)
type' :: Maybe HandshakeResourceType
resources :: Maybe [HandshakeResource]
$sel:value:HandshakeResource' :: HandshakeResource -> Maybe (Sensitive Text)
$sel:type':HandshakeResource' :: HandshakeResource -> Maybe HandshakeResourceType
$sel:resources:HandshakeResource' :: HandshakeResource -> Maybe [HandshakeResource]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [HandshakeResource]
resources
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe HandshakeResourceType
type'
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (Sensitive Text)
value