{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import Amazonka.SSM.Types.AttachmentsSourceKey
data AttachmentsSource = AttachmentsSource'
{
AttachmentsSource -> Maybe AttachmentsSourceKey
key :: Prelude.Maybe AttachmentsSourceKey,
AttachmentsSource -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
AttachmentsSource -> Maybe (NonEmpty Text)
values :: Prelude.Maybe (Prelude.NonEmpty Prelude.Text)
}
deriving (AttachmentsSource -> AttachmentsSource -> Bool
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]
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
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. 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'
{ $sel:key:AttachmentsSource' :: Maybe AttachmentsSourceKey
key = forall a. Maybe a
Prelude.Nothing,
$sel:name:AttachmentsSource' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:values:AttachmentsSource' :: Maybe (NonEmpty Text)
values = forall a. Maybe a
Prelude.Nothing
}
attachmentsSource_key :: Lens.Lens' AttachmentsSource (Prelude.Maybe AttachmentsSourceKey)
attachmentsSource_key :: Lens' AttachmentsSource (Maybe AttachmentsSourceKey)
attachmentsSource_key = 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 :: Lens' AttachmentsSource (Maybe Text)
attachmentsSource_name = 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)
attachmentsSource_values :: Lens.Lens' AttachmentsSource (Prelude.Maybe (Prelude.NonEmpty Prelude.Text))
attachmentsSource_values :: Lens' AttachmentsSource (Maybe (NonEmpty Text))
attachmentsSource_values = 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) 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
instance Prelude.Hashable AttachmentsSource where
hashWithSalt :: Int -> AttachmentsSource -> Int
hashWithSalt Int
_salt AttachmentsSource' {Maybe (NonEmpty Text)
Maybe Text
Maybe AttachmentsSourceKey
values :: Maybe (NonEmpty Text)
name :: Maybe Text
key :: Maybe AttachmentsSourceKey
$sel:values:AttachmentsSource' :: AttachmentsSource -> Maybe (NonEmpty Text)
$sel:name:AttachmentsSource' :: AttachmentsSource -> Maybe Text
$sel:key:AttachmentsSource' :: AttachmentsSource -> Maybe AttachmentsSourceKey
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AttachmentsSourceKey
key
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Text)
values
instance Prelude.NFData AttachmentsSource where
rnf :: AttachmentsSource -> ()
rnf AttachmentsSource' {Maybe (NonEmpty Text)
Maybe Text
Maybe AttachmentsSourceKey
values :: Maybe (NonEmpty Text)
name :: Maybe Text
key :: Maybe AttachmentsSourceKey
$sel:values:AttachmentsSource' :: AttachmentsSource -> Maybe (NonEmpty Text)
$sel:name:AttachmentsSource' :: AttachmentsSource -> Maybe Text
$sel:key:AttachmentsSource' :: AttachmentsSource -> Maybe AttachmentsSourceKey
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe AttachmentsSourceKey
key
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Text)
values
instance Data.ToJSON AttachmentsSource where
toJSON :: AttachmentsSource -> Value
toJSON AttachmentsSource' {Maybe (NonEmpty Text)
Maybe Text
Maybe AttachmentsSourceKey
values :: Maybe (NonEmpty Text)
name :: Maybe Text
key :: Maybe AttachmentsSourceKey
$sel:values:AttachmentsSource' :: AttachmentsSource -> Maybe (NonEmpty Text)
$sel:name:AttachmentsSource' :: AttachmentsSource -> Maybe Text
$sel:key:AttachmentsSource' :: AttachmentsSource -> Maybe AttachmentsSourceKey
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"Key" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AttachmentsSourceKey
key,
(Key
"Name" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
(Key
"Values" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (NonEmpty Text)
values
]
)