{-# 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.ECS.Types.Attachment where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.ECS.Types.KeyValuePair
import qualified Amazonka.Prelude as Prelude
data Attachment = Attachment'
{
Attachment -> Maybe [KeyValuePair]
details :: Prelude.Maybe [KeyValuePair],
Attachment -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
Attachment -> Maybe Text
status :: Prelude.Maybe Prelude.Text,
Attachment -> Maybe Text
type' :: Prelude.Maybe Prelude.Text
}
deriving (Attachment -> Attachment -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Attachment -> Attachment -> Bool
$c/= :: Attachment -> Attachment -> Bool
== :: Attachment -> Attachment -> Bool
$c== :: Attachment -> Attachment -> Bool
Prelude.Eq, ReadPrec [Attachment]
ReadPrec Attachment
Int -> ReadS Attachment
ReadS [Attachment]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Attachment]
$creadListPrec :: ReadPrec [Attachment]
readPrec :: ReadPrec Attachment
$creadPrec :: ReadPrec Attachment
readList :: ReadS [Attachment]
$creadList :: ReadS [Attachment]
readsPrec :: Int -> ReadS Attachment
$creadsPrec :: Int -> ReadS Attachment
Prelude.Read, Int -> Attachment -> ShowS
[Attachment] -> ShowS
Attachment -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Attachment] -> ShowS
$cshowList :: [Attachment] -> ShowS
show :: Attachment -> String
$cshow :: Attachment -> String
showsPrec :: Int -> Attachment -> ShowS
$cshowsPrec :: Int -> Attachment -> ShowS
Prelude.Show, forall x. Rep Attachment x -> Attachment
forall x. Attachment -> Rep Attachment x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Attachment x -> Attachment
$cfrom :: forall x. Attachment -> Rep Attachment x
Prelude.Generic)
newAttachment ::
Attachment
newAttachment :: Attachment
newAttachment =
Attachment'
{ $sel:details:Attachment' :: Maybe [KeyValuePair]
details = forall a. Maybe a
Prelude.Nothing,
$sel:id:Attachment' :: Maybe Text
id = forall a. Maybe a
Prelude.Nothing,
$sel:status:Attachment' :: Maybe Text
status = forall a. Maybe a
Prelude.Nothing,
$sel:type':Attachment' :: Maybe Text
type' = forall a. Maybe a
Prelude.Nothing
}
attachment_details :: Lens.Lens' Attachment (Prelude.Maybe [KeyValuePair])
attachment_details :: Lens' Attachment (Maybe [KeyValuePair])
attachment_details = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Attachment' {Maybe [KeyValuePair]
details :: Maybe [KeyValuePair]
$sel:details:Attachment' :: Attachment -> Maybe [KeyValuePair]
details} -> Maybe [KeyValuePair]
details) (\s :: Attachment
s@Attachment' {} Maybe [KeyValuePair]
a -> Attachment
s {$sel:details:Attachment' :: Maybe [KeyValuePair]
details = Maybe [KeyValuePair]
a} :: Attachment) 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
attachment_id :: Lens.Lens' Attachment (Prelude.Maybe Prelude.Text)
attachment_id :: Lens' Attachment (Maybe Text)
attachment_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Attachment' {Maybe Text
id :: Maybe Text
$sel:id:Attachment' :: Attachment -> Maybe Text
id} -> Maybe Text
id) (\s :: Attachment
s@Attachment' {} Maybe Text
a -> Attachment
s {$sel:id:Attachment' :: Maybe Text
id = Maybe Text
a} :: Attachment)
attachment_status :: Lens.Lens' Attachment (Prelude.Maybe Prelude.Text)
attachment_status :: Lens' Attachment (Maybe Text)
attachment_status = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Attachment' {Maybe Text
status :: Maybe Text
$sel:status:Attachment' :: Attachment -> Maybe Text
status} -> Maybe Text
status) (\s :: Attachment
s@Attachment' {} Maybe Text
a -> Attachment
s {$sel:status:Attachment' :: Maybe Text
status = Maybe Text
a} :: Attachment)
attachment_type :: Lens.Lens' Attachment (Prelude.Maybe Prelude.Text)
attachment_type :: Lens' Attachment (Maybe Text)
attachment_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Attachment' {Maybe Text
type' :: Maybe Text
$sel:type':Attachment' :: Attachment -> Maybe Text
type'} -> Maybe Text
type') (\s :: Attachment
s@Attachment' {} Maybe Text
a -> Attachment
s {$sel:type':Attachment' :: Maybe Text
type' = Maybe Text
a} :: Attachment)
instance Data.FromJSON Attachment where
parseJSON :: Value -> Parser Attachment
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"Attachment"
( \Object
x ->
Maybe [KeyValuePair]
-> Maybe Text -> Maybe Text -> Maybe Text -> Attachment
Attachment'
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
"details" 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
"id")
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
"status")
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")
)
instance Prelude.Hashable Attachment where
hashWithSalt :: Int -> Attachment -> Int
hashWithSalt Int
_salt Attachment' {Maybe [KeyValuePair]
Maybe Text
type' :: Maybe Text
status :: Maybe Text
id :: Maybe Text
details :: Maybe [KeyValuePair]
$sel:type':Attachment' :: Attachment -> Maybe Text
$sel:status:Attachment' :: Attachment -> Maybe Text
$sel:id:Attachment' :: Attachment -> Maybe Text
$sel:details:Attachment' :: Attachment -> Maybe [KeyValuePair]
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [KeyValuePair]
details
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
id
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
status
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
type'
instance Prelude.NFData Attachment where
rnf :: Attachment -> ()
rnf Attachment' {Maybe [KeyValuePair]
Maybe Text
type' :: Maybe Text
status :: Maybe Text
id :: Maybe Text
details :: Maybe [KeyValuePair]
$sel:type':Attachment' :: Attachment -> Maybe Text
$sel:status:Attachment' :: Attachment -> Maybe Text
$sel:id:Attachment' :: Attachment -> Maybe Text
$sel:details:Attachment' :: Attachment -> Maybe [KeyValuePair]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [KeyValuePair]
details
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
id
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
status
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
type'