{-# 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.SageMaker.Types.OidcMemberDefinition where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data OidcMemberDefinition = OidcMemberDefinition'
{
OidcMemberDefinition -> NonEmpty Text
groups :: Prelude.NonEmpty Prelude.Text
}
deriving (OidcMemberDefinition -> OidcMemberDefinition -> Bool
(OidcMemberDefinition -> OidcMemberDefinition -> Bool)
-> (OidcMemberDefinition -> OidcMemberDefinition -> Bool)
-> Eq OidcMemberDefinition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: OidcMemberDefinition -> OidcMemberDefinition -> Bool
$c/= :: OidcMemberDefinition -> OidcMemberDefinition -> Bool
== :: OidcMemberDefinition -> OidcMemberDefinition -> Bool
$c== :: OidcMemberDefinition -> OidcMemberDefinition -> Bool
Prelude.Eq, ReadPrec [OidcMemberDefinition]
ReadPrec OidcMemberDefinition
Int -> ReadS OidcMemberDefinition
ReadS [OidcMemberDefinition]
(Int -> ReadS OidcMemberDefinition)
-> ReadS [OidcMemberDefinition]
-> ReadPrec OidcMemberDefinition
-> ReadPrec [OidcMemberDefinition]
-> Read OidcMemberDefinition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [OidcMemberDefinition]
$creadListPrec :: ReadPrec [OidcMemberDefinition]
readPrec :: ReadPrec OidcMemberDefinition
$creadPrec :: ReadPrec OidcMemberDefinition
readList :: ReadS [OidcMemberDefinition]
$creadList :: ReadS [OidcMemberDefinition]
readsPrec :: Int -> ReadS OidcMemberDefinition
$creadsPrec :: Int -> ReadS OidcMemberDefinition
Prelude.Read, Int -> OidcMemberDefinition -> ShowS
[OidcMemberDefinition] -> ShowS
OidcMemberDefinition -> String
(Int -> OidcMemberDefinition -> ShowS)
-> (OidcMemberDefinition -> String)
-> ([OidcMemberDefinition] -> ShowS)
-> Show OidcMemberDefinition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [OidcMemberDefinition] -> ShowS
$cshowList :: [OidcMemberDefinition] -> ShowS
show :: OidcMemberDefinition -> String
$cshow :: OidcMemberDefinition -> String
showsPrec :: Int -> OidcMemberDefinition -> ShowS
$cshowsPrec :: Int -> OidcMemberDefinition -> ShowS
Prelude.Show, (forall x. OidcMemberDefinition -> Rep OidcMemberDefinition x)
-> (forall x. Rep OidcMemberDefinition x -> OidcMemberDefinition)
-> Generic OidcMemberDefinition
forall x. Rep OidcMemberDefinition x -> OidcMemberDefinition
forall x. OidcMemberDefinition -> Rep OidcMemberDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep OidcMemberDefinition x -> OidcMemberDefinition
$cfrom :: forall x. OidcMemberDefinition -> Rep OidcMemberDefinition x
Prelude.Generic)
newOidcMemberDefinition ::
Prelude.NonEmpty Prelude.Text ->
OidcMemberDefinition
newOidcMemberDefinition :: NonEmpty Text -> OidcMemberDefinition
newOidcMemberDefinition NonEmpty Text
pGroups_ =
OidcMemberDefinition' :: NonEmpty Text -> OidcMemberDefinition
OidcMemberDefinition'
{ $sel:groups:OidcMemberDefinition' :: NonEmpty Text
groups =
Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text)))
-> NonEmpty Text -> NonEmpty Text
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pGroups_
}
oidcMemberDefinition_groups :: Lens.Lens' OidcMemberDefinition (Prelude.NonEmpty Prelude.Text)
oidcMemberDefinition_groups :: (NonEmpty Text -> f (NonEmpty Text))
-> OidcMemberDefinition -> f OidcMemberDefinition
oidcMemberDefinition_groups = (OidcMemberDefinition -> NonEmpty Text)
-> (OidcMemberDefinition -> NonEmpty Text -> OidcMemberDefinition)
-> Lens
OidcMemberDefinition
OidcMemberDefinition
(NonEmpty Text)
(NonEmpty Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\OidcMemberDefinition' {NonEmpty Text
groups :: NonEmpty Text
$sel:groups:OidcMemberDefinition' :: OidcMemberDefinition -> NonEmpty Text
groups} -> NonEmpty Text
groups) (\s :: OidcMemberDefinition
s@OidcMemberDefinition' {} NonEmpty Text
a -> OidcMemberDefinition
s {$sel:groups:OidcMemberDefinition' :: NonEmpty Text
groups = NonEmpty Text
a} :: OidcMemberDefinition) ((NonEmpty Text -> f (NonEmpty Text))
-> OidcMemberDefinition -> f OidcMemberDefinition)
-> ((NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text))
-> (NonEmpty Text -> f (NonEmpty Text))
-> OidcMemberDefinition
-> f OidcMemberDefinition
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromJSON OidcMemberDefinition where
parseJSON :: Value -> Parser OidcMemberDefinition
parseJSON =
String
-> (Object -> Parser OidcMemberDefinition)
-> Value
-> Parser OidcMemberDefinition
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"OidcMemberDefinition"
( \Object
x ->
NonEmpty Text -> OidcMemberDefinition
OidcMemberDefinition'
(NonEmpty Text -> OidcMemberDefinition)
-> Parser (NonEmpty Text) -> Parser OidcMemberDefinition
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (NonEmpty Text)
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Groups")
)
instance Prelude.Hashable OidcMemberDefinition
instance Prelude.NFData OidcMemberDefinition
instance Core.ToJSON OidcMemberDefinition where
toJSON :: OidcMemberDefinition -> Value
toJSON OidcMemberDefinition' {NonEmpty Text
groups :: NonEmpty Text
$sel:groups:OidcMemberDefinition' :: OidcMemberDefinition -> NonEmpty Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Groups" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty Text
groups)]
)