{-# 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.NetworkFirewall.Types.Attachment where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.NetworkFirewall.Types.AttachmentStatus
import qualified Amazonka.Prelude as Prelude
data Attachment = Attachment'
{
Attachment -> Maybe AttachmentStatus
status :: Prelude.Maybe AttachmentStatus,
Attachment -> Maybe Text
subnetId :: Prelude.Maybe Prelude.Text,
Attachment -> Maybe Text
endpointId :: Prelude.Maybe Prelude.Text
}
deriving (Attachment -> Attachment -> Bool
(Attachment -> Attachment -> Bool)
-> (Attachment -> Attachment -> Bool) -> Eq Attachment
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]
(Int -> ReadS Attachment)
-> ReadS [Attachment]
-> ReadPrec Attachment
-> ReadPrec [Attachment]
-> Read 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
(Int -> Attachment -> ShowS)
-> (Attachment -> String)
-> ([Attachment] -> ShowS)
-> Show Attachment
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. Attachment -> Rep Attachment x)
-> (forall x. Rep Attachment x -> Attachment) -> Generic Attachment
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' :: Maybe AttachmentStatus -> Maybe Text -> Maybe Text -> Attachment
Attachment'
{ $sel:status:Attachment' :: Maybe AttachmentStatus
status = Maybe AttachmentStatus
forall a. Maybe a
Prelude.Nothing,
$sel:subnetId:Attachment' :: Maybe Text
subnetId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:endpointId:Attachment' :: Maybe Text
endpointId = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
attachment_status :: Lens.Lens' Attachment (Prelude.Maybe AttachmentStatus)
attachment_status :: (Maybe AttachmentStatus -> f (Maybe AttachmentStatus))
-> Attachment -> f Attachment
attachment_status = (Attachment -> Maybe AttachmentStatus)
-> (Attachment -> Maybe AttachmentStatus -> Attachment)
-> Lens
Attachment
Attachment
(Maybe AttachmentStatus)
(Maybe AttachmentStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Attachment' {Maybe AttachmentStatus
status :: Maybe AttachmentStatus
$sel:status:Attachment' :: Attachment -> Maybe AttachmentStatus
status} -> Maybe AttachmentStatus
status) (\s :: Attachment
s@Attachment' {} Maybe AttachmentStatus
a -> Attachment
s {$sel:status:Attachment' :: Maybe AttachmentStatus
status = Maybe AttachmentStatus
a} :: Attachment)
attachment_subnetId :: Lens.Lens' Attachment (Prelude.Maybe Prelude.Text)
attachment_subnetId :: (Maybe Text -> f (Maybe Text)) -> Attachment -> f Attachment
attachment_subnetId = (Attachment -> Maybe Text)
-> (Attachment -> Maybe Text -> Attachment)
-> Lens Attachment Attachment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Attachment' {Maybe Text
subnetId :: Maybe Text
$sel:subnetId:Attachment' :: Attachment -> Maybe Text
subnetId} -> Maybe Text
subnetId) (\s :: Attachment
s@Attachment' {} Maybe Text
a -> Attachment
s {$sel:subnetId:Attachment' :: Maybe Text
subnetId = Maybe Text
a} :: Attachment)
attachment_endpointId :: Lens.Lens' Attachment (Prelude.Maybe Prelude.Text)
attachment_endpointId :: (Maybe Text -> f (Maybe Text)) -> Attachment -> f Attachment
attachment_endpointId = (Attachment -> Maybe Text)
-> (Attachment -> Maybe Text -> Attachment)
-> Lens Attachment Attachment (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Attachment' {Maybe Text
endpointId :: Maybe Text
$sel:endpointId:Attachment' :: Attachment -> Maybe Text
endpointId} -> Maybe Text
endpointId) (\s :: Attachment
s@Attachment' {} Maybe Text
a -> Attachment
s {$sel:endpointId:Attachment' :: Maybe Text
endpointId = Maybe Text
a} :: Attachment)
instance Core.FromJSON Attachment where
parseJSON :: Value -> Parser Attachment
parseJSON =
String
-> (Object -> Parser Attachment) -> Value -> Parser Attachment
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Attachment"
( \Object
x ->
Maybe AttachmentStatus -> Maybe Text -> Maybe Text -> Attachment
Attachment'
(Maybe AttachmentStatus -> Maybe Text -> Maybe Text -> Attachment)
-> Parser (Maybe AttachmentStatus)
-> Parser (Maybe Text -> Maybe Text -> Attachment)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe AttachmentStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Status")
Parser (Maybe Text -> Maybe Text -> Attachment)
-> Parser (Maybe Text) -> Parser (Maybe Text -> Attachment)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SubnetId")
Parser (Maybe Text -> Attachment)
-> Parser (Maybe Text) -> Parser Attachment
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EndpointId")
)
instance Prelude.Hashable Attachment
instance Prelude.NFData Attachment