{-# 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.Lightsail.Types.ContactMethod where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Lightsail.Types.ContactMethodStatus
import Amazonka.Lightsail.Types.ContactProtocol
import Amazonka.Lightsail.Types.ResourceLocation
import Amazonka.Lightsail.Types.ResourceType
import qualified Amazonka.Prelude as Prelude
data ContactMethod = ContactMethod'
{
ContactMethod -> Maybe ContactMethodStatus
status :: Prelude.Maybe ContactMethodStatus,
ContactMethod -> Maybe ResourceType
resourceType :: Prelude.Maybe ResourceType,
ContactMethod -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
ContactMethod -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
ContactMethod -> Maybe ResourceLocation
location :: Prelude.Maybe ResourceLocation,
ContactMethod -> Maybe ContactProtocol
protocol :: Prelude.Maybe ContactProtocol,
ContactMethod -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
ContactMethod -> Maybe Text
supportCode :: Prelude.Maybe Prelude.Text,
ContactMethod -> Maybe Text
contactEndpoint :: Prelude.Maybe Prelude.Text
}
deriving (ContactMethod -> ContactMethod -> Bool
(ContactMethod -> ContactMethod -> Bool)
-> (ContactMethod -> ContactMethod -> Bool) -> Eq ContactMethod
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ContactMethod -> ContactMethod -> Bool
$c/= :: ContactMethod -> ContactMethod -> Bool
== :: ContactMethod -> ContactMethod -> Bool
$c== :: ContactMethod -> ContactMethod -> Bool
Prelude.Eq, ReadPrec [ContactMethod]
ReadPrec ContactMethod
Int -> ReadS ContactMethod
ReadS [ContactMethod]
(Int -> ReadS ContactMethod)
-> ReadS [ContactMethod]
-> ReadPrec ContactMethod
-> ReadPrec [ContactMethod]
-> Read ContactMethod
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ContactMethod]
$creadListPrec :: ReadPrec [ContactMethod]
readPrec :: ReadPrec ContactMethod
$creadPrec :: ReadPrec ContactMethod
readList :: ReadS [ContactMethod]
$creadList :: ReadS [ContactMethod]
readsPrec :: Int -> ReadS ContactMethod
$creadsPrec :: Int -> ReadS ContactMethod
Prelude.Read, Int -> ContactMethod -> ShowS
[ContactMethod] -> ShowS
ContactMethod -> String
(Int -> ContactMethod -> ShowS)
-> (ContactMethod -> String)
-> ([ContactMethod] -> ShowS)
-> Show ContactMethod
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ContactMethod] -> ShowS
$cshowList :: [ContactMethod] -> ShowS
show :: ContactMethod -> String
$cshow :: ContactMethod -> String
showsPrec :: Int -> ContactMethod -> ShowS
$cshowsPrec :: Int -> ContactMethod -> ShowS
Prelude.Show, (forall x. ContactMethod -> Rep ContactMethod x)
-> (forall x. Rep ContactMethod x -> ContactMethod)
-> Generic ContactMethod
forall x. Rep ContactMethod x -> ContactMethod
forall x. ContactMethod -> Rep ContactMethod x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ContactMethod x -> ContactMethod
$cfrom :: forall x. ContactMethod -> Rep ContactMethod x
Prelude.Generic)
newContactMethod ::
ContactMethod
newContactMethod :: ContactMethod
newContactMethod =
ContactMethod' :: Maybe ContactMethodStatus
-> Maybe ResourceType
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe ContactProtocol
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ContactMethod
ContactMethod'
{ $sel:status:ContactMethod' :: Maybe ContactMethodStatus
status = Maybe ContactMethodStatus
forall a. Maybe a
Prelude.Nothing,
$sel:resourceType:ContactMethod' :: Maybe ResourceType
resourceType = Maybe ResourceType
forall a. Maybe a
Prelude.Nothing,
$sel:arn:ContactMethod' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:createdAt:ContactMethod' :: Maybe POSIX
createdAt = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:location:ContactMethod' :: Maybe ResourceLocation
location = Maybe ResourceLocation
forall a. Maybe a
Prelude.Nothing,
$sel:protocol:ContactMethod' :: Maybe ContactProtocol
protocol = Maybe ContactProtocol
forall a. Maybe a
Prelude.Nothing,
$sel:name:ContactMethod' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:supportCode:ContactMethod' :: Maybe Text
supportCode = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:contactEndpoint:ContactMethod' :: Maybe Text
contactEndpoint = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
contactMethod_status :: Lens.Lens' ContactMethod (Prelude.Maybe ContactMethodStatus)
contactMethod_status :: (Maybe ContactMethodStatus -> f (Maybe ContactMethodStatus))
-> ContactMethod -> f ContactMethod
contactMethod_status = (ContactMethod -> Maybe ContactMethodStatus)
-> (ContactMethod -> Maybe ContactMethodStatus -> ContactMethod)
-> Lens
ContactMethod
ContactMethod
(Maybe ContactMethodStatus)
(Maybe ContactMethodStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactMethod' {Maybe ContactMethodStatus
status :: Maybe ContactMethodStatus
$sel:status:ContactMethod' :: ContactMethod -> Maybe ContactMethodStatus
status} -> Maybe ContactMethodStatus
status) (\s :: ContactMethod
s@ContactMethod' {} Maybe ContactMethodStatus
a -> ContactMethod
s {$sel:status:ContactMethod' :: Maybe ContactMethodStatus
status = Maybe ContactMethodStatus
a} :: ContactMethod)
contactMethod_resourceType :: Lens.Lens' ContactMethod (Prelude.Maybe ResourceType)
contactMethod_resourceType :: (Maybe ResourceType -> f (Maybe ResourceType))
-> ContactMethod -> f ContactMethod
contactMethod_resourceType = (ContactMethod -> Maybe ResourceType)
-> (ContactMethod -> Maybe ResourceType -> ContactMethod)
-> Lens
ContactMethod
ContactMethod
(Maybe ResourceType)
(Maybe ResourceType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactMethod' {Maybe ResourceType
resourceType :: Maybe ResourceType
$sel:resourceType:ContactMethod' :: ContactMethod -> Maybe ResourceType
resourceType} -> Maybe ResourceType
resourceType) (\s :: ContactMethod
s@ContactMethod' {} Maybe ResourceType
a -> ContactMethod
s {$sel:resourceType:ContactMethod' :: Maybe ResourceType
resourceType = Maybe ResourceType
a} :: ContactMethod)
contactMethod_arn :: Lens.Lens' ContactMethod (Prelude.Maybe Prelude.Text)
contactMethod_arn :: (Maybe Text -> f (Maybe Text)) -> ContactMethod -> f ContactMethod
contactMethod_arn = (ContactMethod -> Maybe Text)
-> (ContactMethod -> Maybe Text -> ContactMethod)
-> Lens ContactMethod ContactMethod (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactMethod' {Maybe Text
arn :: Maybe Text
$sel:arn:ContactMethod' :: ContactMethod -> Maybe Text
arn} -> Maybe Text
arn) (\s :: ContactMethod
s@ContactMethod' {} Maybe Text
a -> ContactMethod
s {$sel:arn:ContactMethod' :: Maybe Text
arn = Maybe Text
a} :: ContactMethod)
contactMethod_createdAt :: Lens.Lens' ContactMethod (Prelude.Maybe Prelude.UTCTime)
contactMethod_createdAt :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ContactMethod -> f ContactMethod
contactMethod_createdAt = (ContactMethod -> Maybe POSIX)
-> (ContactMethod -> Maybe POSIX -> ContactMethod)
-> Lens ContactMethod ContactMethod (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactMethod' {Maybe POSIX
createdAt :: Maybe POSIX
$sel:createdAt:ContactMethod' :: ContactMethod -> Maybe POSIX
createdAt} -> Maybe POSIX
createdAt) (\s :: ContactMethod
s@ContactMethod' {} Maybe POSIX
a -> ContactMethod
s {$sel:createdAt:ContactMethod' :: Maybe POSIX
createdAt = Maybe POSIX
a} :: ContactMethod) ((Maybe POSIX -> f (Maybe POSIX))
-> ContactMethod -> f ContactMethod)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ContactMethod
-> f ContactMethod
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
contactMethod_location :: Lens.Lens' ContactMethod (Prelude.Maybe ResourceLocation)
contactMethod_location :: (Maybe ResourceLocation -> f (Maybe ResourceLocation))
-> ContactMethod -> f ContactMethod
contactMethod_location = (ContactMethod -> Maybe ResourceLocation)
-> (ContactMethod -> Maybe ResourceLocation -> ContactMethod)
-> Lens
ContactMethod
ContactMethod
(Maybe ResourceLocation)
(Maybe ResourceLocation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactMethod' {Maybe ResourceLocation
location :: Maybe ResourceLocation
$sel:location:ContactMethod' :: ContactMethod -> Maybe ResourceLocation
location} -> Maybe ResourceLocation
location) (\s :: ContactMethod
s@ContactMethod' {} Maybe ResourceLocation
a -> ContactMethod
s {$sel:location:ContactMethod' :: Maybe ResourceLocation
location = Maybe ResourceLocation
a} :: ContactMethod)
contactMethod_protocol :: Lens.Lens' ContactMethod (Prelude.Maybe ContactProtocol)
contactMethod_protocol :: (Maybe ContactProtocol -> f (Maybe ContactProtocol))
-> ContactMethod -> f ContactMethod
contactMethod_protocol = (ContactMethod -> Maybe ContactProtocol)
-> (ContactMethod -> Maybe ContactProtocol -> ContactMethod)
-> Lens
ContactMethod
ContactMethod
(Maybe ContactProtocol)
(Maybe ContactProtocol)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactMethod' {Maybe ContactProtocol
protocol :: Maybe ContactProtocol
$sel:protocol:ContactMethod' :: ContactMethod -> Maybe ContactProtocol
protocol} -> Maybe ContactProtocol
protocol) (\s :: ContactMethod
s@ContactMethod' {} Maybe ContactProtocol
a -> ContactMethod
s {$sel:protocol:ContactMethod' :: Maybe ContactProtocol
protocol = Maybe ContactProtocol
a} :: ContactMethod)
contactMethod_name :: Lens.Lens' ContactMethod (Prelude.Maybe Prelude.Text)
contactMethod_name :: (Maybe Text -> f (Maybe Text)) -> ContactMethod -> f ContactMethod
contactMethod_name = (ContactMethod -> Maybe Text)
-> (ContactMethod -> Maybe Text -> ContactMethod)
-> Lens ContactMethod ContactMethod (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactMethod' {Maybe Text
name :: Maybe Text
$sel:name:ContactMethod' :: ContactMethod -> Maybe Text
name} -> Maybe Text
name) (\s :: ContactMethod
s@ContactMethod' {} Maybe Text
a -> ContactMethod
s {$sel:name:ContactMethod' :: Maybe Text
name = Maybe Text
a} :: ContactMethod)
contactMethod_supportCode :: Lens.Lens' ContactMethod (Prelude.Maybe Prelude.Text)
contactMethod_supportCode :: (Maybe Text -> f (Maybe Text)) -> ContactMethod -> f ContactMethod
contactMethod_supportCode = (ContactMethod -> Maybe Text)
-> (ContactMethod -> Maybe Text -> ContactMethod)
-> Lens ContactMethod ContactMethod (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactMethod' {Maybe Text
supportCode :: Maybe Text
$sel:supportCode:ContactMethod' :: ContactMethod -> Maybe Text
supportCode} -> Maybe Text
supportCode) (\s :: ContactMethod
s@ContactMethod' {} Maybe Text
a -> ContactMethod
s {$sel:supportCode:ContactMethod' :: Maybe Text
supportCode = Maybe Text
a} :: ContactMethod)
contactMethod_contactEndpoint :: Lens.Lens' ContactMethod (Prelude.Maybe Prelude.Text)
contactMethod_contactEndpoint :: (Maybe Text -> f (Maybe Text)) -> ContactMethod -> f ContactMethod
contactMethod_contactEndpoint = (ContactMethod -> Maybe Text)
-> (ContactMethod -> Maybe Text -> ContactMethod)
-> Lens ContactMethod ContactMethod (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ContactMethod' {Maybe Text
contactEndpoint :: Maybe Text
$sel:contactEndpoint:ContactMethod' :: ContactMethod -> Maybe Text
contactEndpoint} -> Maybe Text
contactEndpoint) (\s :: ContactMethod
s@ContactMethod' {} Maybe Text
a -> ContactMethod
s {$sel:contactEndpoint:ContactMethod' :: Maybe Text
contactEndpoint = Maybe Text
a} :: ContactMethod)
instance Core.FromJSON ContactMethod where
parseJSON :: Value -> Parser ContactMethod
parseJSON =
String
-> (Object -> Parser ContactMethod)
-> Value
-> Parser ContactMethod
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ContactMethod"
( \Object
x ->
Maybe ContactMethodStatus
-> Maybe ResourceType
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe ContactProtocol
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ContactMethod
ContactMethod'
(Maybe ContactMethodStatus
-> Maybe ResourceType
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe ContactProtocol
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ContactMethod)
-> Parser (Maybe ContactMethodStatus)
-> Parser
(Maybe ResourceType
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe ContactProtocol
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ContactMethod)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ContactMethodStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"status")
Parser
(Maybe ResourceType
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe ContactProtocol
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ContactMethod)
-> Parser (Maybe ResourceType)
-> Parser
(Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe ContactProtocol
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ContactMethod)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResourceType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"resourceType")
Parser
(Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe ContactProtocol
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ContactMethod)
-> Parser (Maybe Text)
-> Parser
(Maybe POSIX
-> Maybe ResourceLocation
-> Maybe ContactProtocol
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ContactMethod)
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
"arn")
Parser
(Maybe POSIX
-> Maybe ResourceLocation
-> Maybe ContactProtocol
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ContactMethod)
-> Parser (Maybe POSIX)
-> Parser
(Maybe ResourceLocation
-> Maybe ContactProtocol
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ContactMethod)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"createdAt")
Parser
(Maybe ResourceLocation
-> Maybe ContactProtocol
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ContactMethod)
-> Parser (Maybe ResourceLocation)
-> Parser
(Maybe ContactProtocol
-> Maybe Text -> Maybe Text -> Maybe Text -> ContactMethod)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResourceLocation)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"location")
Parser
(Maybe ContactProtocol
-> Maybe Text -> Maybe Text -> Maybe Text -> ContactMethod)
-> Parser (Maybe ContactProtocol)
-> Parser (Maybe Text -> Maybe Text -> Maybe Text -> ContactMethod)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ContactProtocol)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"protocol")
Parser (Maybe Text -> Maybe Text -> Maybe Text -> ContactMethod)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> ContactMethod)
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
"name")
Parser (Maybe Text -> Maybe Text -> ContactMethod)
-> Parser (Maybe Text) -> Parser (Maybe Text -> ContactMethod)
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
"supportCode")
Parser (Maybe Text -> ContactMethod)
-> Parser (Maybe Text) -> Parser ContactMethod
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
"contactEndpoint")
)
instance Prelude.Hashable ContactMethod
instance Prelude.NFData ContactMethod