{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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 Text
arn :: Prelude.Maybe Prelude.Text,
ContactMethod -> Maybe Text
contactEndpoint :: Prelude.Maybe Prelude.Text,
ContactMethod -> Maybe POSIX
createdAt :: Prelude.Maybe Data.POSIX,
ContactMethod -> Maybe ResourceLocation
location :: Prelude.Maybe ResourceLocation,
ContactMethod -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
ContactMethod -> Maybe ContactProtocol
protocol :: Prelude.Maybe ContactProtocol,
ContactMethod -> Maybe ResourceType
resourceType :: Prelude.Maybe ResourceType,
ContactMethod -> Maybe ContactMethodStatus
status :: Prelude.Maybe ContactMethodStatus,
ContactMethod -> Maybe Text
supportCode :: Prelude.Maybe Prelude.Text
}
deriving (ContactMethod -> ContactMethod -> Bool
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]
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
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. 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'
{ $sel:arn:ContactMethod' :: Maybe Text
arn = forall a. Maybe a
Prelude.Nothing,
$sel:contactEndpoint:ContactMethod' :: Maybe Text
contactEndpoint = forall a. Maybe a
Prelude.Nothing,
$sel:createdAt:ContactMethod' :: Maybe POSIX
createdAt = forall a. Maybe a
Prelude.Nothing,
$sel:location:ContactMethod' :: Maybe ResourceLocation
location = forall a. Maybe a
Prelude.Nothing,
$sel:name:ContactMethod' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
$sel:protocol:ContactMethod' :: Maybe ContactProtocol
protocol = forall a. Maybe a
Prelude.Nothing,
$sel:resourceType:ContactMethod' :: Maybe ResourceType
resourceType = forall a. Maybe a
Prelude.Nothing,
$sel:status:ContactMethod' :: Maybe ContactMethodStatus
status = forall a. Maybe a
Prelude.Nothing,
$sel:supportCode:ContactMethod' :: Maybe Text
supportCode = forall a. Maybe a
Prelude.Nothing
}
contactMethod_arn :: Lens.Lens' ContactMethod (Prelude.Maybe Prelude.Text)
contactMethod_arn :: Lens' ContactMethod (Maybe Text)
contactMethod_arn = 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_contactEndpoint :: Lens.Lens' ContactMethod (Prelude.Maybe Prelude.Text)
contactMethod_contactEndpoint :: Lens' ContactMethod (Maybe Text)
contactMethod_contactEndpoint = 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)
contactMethod_createdAt :: Lens.Lens' ContactMethod (Prelude.Maybe Prelude.UTCTime)
contactMethod_createdAt :: Lens' ContactMethod (Maybe UTCTime)
contactMethod_createdAt = 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) 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 (a :: Format). Iso' (Time a) UTCTime
Data._Time
contactMethod_location :: Lens.Lens' ContactMethod (Prelude.Maybe ResourceLocation)
contactMethod_location :: Lens' ContactMethod (Maybe ResourceLocation)
contactMethod_location = 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_name :: Lens.Lens' ContactMethod (Prelude.Maybe Prelude.Text)
contactMethod_name :: Lens' ContactMethod (Maybe Text)
contactMethod_name = 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_protocol :: Lens.Lens' ContactMethod (Prelude.Maybe ContactProtocol)
contactMethod_protocol :: Lens' ContactMethod (Maybe ContactProtocol)
contactMethod_protocol = 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_resourceType :: Lens.Lens' ContactMethod (Prelude.Maybe ResourceType)
contactMethod_resourceType :: Lens' ContactMethod (Maybe ResourceType)
contactMethod_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_status :: Lens.Lens' ContactMethod (Prelude.Maybe ContactMethodStatus)
contactMethod_status :: Lens' ContactMethod (Maybe ContactMethodStatus)
contactMethod_status = 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_supportCode :: Lens.Lens' ContactMethod (Prelude.Maybe Prelude.Text)
contactMethod_supportCode :: Lens' ContactMethod (Maybe Text)
contactMethod_supportCode = 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)
instance Data.FromJSON ContactMethod where
parseJSON :: Value -> Parser ContactMethod
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"ContactMethod"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe ResourceLocation
-> Maybe Text
-> Maybe ContactProtocol
-> Maybe ResourceType
-> Maybe ContactMethodStatus
-> Maybe Text
-> ContactMethod
ContactMethod'
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
"arn")
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
"contactEndpoint")
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
"createdAt")
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
"location")
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
"name")
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
"protocol")
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
"resourceType")
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
"supportCode")
)
instance Prelude.Hashable ContactMethod where
hashWithSalt :: Int -> ContactMethod -> Int
hashWithSalt Int
_salt ContactMethod' {Maybe Text
Maybe POSIX
Maybe ContactMethodStatus
Maybe ContactProtocol
Maybe ResourceLocation
Maybe ResourceType
supportCode :: Maybe Text
status :: Maybe ContactMethodStatus
resourceType :: Maybe ResourceType
protocol :: Maybe ContactProtocol
name :: Maybe Text
location :: Maybe ResourceLocation
createdAt :: Maybe POSIX
contactEndpoint :: Maybe Text
arn :: Maybe Text
$sel:supportCode:ContactMethod' :: ContactMethod -> Maybe Text
$sel:status:ContactMethod' :: ContactMethod -> Maybe ContactMethodStatus
$sel:resourceType:ContactMethod' :: ContactMethod -> Maybe ResourceType
$sel:protocol:ContactMethod' :: ContactMethod -> Maybe ContactProtocol
$sel:name:ContactMethod' :: ContactMethod -> Maybe Text
$sel:location:ContactMethod' :: ContactMethod -> Maybe ResourceLocation
$sel:createdAt:ContactMethod' :: ContactMethod -> Maybe POSIX
$sel:contactEndpoint:ContactMethod' :: ContactMethod -> Maybe Text
$sel:arn:ContactMethod' :: ContactMethod -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
arn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
contactEndpoint
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
createdAt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ResourceLocation
location
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ContactProtocol
protocol
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ResourceType
resourceType
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ContactMethodStatus
status
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
supportCode
instance Prelude.NFData ContactMethod where
rnf :: ContactMethod -> ()
rnf ContactMethod' {Maybe Text
Maybe POSIX
Maybe ContactMethodStatus
Maybe ContactProtocol
Maybe ResourceLocation
Maybe ResourceType
supportCode :: Maybe Text
status :: Maybe ContactMethodStatus
resourceType :: Maybe ResourceType
protocol :: Maybe ContactProtocol
name :: Maybe Text
location :: Maybe ResourceLocation
createdAt :: Maybe POSIX
contactEndpoint :: Maybe Text
arn :: Maybe Text
$sel:supportCode:ContactMethod' :: ContactMethod -> Maybe Text
$sel:status:ContactMethod' :: ContactMethod -> Maybe ContactMethodStatus
$sel:resourceType:ContactMethod' :: ContactMethod -> Maybe ResourceType
$sel:protocol:ContactMethod' :: ContactMethod -> Maybe ContactProtocol
$sel:name:ContactMethod' :: ContactMethod -> Maybe Text
$sel:location:ContactMethod' :: ContactMethod -> Maybe ResourceLocation
$sel:createdAt:ContactMethod' :: ContactMethod -> Maybe POSIX
$sel:contactEndpoint:ContactMethod' :: ContactMethod -> Maybe Text
$sel:arn:ContactMethod' :: ContactMethod -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
arn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
contactEndpoint
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
createdAt
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ResourceLocation
location
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 ContactProtocol
protocol
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ResourceType
resourceType
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ContactMethodStatus
status
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
supportCode