{-# 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.IoTWireless.UpdatePartnerAccount
(
UpdatePartnerAccount (..),
newUpdatePartnerAccount,
updatePartnerAccount_sidewalk,
updatePartnerAccount_partnerAccountId,
updatePartnerAccount_partnerType,
UpdatePartnerAccountResponse (..),
newUpdatePartnerAccountResponse,
updatePartnerAccountResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import Amazonka.IoTWireless.Types
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data UpdatePartnerAccount = UpdatePartnerAccount'
{
UpdatePartnerAccount -> SidewalkUpdateAccount
sidewalk :: SidewalkUpdateAccount,
UpdatePartnerAccount -> Text
partnerAccountId :: Prelude.Text,
UpdatePartnerAccount -> PartnerType
partnerType :: PartnerType
}
deriving (UpdatePartnerAccount -> UpdatePartnerAccount -> Bool
(UpdatePartnerAccount -> UpdatePartnerAccount -> Bool)
-> (UpdatePartnerAccount -> UpdatePartnerAccount -> Bool)
-> Eq UpdatePartnerAccount
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdatePartnerAccount -> UpdatePartnerAccount -> Bool
$c/= :: UpdatePartnerAccount -> UpdatePartnerAccount -> Bool
== :: UpdatePartnerAccount -> UpdatePartnerAccount -> Bool
$c== :: UpdatePartnerAccount -> UpdatePartnerAccount -> Bool
Prelude.Eq, Int -> UpdatePartnerAccount -> ShowS
[UpdatePartnerAccount] -> ShowS
UpdatePartnerAccount -> String
(Int -> UpdatePartnerAccount -> ShowS)
-> (UpdatePartnerAccount -> String)
-> ([UpdatePartnerAccount] -> ShowS)
-> Show UpdatePartnerAccount
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdatePartnerAccount] -> ShowS
$cshowList :: [UpdatePartnerAccount] -> ShowS
show :: UpdatePartnerAccount -> String
$cshow :: UpdatePartnerAccount -> String
showsPrec :: Int -> UpdatePartnerAccount -> ShowS
$cshowsPrec :: Int -> UpdatePartnerAccount -> ShowS
Prelude.Show, (forall x. UpdatePartnerAccount -> Rep UpdatePartnerAccount x)
-> (forall x. Rep UpdatePartnerAccount x -> UpdatePartnerAccount)
-> Generic UpdatePartnerAccount
forall x. Rep UpdatePartnerAccount x -> UpdatePartnerAccount
forall x. UpdatePartnerAccount -> Rep UpdatePartnerAccount x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdatePartnerAccount x -> UpdatePartnerAccount
$cfrom :: forall x. UpdatePartnerAccount -> Rep UpdatePartnerAccount x
Prelude.Generic)
newUpdatePartnerAccount ::
SidewalkUpdateAccount ->
Prelude.Text ->
PartnerType ->
UpdatePartnerAccount
newUpdatePartnerAccount :: SidewalkUpdateAccount
-> Text -> PartnerType -> UpdatePartnerAccount
newUpdatePartnerAccount
SidewalkUpdateAccount
pSidewalk_
Text
pPartnerAccountId_
PartnerType
pPartnerType_ =
UpdatePartnerAccount' :: SidewalkUpdateAccount
-> Text -> PartnerType -> UpdatePartnerAccount
UpdatePartnerAccount'
{ $sel:sidewalk:UpdatePartnerAccount' :: SidewalkUpdateAccount
sidewalk = SidewalkUpdateAccount
pSidewalk_,
$sel:partnerAccountId:UpdatePartnerAccount' :: Text
partnerAccountId = Text
pPartnerAccountId_,
$sel:partnerType:UpdatePartnerAccount' :: PartnerType
partnerType = PartnerType
pPartnerType_
}
updatePartnerAccount_sidewalk :: Lens.Lens' UpdatePartnerAccount SidewalkUpdateAccount
updatePartnerAccount_sidewalk :: (SidewalkUpdateAccount -> f SidewalkUpdateAccount)
-> UpdatePartnerAccount -> f UpdatePartnerAccount
updatePartnerAccount_sidewalk = (UpdatePartnerAccount -> SidewalkUpdateAccount)
-> (UpdatePartnerAccount
-> SidewalkUpdateAccount -> UpdatePartnerAccount)
-> Lens
UpdatePartnerAccount
UpdatePartnerAccount
SidewalkUpdateAccount
SidewalkUpdateAccount
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdatePartnerAccount' {SidewalkUpdateAccount
sidewalk :: SidewalkUpdateAccount
$sel:sidewalk:UpdatePartnerAccount' :: UpdatePartnerAccount -> SidewalkUpdateAccount
sidewalk} -> SidewalkUpdateAccount
sidewalk) (\s :: UpdatePartnerAccount
s@UpdatePartnerAccount' {} SidewalkUpdateAccount
a -> UpdatePartnerAccount
s {$sel:sidewalk:UpdatePartnerAccount' :: SidewalkUpdateAccount
sidewalk = SidewalkUpdateAccount
a} :: UpdatePartnerAccount)
updatePartnerAccount_partnerAccountId :: Lens.Lens' UpdatePartnerAccount Prelude.Text
updatePartnerAccount_partnerAccountId :: (Text -> f Text) -> UpdatePartnerAccount -> f UpdatePartnerAccount
updatePartnerAccount_partnerAccountId = (UpdatePartnerAccount -> Text)
-> (UpdatePartnerAccount -> Text -> UpdatePartnerAccount)
-> Lens UpdatePartnerAccount UpdatePartnerAccount Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdatePartnerAccount' {Text
partnerAccountId :: Text
$sel:partnerAccountId:UpdatePartnerAccount' :: UpdatePartnerAccount -> Text
partnerAccountId} -> Text
partnerAccountId) (\s :: UpdatePartnerAccount
s@UpdatePartnerAccount' {} Text
a -> UpdatePartnerAccount
s {$sel:partnerAccountId:UpdatePartnerAccount' :: Text
partnerAccountId = Text
a} :: UpdatePartnerAccount)
updatePartnerAccount_partnerType :: Lens.Lens' UpdatePartnerAccount PartnerType
updatePartnerAccount_partnerType :: (PartnerType -> f PartnerType)
-> UpdatePartnerAccount -> f UpdatePartnerAccount
updatePartnerAccount_partnerType = (UpdatePartnerAccount -> PartnerType)
-> (UpdatePartnerAccount -> PartnerType -> UpdatePartnerAccount)
-> Lens
UpdatePartnerAccount UpdatePartnerAccount PartnerType PartnerType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdatePartnerAccount' {PartnerType
partnerType :: PartnerType
$sel:partnerType:UpdatePartnerAccount' :: UpdatePartnerAccount -> PartnerType
partnerType} -> PartnerType
partnerType) (\s :: UpdatePartnerAccount
s@UpdatePartnerAccount' {} PartnerType
a -> UpdatePartnerAccount
s {$sel:partnerType:UpdatePartnerAccount' :: PartnerType
partnerType = PartnerType
a} :: UpdatePartnerAccount)
instance Core.AWSRequest UpdatePartnerAccount where
type
AWSResponse UpdatePartnerAccount =
UpdatePartnerAccountResponse
request :: UpdatePartnerAccount -> Request UpdatePartnerAccount
request = Service -> UpdatePartnerAccount -> Request UpdatePartnerAccount
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON Service
defaultService
response :: Logger
-> Service
-> Proxy UpdatePartnerAccount
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdatePartnerAccount)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse UpdatePartnerAccount))
-> Logger
-> Service
-> Proxy UpdatePartnerAccount
-> ClientResponse ClientBody
-> m (Either
Error (ClientResponse (AWSResponse UpdatePartnerAccount)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> UpdatePartnerAccountResponse
UpdatePartnerAccountResponse'
(Int -> UpdatePartnerAccountResponse)
-> Either String Int -> Either String UpdatePartnerAccountResponse
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
)
instance Prelude.Hashable UpdatePartnerAccount
instance Prelude.NFData UpdatePartnerAccount
instance Core.ToHeaders UpdatePartnerAccount where
toHeaders :: UpdatePartnerAccount -> ResponseHeaders
toHeaders = ResponseHeaders -> UpdatePartnerAccount -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance Core.ToJSON UpdatePartnerAccount where
toJSON :: UpdatePartnerAccount -> Value
toJSON UpdatePartnerAccount' {Text
PartnerType
SidewalkUpdateAccount
partnerType :: PartnerType
partnerAccountId :: Text
sidewalk :: SidewalkUpdateAccount
$sel:partnerType:UpdatePartnerAccount' :: UpdatePartnerAccount -> PartnerType
$sel:partnerAccountId:UpdatePartnerAccount' :: UpdatePartnerAccount -> Text
$sel:sidewalk:UpdatePartnerAccount' :: UpdatePartnerAccount -> SidewalkUpdateAccount
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Sidewalk" Text -> SidewalkUpdateAccount -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= SidewalkUpdateAccount
sidewalk)]
)
instance Core.ToPath UpdatePartnerAccount where
toPath :: UpdatePartnerAccount -> ByteString
toPath UpdatePartnerAccount' {Text
PartnerType
SidewalkUpdateAccount
partnerType :: PartnerType
partnerAccountId :: Text
sidewalk :: SidewalkUpdateAccount
$sel:partnerType:UpdatePartnerAccount' :: UpdatePartnerAccount -> PartnerType
$sel:partnerAccountId:UpdatePartnerAccount' :: UpdatePartnerAccount -> Text
$sel:sidewalk:UpdatePartnerAccount' :: UpdatePartnerAccount -> SidewalkUpdateAccount
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/partner-accounts/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
partnerAccountId]
instance Core.ToQuery UpdatePartnerAccount where
toQuery :: UpdatePartnerAccount -> QueryString
toQuery UpdatePartnerAccount' {Text
PartnerType
SidewalkUpdateAccount
partnerType :: PartnerType
partnerAccountId :: Text
sidewalk :: SidewalkUpdateAccount
$sel:partnerType:UpdatePartnerAccount' :: UpdatePartnerAccount -> PartnerType
$sel:partnerAccountId:UpdatePartnerAccount' :: UpdatePartnerAccount -> Text
$sel:sidewalk:UpdatePartnerAccount' :: UpdatePartnerAccount -> SidewalkUpdateAccount
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [ByteString
"partnerType" ByteString -> PartnerType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: PartnerType
partnerType]
data UpdatePartnerAccountResponse = UpdatePartnerAccountResponse'
{
UpdatePartnerAccountResponse -> Int
httpStatus :: Prelude.Int
}
deriving (UpdatePartnerAccountResponse
-> UpdatePartnerAccountResponse -> Bool
(UpdatePartnerAccountResponse
-> UpdatePartnerAccountResponse -> Bool)
-> (UpdatePartnerAccountResponse
-> UpdatePartnerAccountResponse -> Bool)
-> Eq UpdatePartnerAccountResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdatePartnerAccountResponse
-> UpdatePartnerAccountResponse -> Bool
$c/= :: UpdatePartnerAccountResponse
-> UpdatePartnerAccountResponse -> Bool
== :: UpdatePartnerAccountResponse
-> UpdatePartnerAccountResponse -> Bool
$c== :: UpdatePartnerAccountResponse
-> UpdatePartnerAccountResponse -> Bool
Prelude.Eq, ReadPrec [UpdatePartnerAccountResponse]
ReadPrec UpdatePartnerAccountResponse
Int -> ReadS UpdatePartnerAccountResponse
ReadS [UpdatePartnerAccountResponse]
(Int -> ReadS UpdatePartnerAccountResponse)
-> ReadS [UpdatePartnerAccountResponse]
-> ReadPrec UpdatePartnerAccountResponse
-> ReadPrec [UpdatePartnerAccountResponse]
-> Read UpdatePartnerAccountResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdatePartnerAccountResponse]
$creadListPrec :: ReadPrec [UpdatePartnerAccountResponse]
readPrec :: ReadPrec UpdatePartnerAccountResponse
$creadPrec :: ReadPrec UpdatePartnerAccountResponse
readList :: ReadS [UpdatePartnerAccountResponse]
$creadList :: ReadS [UpdatePartnerAccountResponse]
readsPrec :: Int -> ReadS UpdatePartnerAccountResponse
$creadsPrec :: Int -> ReadS UpdatePartnerAccountResponse
Prelude.Read, Int -> UpdatePartnerAccountResponse -> ShowS
[UpdatePartnerAccountResponse] -> ShowS
UpdatePartnerAccountResponse -> String
(Int -> UpdatePartnerAccountResponse -> ShowS)
-> (UpdatePartnerAccountResponse -> String)
-> ([UpdatePartnerAccountResponse] -> ShowS)
-> Show UpdatePartnerAccountResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdatePartnerAccountResponse] -> ShowS
$cshowList :: [UpdatePartnerAccountResponse] -> ShowS
show :: UpdatePartnerAccountResponse -> String
$cshow :: UpdatePartnerAccountResponse -> String
showsPrec :: Int -> UpdatePartnerAccountResponse -> ShowS
$cshowsPrec :: Int -> UpdatePartnerAccountResponse -> ShowS
Prelude.Show, (forall x.
UpdatePartnerAccountResponse -> Rep UpdatePartnerAccountResponse x)
-> (forall x.
Rep UpdatePartnerAccountResponse x -> UpdatePartnerAccountResponse)
-> Generic UpdatePartnerAccountResponse
forall x.
Rep UpdatePartnerAccountResponse x -> UpdatePartnerAccountResponse
forall x.
UpdatePartnerAccountResponse -> Rep UpdatePartnerAccountResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdatePartnerAccountResponse x -> UpdatePartnerAccountResponse
$cfrom :: forall x.
UpdatePartnerAccountResponse -> Rep UpdatePartnerAccountResponse x
Prelude.Generic)
newUpdatePartnerAccountResponse ::
Prelude.Int ->
UpdatePartnerAccountResponse
newUpdatePartnerAccountResponse :: Int -> UpdatePartnerAccountResponse
newUpdatePartnerAccountResponse Int
pHttpStatus_ =
UpdatePartnerAccountResponse' :: Int -> UpdatePartnerAccountResponse
UpdatePartnerAccountResponse'
{ $sel:httpStatus:UpdatePartnerAccountResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
updatePartnerAccountResponse_httpStatus :: Lens.Lens' UpdatePartnerAccountResponse Prelude.Int
updatePartnerAccountResponse_httpStatus :: (Int -> f Int)
-> UpdatePartnerAccountResponse -> f UpdatePartnerAccountResponse
updatePartnerAccountResponse_httpStatus = (UpdatePartnerAccountResponse -> Int)
-> (UpdatePartnerAccountResponse
-> Int -> UpdatePartnerAccountResponse)
-> Lens
UpdatePartnerAccountResponse UpdatePartnerAccountResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdatePartnerAccountResponse' {Int
httpStatus :: Int
$sel:httpStatus:UpdatePartnerAccountResponse' :: UpdatePartnerAccountResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: UpdatePartnerAccountResponse
s@UpdatePartnerAccountResponse' {} Int
a -> UpdatePartnerAccountResponse
s {$sel:httpStatus:UpdatePartnerAccountResponse' :: Int
httpStatus = Int
a} :: UpdatePartnerAccountResponse)
instance Prelude.NFData UpdatePartnerAccountResponse