{-# 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.Account.GetContactInformation
(
GetContactInformation (..),
newGetContactInformation,
getContactInformation_accountId,
GetContactInformationResponse (..),
newGetContactInformationResponse,
getContactInformationResponse_contactInformation,
getContactInformationResponse_httpStatus,
)
where
import Amazonka.Account.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data GetContactInformation = GetContactInformation'
{
GetContactInformation -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text
}
deriving (GetContactInformation -> GetContactInformation -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetContactInformation -> GetContactInformation -> Bool
$c/= :: GetContactInformation -> GetContactInformation -> Bool
== :: GetContactInformation -> GetContactInformation -> Bool
$c== :: GetContactInformation -> GetContactInformation -> Bool
Prelude.Eq, ReadPrec [GetContactInformation]
ReadPrec GetContactInformation
Int -> ReadS GetContactInformation
ReadS [GetContactInformation]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetContactInformation]
$creadListPrec :: ReadPrec [GetContactInformation]
readPrec :: ReadPrec GetContactInformation
$creadPrec :: ReadPrec GetContactInformation
readList :: ReadS [GetContactInformation]
$creadList :: ReadS [GetContactInformation]
readsPrec :: Int -> ReadS GetContactInformation
$creadsPrec :: Int -> ReadS GetContactInformation
Prelude.Read, Int -> GetContactInformation -> ShowS
[GetContactInformation] -> ShowS
GetContactInformation -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetContactInformation] -> ShowS
$cshowList :: [GetContactInformation] -> ShowS
show :: GetContactInformation -> String
$cshow :: GetContactInformation -> String
showsPrec :: Int -> GetContactInformation -> ShowS
$cshowsPrec :: Int -> GetContactInformation -> ShowS
Prelude.Show, forall x. Rep GetContactInformation x -> GetContactInformation
forall x. GetContactInformation -> Rep GetContactInformation x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetContactInformation x -> GetContactInformation
$cfrom :: forall x. GetContactInformation -> Rep GetContactInformation x
Prelude.Generic)
newGetContactInformation ::
GetContactInformation
newGetContactInformation :: GetContactInformation
newGetContactInformation =
GetContactInformation' {$sel:accountId:GetContactInformation' :: Maybe Text
accountId = forall a. Maybe a
Prelude.Nothing}
getContactInformation_accountId :: Lens.Lens' GetContactInformation (Prelude.Maybe Prelude.Text)
getContactInformation_accountId :: Lens' GetContactInformation (Maybe Text)
getContactInformation_accountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContactInformation' {Maybe Text
accountId :: Maybe Text
$sel:accountId:GetContactInformation' :: GetContactInformation -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: GetContactInformation
s@GetContactInformation' {} Maybe Text
a -> GetContactInformation
s {$sel:accountId:GetContactInformation' :: Maybe Text
accountId = Maybe Text
a} :: GetContactInformation)
instance Core.AWSRequest GetContactInformation where
type
AWSResponse GetContactInformation =
GetContactInformationResponse
request :: (Service -> Service)
-> GetContactInformation -> Request GetContactInformation
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 GetContactInformation
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse GetContactInformation)))
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 ContactInformation -> Int -> GetContactInformationResponse
GetContactInformationResponse'
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
"ContactInformation")
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 GetContactInformation where
hashWithSalt :: Int -> GetContactInformation -> Int
hashWithSalt Int
_salt GetContactInformation' {Maybe Text
accountId :: Maybe Text
$sel:accountId:GetContactInformation' :: GetContactInformation -> Maybe Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
accountId
instance Prelude.NFData GetContactInformation where
rnf :: GetContactInformation -> ()
rnf GetContactInformation' {Maybe Text
accountId :: Maybe Text
$sel:accountId:GetContactInformation' :: GetContactInformation -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
accountId
instance Data.ToHeaders GetContactInformation where
toHeaders :: GetContactInformation -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance Data.ToJSON GetContactInformation where
toJSON :: GetContactInformation -> Value
toJSON GetContactInformation' {Maybe Text
accountId :: Maybe Text
$sel:accountId:GetContactInformation' :: GetContactInformation -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Key
"AccountId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
accountId]
)
instance Data.ToPath GetContactInformation where
toPath :: GetContactInformation -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/getContactInformation"
instance Data.ToQuery GetContactInformation where
toQuery :: GetContactInformation -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data GetContactInformationResponse = GetContactInformationResponse'
{
GetContactInformationResponse -> Maybe ContactInformation
contactInformation :: Prelude.Maybe ContactInformation,
GetContactInformationResponse -> Int
httpStatus :: Prelude.Int
}
deriving (GetContactInformationResponse
-> GetContactInformationResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetContactInformationResponse
-> GetContactInformationResponse -> Bool
$c/= :: GetContactInformationResponse
-> GetContactInformationResponse -> Bool
== :: GetContactInformationResponse
-> GetContactInformationResponse -> Bool
$c== :: GetContactInformationResponse
-> GetContactInformationResponse -> Bool
Prelude.Eq, Int -> GetContactInformationResponse -> ShowS
[GetContactInformationResponse] -> ShowS
GetContactInformationResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetContactInformationResponse] -> ShowS
$cshowList :: [GetContactInformationResponse] -> ShowS
show :: GetContactInformationResponse -> String
$cshow :: GetContactInformationResponse -> String
showsPrec :: Int -> GetContactInformationResponse -> ShowS
$cshowsPrec :: Int -> GetContactInformationResponse -> ShowS
Prelude.Show, forall x.
Rep GetContactInformationResponse x
-> GetContactInformationResponse
forall x.
GetContactInformationResponse
-> Rep GetContactInformationResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetContactInformationResponse x
-> GetContactInformationResponse
$cfrom :: forall x.
GetContactInformationResponse
-> Rep GetContactInformationResponse x
Prelude.Generic)
newGetContactInformationResponse ::
Prelude.Int ->
GetContactInformationResponse
newGetContactInformationResponse :: Int -> GetContactInformationResponse
newGetContactInformationResponse Int
pHttpStatus_ =
GetContactInformationResponse'
{ $sel:contactInformation:GetContactInformationResponse' :: Maybe ContactInformation
contactInformation =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:GetContactInformationResponse' :: Int
httpStatus = Int
pHttpStatus_
}
getContactInformationResponse_contactInformation :: Lens.Lens' GetContactInformationResponse (Prelude.Maybe ContactInformation)
getContactInformationResponse_contactInformation :: Lens' GetContactInformationResponse (Maybe ContactInformation)
getContactInformationResponse_contactInformation = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContactInformationResponse' {Maybe ContactInformation
contactInformation :: Maybe ContactInformation
$sel:contactInformation:GetContactInformationResponse' :: GetContactInformationResponse -> Maybe ContactInformation
contactInformation} -> Maybe ContactInformation
contactInformation) (\s :: GetContactInformationResponse
s@GetContactInformationResponse' {} Maybe ContactInformation
a -> GetContactInformationResponse
s {$sel:contactInformation:GetContactInformationResponse' :: Maybe ContactInformation
contactInformation = Maybe ContactInformation
a} :: GetContactInformationResponse)
getContactInformationResponse_httpStatus :: Lens.Lens' GetContactInformationResponse Prelude.Int
getContactInformationResponse_httpStatus :: Lens' GetContactInformationResponse Int
getContactInformationResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetContactInformationResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetContactInformationResponse' :: GetContactInformationResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetContactInformationResponse
s@GetContactInformationResponse' {} Int
a -> GetContactInformationResponse
s {$sel:httpStatus:GetContactInformationResponse' :: Int
httpStatus = Int
a} :: GetContactInformationResponse)
instance Prelude.NFData GetContactInformationResponse where
rnf :: GetContactInformationResponse -> ()
rnf GetContactInformationResponse' {Int
Maybe ContactInformation
httpStatus :: Int
contactInformation :: Maybe ContactInformation
$sel:httpStatus:GetContactInformationResponse' :: GetContactInformationResponse -> Int
$sel:contactInformation:GetContactInformationResponse' :: GetContactInformationResponse -> Maybe ContactInformation
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe ContactInformation
contactInformation
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus