{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}
module Amazonka.Lightsail.DeleteContactMethod
(
DeleteContactMethod (..),
newDeleteContactMethod,
deleteContactMethod_protocol,
DeleteContactMethodResponse (..),
newDeleteContactMethodResponse,
deleteContactMethodResponse_operations,
deleteContactMethodResponse_httpStatus,
)
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
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data DeleteContactMethod = DeleteContactMethod'
{
DeleteContactMethod -> ContactProtocol
protocol :: ContactProtocol
}
deriving (DeleteContactMethod -> DeleteContactMethod -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteContactMethod -> DeleteContactMethod -> Bool
$c/= :: DeleteContactMethod -> DeleteContactMethod -> Bool
== :: DeleteContactMethod -> DeleteContactMethod -> Bool
$c== :: DeleteContactMethod -> DeleteContactMethod -> Bool
Prelude.Eq, ReadPrec [DeleteContactMethod]
ReadPrec DeleteContactMethod
Int -> ReadS DeleteContactMethod
ReadS [DeleteContactMethod]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteContactMethod]
$creadListPrec :: ReadPrec [DeleteContactMethod]
readPrec :: ReadPrec DeleteContactMethod
$creadPrec :: ReadPrec DeleteContactMethod
readList :: ReadS [DeleteContactMethod]
$creadList :: ReadS [DeleteContactMethod]
readsPrec :: Int -> ReadS DeleteContactMethod
$creadsPrec :: Int -> ReadS DeleteContactMethod
Prelude.Read, Int -> DeleteContactMethod -> ShowS
[DeleteContactMethod] -> ShowS
DeleteContactMethod -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteContactMethod] -> ShowS
$cshowList :: [DeleteContactMethod] -> ShowS
show :: DeleteContactMethod -> String
$cshow :: DeleteContactMethod -> String
showsPrec :: Int -> DeleteContactMethod -> ShowS
$cshowsPrec :: Int -> DeleteContactMethod -> ShowS
Prelude.Show, forall x. Rep DeleteContactMethod x -> DeleteContactMethod
forall x. DeleteContactMethod -> Rep DeleteContactMethod x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteContactMethod x -> DeleteContactMethod
$cfrom :: forall x. DeleteContactMethod -> Rep DeleteContactMethod x
Prelude.Generic)
newDeleteContactMethod ::
ContactProtocol ->
DeleteContactMethod
newDeleteContactMethod :: ContactProtocol -> DeleteContactMethod
newDeleteContactMethod ContactProtocol
pProtocol_ =
DeleteContactMethod' {$sel:protocol:DeleteContactMethod' :: ContactProtocol
protocol = ContactProtocol
pProtocol_}
deleteContactMethod_protocol :: Lens.Lens' DeleteContactMethod ContactProtocol
deleteContactMethod_protocol :: Lens' DeleteContactMethod ContactProtocol
deleteContactMethod_protocol = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteContactMethod' {ContactProtocol
protocol :: ContactProtocol
$sel:protocol:DeleteContactMethod' :: DeleteContactMethod -> ContactProtocol
protocol} -> ContactProtocol
protocol) (\s :: DeleteContactMethod
s@DeleteContactMethod' {} ContactProtocol
a -> DeleteContactMethod
s {$sel:protocol:DeleteContactMethod' :: ContactProtocol
protocol = ContactProtocol
a} :: DeleteContactMethod)
instance Core.AWSRequest DeleteContactMethod where
type
AWSResponse DeleteContactMethod =
DeleteContactMethodResponse
request :: (Service -> Service)
-> DeleteContactMethod -> Request DeleteContactMethod
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteContactMethod
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse DeleteContactMethod)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe [Operation] -> Int -> DeleteContactMethodResponse
DeleteContactMethodResponse'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"operations" forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ forall a. Monoid a => a
Prelude.mempty)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable DeleteContactMethod where
hashWithSalt :: Int -> DeleteContactMethod -> Int
hashWithSalt Int
_salt DeleteContactMethod' {ContactProtocol
protocol :: ContactProtocol
$sel:protocol:DeleteContactMethod' :: DeleteContactMethod -> ContactProtocol
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` ContactProtocol
protocol
instance Prelude.NFData DeleteContactMethod where
rnf :: DeleteContactMethod -> ()
rnf DeleteContactMethod' {ContactProtocol
protocol :: ContactProtocol
$sel:protocol:DeleteContactMethod' :: DeleteContactMethod -> ContactProtocol
..} = forall a. NFData a => a -> ()
Prelude.rnf ContactProtocol
protocol
instance Data.ToHeaders DeleteContactMethod where
toHeaders :: DeleteContactMethod -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"Lightsail_20161128.DeleteContactMethod" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON DeleteContactMethod where
toJSON :: DeleteContactMethod -> Value
toJSON DeleteContactMethod' {ContactProtocol
protocol :: ContactProtocol
$sel:protocol:DeleteContactMethod' :: DeleteContactMethod -> ContactProtocol
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[forall a. a -> Maybe a
Prelude.Just (Key
"protocol" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= ContactProtocol
protocol)]
)
instance Data.ToPath DeleteContactMethod where
toPath :: DeleteContactMethod -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance Data.ToQuery DeleteContactMethod where
toQuery :: DeleteContactMethod -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data DeleteContactMethodResponse = DeleteContactMethodResponse'
{
DeleteContactMethodResponse -> Maybe [Operation]
operations :: Prelude.Maybe [Operation],
DeleteContactMethodResponse -> Int
httpStatus :: Prelude.Int
}
deriving (DeleteContactMethodResponse -> DeleteContactMethodResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteContactMethodResponse -> DeleteContactMethodResponse -> Bool
$c/= :: DeleteContactMethodResponse -> DeleteContactMethodResponse -> Bool
== :: DeleteContactMethodResponse -> DeleteContactMethodResponse -> Bool
$c== :: DeleteContactMethodResponse -> DeleteContactMethodResponse -> Bool
Prelude.Eq, ReadPrec [DeleteContactMethodResponse]
ReadPrec DeleteContactMethodResponse
Int -> ReadS DeleteContactMethodResponse
ReadS [DeleteContactMethodResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteContactMethodResponse]
$creadListPrec :: ReadPrec [DeleteContactMethodResponse]
readPrec :: ReadPrec DeleteContactMethodResponse
$creadPrec :: ReadPrec DeleteContactMethodResponse
readList :: ReadS [DeleteContactMethodResponse]
$creadList :: ReadS [DeleteContactMethodResponse]
readsPrec :: Int -> ReadS DeleteContactMethodResponse
$creadsPrec :: Int -> ReadS DeleteContactMethodResponse
Prelude.Read, Int -> DeleteContactMethodResponse -> ShowS
[DeleteContactMethodResponse] -> ShowS
DeleteContactMethodResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteContactMethodResponse] -> ShowS
$cshowList :: [DeleteContactMethodResponse] -> ShowS
show :: DeleteContactMethodResponse -> String
$cshow :: DeleteContactMethodResponse -> String
showsPrec :: Int -> DeleteContactMethodResponse -> ShowS
$cshowsPrec :: Int -> DeleteContactMethodResponse -> ShowS
Prelude.Show, forall x.
Rep DeleteContactMethodResponse x -> DeleteContactMethodResponse
forall x.
DeleteContactMethodResponse -> Rep DeleteContactMethodResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteContactMethodResponse x -> DeleteContactMethodResponse
$cfrom :: forall x.
DeleteContactMethodResponse -> Rep DeleteContactMethodResponse x
Prelude.Generic)
newDeleteContactMethodResponse ::
Prelude.Int ->
DeleteContactMethodResponse
newDeleteContactMethodResponse :: Int -> DeleteContactMethodResponse
newDeleteContactMethodResponse Int
pHttpStatus_ =
DeleteContactMethodResponse'
{ $sel:operations:DeleteContactMethodResponse' :: Maybe [Operation]
operations =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:DeleteContactMethodResponse' :: Int
httpStatus = Int
pHttpStatus_
}
deleteContactMethodResponse_operations :: Lens.Lens' DeleteContactMethodResponse (Prelude.Maybe [Operation])
deleteContactMethodResponse_operations :: Lens' DeleteContactMethodResponse (Maybe [Operation])
deleteContactMethodResponse_operations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteContactMethodResponse' {Maybe [Operation]
operations :: Maybe [Operation]
$sel:operations:DeleteContactMethodResponse' :: DeleteContactMethodResponse -> Maybe [Operation]
operations} -> Maybe [Operation]
operations) (\s :: DeleteContactMethodResponse
s@DeleteContactMethodResponse' {} Maybe [Operation]
a -> DeleteContactMethodResponse
s {$sel:operations:DeleteContactMethodResponse' :: Maybe [Operation]
operations = Maybe [Operation]
a} :: DeleteContactMethodResponse) 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
deleteContactMethodResponse_httpStatus :: Lens.Lens' DeleteContactMethodResponse Prelude.Int
deleteContactMethodResponse_httpStatus :: Lens' DeleteContactMethodResponse Int
deleteContactMethodResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteContactMethodResponse' {Int
httpStatus :: Int
$sel:httpStatus:DeleteContactMethodResponse' :: DeleteContactMethodResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DeleteContactMethodResponse
s@DeleteContactMethodResponse' {} Int
a -> DeleteContactMethodResponse
s {$sel:httpStatus:DeleteContactMethodResponse' :: Int
httpStatus = Int
a} :: DeleteContactMethodResponse)
instance Prelude.NFData DeleteContactMethodResponse where
rnf :: DeleteContactMethodResponse -> ()
rnf DeleteContactMethodResponse' {Int
Maybe [Operation]
httpStatus :: Int
operations :: Maybe [Operation]
$sel:httpStatus:DeleteContactMethodResponse' :: DeleteContactMethodResponse -> Int
$sel:operations:DeleteContactMethodResponse' :: DeleteContactMethodResponse -> Maybe [Operation]
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe [Operation]
operations
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus