{-# 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.AssociateWirelessGatewayWithCertificate
(
AssociateWirelessGatewayWithCertificate (..),
newAssociateWirelessGatewayWithCertificate,
associateWirelessGatewayWithCertificate_id,
associateWirelessGatewayWithCertificate_iotCertificateId,
AssociateWirelessGatewayWithCertificateResponse (..),
newAssociateWirelessGatewayWithCertificateResponse,
associateWirelessGatewayWithCertificateResponse_iotCertificateId,
associateWirelessGatewayWithCertificateResponse_httpStatus,
)
where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoTWireless.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response
data AssociateWirelessGatewayWithCertificate = AssociateWirelessGatewayWithCertificate'
{
AssociateWirelessGatewayWithCertificate -> Text
id :: Prelude.Text,
AssociateWirelessGatewayWithCertificate -> Text
iotCertificateId :: Prelude.Text
}
deriving (AssociateWirelessGatewayWithCertificate
-> AssociateWirelessGatewayWithCertificate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateWirelessGatewayWithCertificate
-> AssociateWirelessGatewayWithCertificate -> Bool
$c/= :: AssociateWirelessGatewayWithCertificate
-> AssociateWirelessGatewayWithCertificate -> Bool
== :: AssociateWirelessGatewayWithCertificate
-> AssociateWirelessGatewayWithCertificate -> Bool
$c== :: AssociateWirelessGatewayWithCertificate
-> AssociateWirelessGatewayWithCertificate -> Bool
Prelude.Eq, ReadPrec [AssociateWirelessGatewayWithCertificate]
ReadPrec AssociateWirelessGatewayWithCertificate
Int -> ReadS AssociateWirelessGatewayWithCertificate
ReadS [AssociateWirelessGatewayWithCertificate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateWirelessGatewayWithCertificate]
$creadListPrec :: ReadPrec [AssociateWirelessGatewayWithCertificate]
readPrec :: ReadPrec AssociateWirelessGatewayWithCertificate
$creadPrec :: ReadPrec AssociateWirelessGatewayWithCertificate
readList :: ReadS [AssociateWirelessGatewayWithCertificate]
$creadList :: ReadS [AssociateWirelessGatewayWithCertificate]
readsPrec :: Int -> ReadS AssociateWirelessGatewayWithCertificate
$creadsPrec :: Int -> ReadS AssociateWirelessGatewayWithCertificate
Prelude.Read, Int -> AssociateWirelessGatewayWithCertificate -> ShowS
[AssociateWirelessGatewayWithCertificate] -> ShowS
AssociateWirelessGatewayWithCertificate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateWirelessGatewayWithCertificate] -> ShowS
$cshowList :: [AssociateWirelessGatewayWithCertificate] -> ShowS
show :: AssociateWirelessGatewayWithCertificate -> String
$cshow :: AssociateWirelessGatewayWithCertificate -> String
showsPrec :: Int -> AssociateWirelessGatewayWithCertificate -> ShowS
$cshowsPrec :: Int -> AssociateWirelessGatewayWithCertificate -> ShowS
Prelude.Show, forall x.
Rep AssociateWirelessGatewayWithCertificate x
-> AssociateWirelessGatewayWithCertificate
forall x.
AssociateWirelessGatewayWithCertificate
-> Rep AssociateWirelessGatewayWithCertificate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateWirelessGatewayWithCertificate x
-> AssociateWirelessGatewayWithCertificate
$cfrom :: forall x.
AssociateWirelessGatewayWithCertificate
-> Rep AssociateWirelessGatewayWithCertificate x
Prelude.Generic)
newAssociateWirelessGatewayWithCertificate ::
Prelude.Text ->
Prelude.Text ->
AssociateWirelessGatewayWithCertificate
newAssociateWirelessGatewayWithCertificate :: Text -> Text -> AssociateWirelessGatewayWithCertificate
newAssociateWirelessGatewayWithCertificate
Text
pId_
Text
pIotCertificateId_ =
AssociateWirelessGatewayWithCertificate'
{ $sel:id:AssociateWirelessGatewayWithCertificate' :: Text
id = Text
pId_,
$sel:iotCertificateId:AssociateWirelessGatewayWithCertificate' :: Text
iotCertificateId =
Text
pIotCertificateId_
}
associateWirelessGatewayWithCertificate_id :: Lens.Lens' AssociateWirelessGatewayWithCertificate Prelude.Text
associateWirelessGatewayWithCertificate_id :: Lens' AssociateWirelessGatewayWithCertificate Text
associateWirelessGatewayWithCertificate_id = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateWirelessGatewayWithCertificate' {Text
id :: Text
$sel:id:AssociateWirelessGatewayWithCertificate' :: AssociateWirelessGatewayWithCertificate -> Text
id} -> Text
id) (\s :: AssociateWirelessGatewayWithCertificate
s@AssociateWirelessGatewayWithCertificate' {} Text
a -> AssociateWirelessGatewayWithCertificate
s {$sel:id:AssociateWirelessGatewayWithCertificate' :: Text
id = Text
a} :: AssociateWirelessGatewayWithCertificate)
associateWirelessGatewayWithCertificate_iotCertificateId :: Lens.Lens' AssociateWirelessGatewayWithCertificate Prelude.Text
associateWirelessGatewayWithCertificate_iotCertificateId :: Lens' AssociateWirelessGatewayWithCertificate Text
associateWirelessGatewayWithCertificate_iotCertificateId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateWirelessGatewayWithCertificate' {Text
iotCertificateId :: Text
$sel:iotCertificateId:AssociateWirelessGatewayWithCertificate' :: AssociateWirelessGatewayWithCertificate -> Text
iotCertificateId} -> Text
iotCertificateId) (\s :: AssociateWirelessGatewayWithCertificate
s@AssociateWirelessGatewayWithCertificate' {} Text
a -> AssociateWirelessGatewayWithCertificate
s {$sel:iotCertificateId:AssociateWirelessGatewayWithCertificate' :: Text
iotCertificateId = Text
a} :: AssociateWirelessGatewayWithCertificate)
instance
Core.AWSRequest
AssociateWirelessGatewayWithCertificate
where
type
AWSResponse
AssociateWirelessGatewayWithCertificate =
AssociateWirelessGatewayWithCertificateResponse
request :: (Service -> Service)
-> AssociateWirelessGatewayWithCertificate
-> Request AssociateWirelessGatewayWithCertificate
request Service -> Service
overrides =
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON (Service -> Service
overrides Service
defaultService)
response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy AssociateWirelessGatewayWithCertificate
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse
(AWSResponse AssociateWirelessGatewayWithCertificate)))
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 Text
-> Int -> AssociateWirelessGatewayWithCertificateResponse
AssociateWirelessGatewayWithCertificateResponse'
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
"IotCertificateId")
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
AssociateWirelessGatewayWithCertificate
where
hashWithSalt :: Int -> AssociateWirelessGatewayWithCertificate -> Int
hashWithSalt
Int
_salt
AssociateWirelessGatewayWithCertificate' {Text
iotCertificateId :: Text
id :: Text
$sel:iotCertificateId:AssociateWirelessGatewayWithCertificate' :: AssociateWirelessGatewayWithCertificate -> Text
$sel:id:AssociateWirelessGatewayWithCertificate' :: AssociateWirelessGatewayWithCertificate -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
id
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
iotCertificateId
instance
Prelude.NFData
AssociateWirelessGatewayWithCertificate
where
rnf :: AssociateWirelessGatewayWithCertificate -> ()
rnf AssociateWirelessGatewayWithCertificate' {Text
iotCertificateId :: Text
id :: Text
$sel:iotCertificateId:AssociateWirelessGatewayWithCertificate' :: AssociateWirelessGatewayWithCertificate -> Text
$sel:id:AssociateWirelessGatewayWithCertificate' :: AssociateWirelessGatewayWithCertificate -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
id
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
iotCertificateId
instance
Data.ToHeaders
AssociateWirelessGatewayWithCertificate
where
toHeaders :: AssociateWirelessGatewayWithCertificate -> ResponseHeaders
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
instance
Data.ToJSON
AssociateWirelessGatewayWithCertificate
where
toJSON :: AssociateWirelessGatewayWithCertificate -> Value
toJSON AssociateWirelessGatewayWithCertificate' {Text
iotCertificateId :: Text
id :: Text
$sel:iotCertificateId:AssociateWirelessGatewayWithCertificate' :: AssociateWirelessGatewayWithCertificate -> Text
$sel:id:AssociateWirelessGatewayWithCertificate' :: AssociateWirelessGatewayWithCertificate -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just
(Key
"IotCertificateId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
iotCertificateId)
]
)
instance
Data.ToPath
AssociateWirelessGatewayWithCertificate
where
toPath :: AssociateWirelessGatewayWithCertificate -> ByteString
toPath AssociateWirelessGatewayWithCertificate' {Text
iotCertificateId :: Text
id :: Text
$sel:iotCertificateId:AssociateWirelessGatewayWithCertificate' :: AssociateWirelessGatewayWithCertificate -> Text
$sel:id:AssociateWirelessGatewayWithCertificate' :: AssociateWirelessGatewayWithCertificate -> Text
..} =
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/wireless-gateways/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
id, ByteString
"/certificate"]
instance
Data.ToQuery
AssociateWirelessGatewayWithCertificate
where
toQuery :: AssociateWirelessGatewayWithCertificate -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data AssociateWirelessGatewayWithCertificateResponse = AssociateWirelessGatewayWithCertificateResponse'
{
AssociateWirelessGatewayWithCertificateResponse -> Maybe Text
iotCertificateId :: Prelude.Maybe Prelude.Text,
AssociateWirelessGatewayWithCertificateResponse -> Int
httpStatus :: Prelude.Int
}
deriving (AssociateWirelessGatewayWithCertificateResponse
-> AssociateWirelessGatewayWithCertificateResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateWirelessGatewayWithCertificateResponse
-> AssociateWirelessGatewayWithCertificateResponse -> Bool
$c/= :: AssociateWirelessGatewayWithCertificateResponse
-> AssociateWirelessGatewayWithCertificateResponse -> Bool
== :: AssociateWirelessGatewayWithCertificateResponse
-> AssociateWirelessGatewayWithCertificateResponse -> Bool
$c== :: AssociateWirelessGatewayWithCertificateResponse
-> AssociateWirelessGatewayWithCertificateResponse -> Bool
Prelude.Eq, ReadPrec [AssociateWirelessGatewayWithCertificateResponse]
ReadPrec AssociateWirelessGatewayWithCertificateResponse
Int -> ReadS AssociateWirelessGatewayWithCertificateResponse
ReadS [AssociateWirelessGatewayWithCertificateResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateWirelessGatewayWithCertificateResponse]
$creadListPrec :: ReadPrec [AssociateWirelessGatewayWithCertificateResponse]
readPrec :: ReadPrec AssociateWirelessGatewayWithCertificateResponse
$creadPrec :: ReadPrec AssociateWirelessGatewayWithCertificateResponse
readList :: ReadS [AssociateWirelessGatewayWithCertificateResponse]
$creadList :: ReadS [AssociateWirelessGatewayWithCertificateResponse]
readsPrec :: Int -> ReadS AssociateWirelessGatewayWithCertificateResponse
$creadsPrec :: Int -> ReadS AssociateWirelessGatewayWithCertificateResponse
Prelude.Read, Int -> AssociateWirelessGatewayWithCertificateResponse -> ShowS
[AssociateWirelessGatewayWithCertificateResponse] -> ShowS
AssociateWirelessGatewayWithCertificateResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateWirelessGatewayWithCertificateResponse] -> ShowS
$cshowList :: [AssociateWirelessGatewayWithCertificateResponse] -> ShowS
show :: AssociateWirelessGatewayWithCertificateResponse -> String
$cshow :: AssociateWirelessGatewayWithCertificateResponse -> String
showsPrec :: Int -> AssociateWirelessGatewayWithCertificateResponse -> ShowS
$cshowsPrec :: Int -> AssociateWirelessGatewayWithCertificateResponse -> ShowS
Prelude.Show, forall x.
Rep AssociateWirelessGatewayWithCertificateResponse x
-> AssociateWirelessGatewayWithCertificateResponse
forall x.
AssociateWirelessGatewayWithCertificateResponse
-> Rep AssociateWirelessGatewayWithCertificateResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateWirelessGatewayWithCertificateResponse x
-> AssociateWirelessGatewayWithCertificateResponse
$cfrom :: forall x.
AssociateWirelessGatewayWithCertificateResponse
-> Rep AssociateWirelessGatewayWithCertificateResponse x
Prelude.Generic)
newAssociateWirelessGatewayWithCertificateResponse ::
Prelude.Int ->
AssociateWirelessGatewayWithCertificateResponse
newAssociateWirelessGatewayWithCertificateResponse :: Int -> AssociateWirelessGatewayWithCertificateResponse
newAssociateWirelessGatewayWithCertificateResponse
Int
pHttpStatus_ =
AssociateWirelessGatewayWithCertificateResponse'
{ $sel:iotCertificateId:AssociateWirelessGatewayWithCertificateResponse' :: Maybe Text
iotCertificateId =
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:AssociateWirelessGatewayWithCertificateResponse' :: Int
httpStatus = Int
pHttpStatus_
}
associateWirelessGatewayWithCertificateResponse_iotCertificateId :: Lens.Lens' AssociateWirelessGatewayWithCertificateResponse (Prelude.Maybe Prelude.Text)
associateWirelessGatewayWithCertificateResponse_iotCertificateId :: Lens' AssociateWirelessGatewayWithCertificateResponse (Maybe Text)
associateWirelessGatewayWithCertificateResponse_iotCertificateId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateWirelessGatewayWithCertificateResponse' {Maybe Text
iotCertificateId :: Maybe Text
$sel:iotCertificateId:AssociateWirelessGatewayWithCertificateResponse' :: AssociateWirelessGatewayWithCertificateResponse -> Maybe Text
iotCertificateId} -> Maybe Text
iotCertificateId) (\s :: AssociateWirelessGatewayWithCertificateResponse
s@AssociateWirelessGatewayWithCertificateResponse' {} Maybe Text
a -> AssociateWirelessGatewayWithCertificateResponse
s {$sel:iotCertificateId:AssociateWirelessGatewayWithCertificateResponse' :: Maybe Text
iotCertificateId = Maybe Text
a} :: AssociateWirelessGatewayWithCertificateResponse)
associateWirelessGatewayWithCertificateResponse_httpStatus :: Lens.Lens' AssociateWirelessGatewayWithCertificateResponse Prelude.Int
associateWirelessGatewayWithCertificateResponse_httpStatus :: Lens' AssociateWirelessGatewayWithCertificateResponse Int
associateWirelessGatewayWithCertificateResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateWirelessGatewayWithCertificateResponse' {Int
httpStatus :: Int
$sel:httpStatus:AssociateWirelessGatewayWithCertificateResponse' :: AssociateWirelessGatewayWithCertificateResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: AssociateWirelessGatewayWithCertificateResponse
s@AssociateWirelessGatewayWithCertificateResponse' {} Int
a -> AssociateWirelessGatewayWithCertificateResponse
s {$sel:httpStatus:AssociateWirelessGatewayWithCertificateResponse' :: Int
httpStatus = Int
a} :: AssociateWirelessGatewayWithCertificateResponse)
instance
Prelude.NFData
AssociateWirelessGatewayWithCertificateResponse
where
rnf :: AssociateWirelessGatewayWithCertificateResponse -> ()
rnf
AssociateWirelessGatewayWithCertificateResponse' {Int
Maybe Text
httpStatus :: Int
iotCertificateId :: Maybe Text
$sel:httpStatus:AssociateWirelessGatewayWithCertificateResponse' :: AssociateWirelessGatewayWithCertificateResponse -> Int
$sel:iotCertificateId:AssociateWirelessGatewayWithCertificateResponse' :: AssociateWirelessGatewayWithCertificateResponse -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
iotCertificateId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus