{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Lightsail.Types.ContactMethod
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | Describes a contact method.
--
-- A contact method is a way to send you notifications. For more
-- information, see
-- <https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-notifications Notifications in Amazon Lightsail>.
--
-- /See:/ 'newContactMethod' smart constructor.
data ContactMethod = ContactMethod'
  { -- | The current status of the contact method.
    --
    -- A contact method has the following possible status:
    --
    -- -   @PendingVerification@ - The contact method has not yet been
    --     verified, and the verification has not yet expired.
    --
    -- -   @Valid@ - The contact method has been verified.
    --
    -- -   @InValid@ - An attempt was made to verify the contact method, but
    --     the verification has expired.
    ContactMethod -> Maybe ContactMethodStatus
status :: Prelude.Maybe ContactMethodStatus,
    -- | The Lightsail resource type (e.g., @ContactMethod@).
    ContactMethod -> Maybe ResourceType
resourceType :: Prelude.Maybe ResourceType,
    -- | The Amazon Resource Name (ARN) of the contact method.
    ContactMethod -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The timestamp when the contact method was created.
    ContactMethod -> Maybe POSIX
createdAt :: Prelude.Maybe Core.POSIX,
    ContactMethod -> Maybe ResourceLocation
location :: Prelude.Maybe ResourceLocation,
    -- | The protocol of the contact method, such as email or SMS (text
    -- messaging).
    ContactMethod -> Maybe ContactProtocol
protocol :: Prelude.Maybe ContactProtocol,
    -- | The name of the contact method.
    ContactMethod -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The support code. Include this code in your email to support when you
    -- have questions about your Lightsail contact method. This code enables
    -- our support team to look up your Lightsail information more easily.
    ContactMethod -> Maybe Text
supportCode :: Prelude.Maybe Prelude.Text,
    -- | The destination of the contact method, such as an email address or a
    -- mobile phone number.
    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)

-- |
-- Create a value of 'ContactMethod' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'status', 'contactMethod_status' - The current status of the contact method.
--
-- A contact method has the following possible status:
--
-- -   @PendingVerification@ - The contact method has not yet been
--     verified, and the verification has not yet expired.
--
-- -   @Valid@ - The contact method has been verified.
--
-- -   @InValid@ - An attempt was made to verify the contact method, but
--     the verification has expired.
--
-- 'resourceType', 'contactMethod_resourceType' - The Lightsail resource type (e.g., @ContactMethod@).
--
-- 'arn', 'contactMethod_arn' - The Amazon Resource Name (ARN) of the contact method.
--
-- 'createdAt', 'contactMethod_createdAt' - The timestamp when the contact method was created.
--
-- 'location', 'contactMethod_location' - Undocumented member.
--
-- 'protocol', 'contactMethod_protocol' - The protocol of the contact method, such as email or SMS (text
-- messaging).
--
-- 'name', 'contactMethod_name' - The name of the contact method.
--
-- 'supportCode', 'contactMethod_supportCode' - The support code. Include this code in your email to support when you
-- have questions about your Lightsail contact method. This code enables
-- our support team to look up your Lightsail information more easily.
--
-- 'contactEndpoint', 'contactMethod_contactEndpoint' - The destination of the contact method, such as an email address or a
-- mobile phone number.
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
    }

-- | The current status of the contact method.
--
-- A contact method has the following possible status:
--
-- -   @PendingVerification@ - The contact method has not yet been
--     verified, and the verification has not yet expired.
--
-- -   @Valid@ - The contact method has been verified.
--
-- -   @InValid@ - An attempt was made to verify the contact method, but
--     the verification has expired.
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)

-- | The Lightsail resource type (e.g., @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)

-- | The Amazon Resource Name (ARN) of the contact method.
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)

-- | The timestamp when the contact method was created.
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

-- | Undocumented member.
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)

-- | The protocol of the contact method, such as email or SMS (text
-- messaging).
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)

-- | The name of the contact method.
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)

-- | The support code. Include this code in your email to support when you
-- have questions about your Lightsail contact method. This code enables
-- our support team to look up your Lightsail information more easily.
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)

-- | The destination of the contact method, such as an email address or a
-- mobile phone number.
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