{-# 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.AttachmentsSource where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SSM.Types.AttachmentsSourceKey
data AttachmentsSource = AttachmentsSource'
{
AttachmentsSource -> Maybe (NonEmpty Text)
values :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text),
AttachmentsSource -> Maybe AttachmentsSourceKey
key :: Prelude.Maybe AttachmentsSourceKey,
AttachmentsSource -> Maybe Text
name :: Prelude.Maybe Prelude.Text
}
deriving (AttachmentsSource -> AttachmentsSource -> Bool
(AttachmentsSource -> AttachmentsSource -> Bool)
-> (AttachmentsSource -> AttachmentsSource -> Bool)
-> Eq AttachmentsSource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AttachmentsSource -> AttachmentsSource -> Bool
$c/= :: AttachmentsSource -> AttachmentsSource -> Bool
== :: AttachmentsSource -> AttachmentsSource -> Bool
$c== :: AttachmentsSource -> AttachmentsSource -> Bool
Prelude.Eq, ReadPrec [AttachmentsSource]
ReadPrec AttachmentsSource
Int -> ReadS AttachmentsSource
ReadS [AttachmentsSource]
(Int -> ReadS AttachmentsSource)
-> ReadS [AttachmentsSource]
-> ReadPrec AttachmentsSource
-> ReadPrec [AttachmentsSource]
-> Read AttachmentsSource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AttachmentsSource]
$creadListPrec :: ReadPrec [AttachmentsSource]
readPrec :: ReadPrec AttachmentsSource
$creadPrec :: ReadPrec AttachmentsSource
readList :: ReadS [AttachmentsSource]
$creadList :: ReadS [AttachmentsSource]
readsPrec :: Int -> ReadS AttachmentsSource
$creadsPrec :: Int -> ReadS AttachmentsSource
Prelude.Read, Int -> AttachmentsSource -> ShowS
[AttachmentsSource] -> ShowS
AttachmentsSource -> String
(Int -> AttachmentsSource -> ShowS)
-> (AttachmentsSource -> String)
-> ([AttachmentsSource] -> ShowS)
-> Show AttachmentsSource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AttachmentsSource] -> ShowS
$cshowList :: [AttachmentsSource] -> ShowS
show :: AttachmentsSource -> String
$cshow :: AttachmentsSource -> String
showsPrec :: Int -> AttachmentsSource -> ShowS
$cshowsPrec :: Int -> AttachmentsSource -> ShowS
Prelude.Show, (forall x. AttachmentsSource -> Rep AttachmentsSource x)
-> (forall x. Rep AttachmentsSource x -> AttachmentsSource)
-> Generic AttachmentsSource
forall x. Rep AttachmentsSource x -> AttachmentsSource
forall x. AttachmentsSource -> Rep AttachmentsSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AttachmentsSource x -> AttachmentsSource
$cfrom :: forall x. AttachmentsSource -> Rep AttachmentsSource x
Prelude.Generic)
newAttachmentsSource ::
AttachmentsSource
newAttachmentsSource :: AttachmentsSource
newAttachmentsSource =
AttachmentsSource' :: Maybe (NonEmpty Text)
-> Maybe AttachmentsSourceKey -> Maybe Text -> AttachmentsSource
AttachmentsSource'
{ $sel:values:AttachmentsSource' :: Maybe (NonEmpty Text)
values = Maybe (NonEmpty Text)
forall a. Maybe a
Prelude.Nothing,
$sel:key:AttachmentsSource' :: Maybe AttachmentsSourceKey
key = Maybe AttachmentsSourceKey
forall a. Maybe a
Prelude.Nothing,
$sel:name:AttachmentsSource' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
attachmentsSource_values :: Lens.Lens' AttachmentsSource (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
attachmentsSource_values :: (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> AttachmentsSource -> f AttachmentsSource
attachmentsSource_values = (AttachmentsSource -> Maybe (NonEmpty Text))
-> (AttachmentsSource
-> Maybe (NonEmpty Text) -> AttachmentsSource)
-> Lens
AttachmentsSource
AttachmentsSource
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttachmentsSource' {Maybe (NonEmpty Text)
values :: Maybe (NonEmpty Text)
$sel:values:AttachmentsSource' :: AttachmentsSource -> Maybe (NonEmpty Text)
values} -> Maybe (NonEmpty Text)
values) (\s :: AttachmentsSource
s@AttachmentsSource' {} Maybe (NonEmpty Text)
a -> AttachmentsSource
s {$sel:values:AttachmentsSource' :: Maybe (NonEmpty Text)
values = Maybe (NonEmpty Text)
a} :: AttachmentsSource) ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> AttachmentsSource -> f AttachmentsSource)
-> ((Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> (Maybe (NonEmpty Text) -> f (Maybe (NonEmpty Text)))
-> AttachmentsSource
-> f AttachmentsSource
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
-> Iso
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
(Maybe (NonEmpty Text))
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
(NonEmpty Text) (NonEmpty Text) (NonEmpty Text) (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
attachmentsSource_key :: Lens.Lens' AttachmentsSource (Prelude.Maybe AttachmentsSourceKey)
attachmentsSource_key :: (Maybe AttachmentsSourceKey -> f (Maybe AttachmentsSourceKey))
-> AttachmentsSource -> f AttachmentsSource
attachmentsSource_key = (AttachmentsSource -> Maybe AttachmentsSourceKey)
-> (AttachmentsSource
-> Maybe AttachmentsSourceKey -> AttachmentsSource)
-> Lens
AttachmentsSource
AttachmentsSource
(Maybe AttachmentsSourceKey)
(Maybe AttachmentsSourceKey)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttachmentsSource' {Maybe AttachmentsSourceKey
key :: Maybe AttachmentsSourceKey
$sel:key:AttachmentsSource' :: AttachmentsSource -> Maybe AttachmentsSourceKey
key} -> Maybe AttachmentsSourceKey
key) (\s :: AttachmentsSource
s@AttachmentsSource' {} Maybe AttachmentsSourceKey
a -> AttachmentsSource
s {$sel:key:AttachmentsSource' :: Maybe AttachmentsSourceKey
key = Maybe AttachmentsSourceKey
a} :: AttachmentsSource)
attachmentsSource_name :: Lens.Lens' AttachmentsSource (Prelude.Maybe Prelude.Text)
attachmentsSource_name :: (Maybe Text -> f (Maybe Text))
-> AttachmentsSource -> f AttachmentsSource
attachmentsSource_name = (AttachmentsSource -> Maybe Text)
-> (AttachmentsSource -> Maybe Text -> AttachmentsSource)
-> Lens
AttachmentsSource AttachmentsSource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AttachmentsSource' {Maybe Text
name :: Maybe Text
$sel:name:AttachmentsSource' :: AttachmentsSource -> Maybe Text
name} -> Maybe Text
name) (\s :: AttachmentsSource
s@AttachmentsSource' {} Maybe Text
a -> AttachmentsSource
s {$sel:name:AttachmentsSource' :: Maybe Text
name = Maybe Text
a} :: AttachmentsSource)
instance Prelude.Hashable AttachmentsSource
instance Prelude.NFData AttachmentsSource
instance Core.ToJSON AttachmentsSource where
toJSON :: AttachmentsSource -> Value
toJSON AttachmentsSource' {Maybe (NonEmpty Text)
Maybe Text
Maybe AttachmentsSourceKey
name :: Maybe Text
key :: Maybe AttachmentsSourceKey
values :: Maybe (NonEmpty Text)
$sel:name:AttachmentsSource' :: AttachmentsSource -> Maybe Text
$sel:key:AttachmentsSource' :: AttachmentsSource -> Maybe AttachmentsSourceKey
$sel:values:AttachmentsSource' :: AttachmentsSource -> Maybe (NonEmpty Text)
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"Values" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (NonEmpty Text -> Pair) -> Maybe (NonEmpty Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
values,
(Text
"Key" Text -> AttachmentsSourceKey -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AttachmentsSourceKey -> Pair)
-> Maybe AttachmentsSourceKey -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AttachmentsSourceKey
key,
(Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name
]
)