{-# 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 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 AssociateWirelessGatewayWithCertificate = AssociateWirelessGatewayWithCertificate'
{
AssociateWirelessGatewayWithCertificate -> Text
id :: Prelude.Text,
AssociateWirelessGatewayWithCertificate -> Text
iotCertificateId :: Prelude.Text
}
deriving (AssociateWirelessGatewayWithCertificate
-> AssociateWirelessGatewayWithCertificate -> Bool
(AssociateWirelessGatewayWithCertificate
-> AssociateWirelessGatewayWithCertificate -> Bool)
-> (AssociateWirelessGatewayWithCertificate
-> AssociateWirelessGatewayWithCertificate -> Bool)
-> Eq AssociateWirelessGatewayWithCertificate
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]
(Int -> ReadS AssociateWirelessGatewayWithCertificate)
-> ReadS [AssociateWirelessGatewayWithCertificate]
-> ReadPrec AssociateWirelessGatewayWithCertificate
-> ReadPrec [AssociateWirelessGatewayWithCertificate]
-> Read 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
(Int -> AssociateWirelessGatewayWithCertificate -> ShowS)
-> (AssociateWirelessGatewayWithCertificate -> String)
-> ([AssociateWirelessGatewayWithCertificate] -> ShowS)
-> Show AssociateWirelessGatewayWithCertificate
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.
AssociateWirelessGatewayWithCertificate
-> Rep AssociateWirelessGatewayWithCertificate x)
-> (forall x.
Rep AssociateWirelessGatewayWithCertificate x
-> AssociateWirelessGatewayWithCertificate)
-> Generic AssociateWirelessGatewayWithCertificate
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' :: Text -> Text -> AssociateWirelessGatewayWithCertificate
AssociateWirelessGatewayWithCertificate'
{ $sel:id:AssociateWirelessGatewayWithCertificate' :: Text
id = Text
pId_,
$sel:iotCertificateId:AssociateWirelessGatewayWithCertificate' :: Text
iotCertificateId =
Text
pIotCertificateId_
}
associateWirelessGatewayWithCertificate_id :: Lens.Lens' AssociateWirelessGatewayWithCertificate Prelude.Text
associateWirelessGatewayWithCertificate_id :: (Text -> f Text)
-> AssociateWirelessGatewayWithCertificate
-> f AssociateWirelessGatewayWithCertificate
associateWirelessGatewayWithCertificate_id = (AssociateWirelessGatewayWithCertificate -> Text)
-> (AssociateWirelessGatewayWithCertificate
-> Text -> AssociateWirelessGatewayWithCertificate)
-> Lens
AssociateWirelessGatewayWithCertificate
AssociateWirelessGatewayWithCertificate
Text
Text
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 :: (Text -> f Text)
-> AssociateWirelessGatewayWithCertificate
-> f AssociateWirelessGatewayWithCertificate
associateWirelessGatewayWithCertificate_iotCertificateId = (AssociateWirelessGatewayWithCertificate -> Text)
-> (AssociateWirelessGatewayWithCertificate
-> Text -> AssociateWirelessGatewayWithCertificate)
-> Lens
AssociateWirelessGatewayWithCertificate
AssociateWirelessGatewayWithCertificate
Text
Text
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 :: AssociateWirelessGatewayWithCertificate
-> Request AssociateWirelessGatewayWithCertificate
request = Service
-> AssociateWirelessGatewayWithCertificate
-> Request AssociateWirelessGatewayWithCertificate
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
response :: Logger
-> Service
-> Proxy AssociateWirelessGatewayWithCertificate
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse
(AWSResponse AssociateWirelessGatewayWithCertificate)))
response =
(Int
-> ResponseHeaders
-> Object
-> Either
String (AWSResponse AssociateWirelessGatewayWithCertificate))
-> Logger
-> Service
-> Proxy AssociateWirelessGatewayWithCertificate
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse
(AWSResponse AssociateWirelessGatewayWithCertificate)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
( \Int
s ResponseHeaders
h Object
x ->
Maybe Text
-> Int -> AssociateWirelessGatewayWithCertificateResponse
AssociateWirelessGatewayWithCertificateResponse'
(Maybe Text
-> Int -> AssociateWirelessGatewayWithCertificateResponse)
-> Either String (Maybe Text)
-> Either
String (Int -> AssociateWirelessGatewayWithCertificateResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Text)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"IotCertificateId")
Either
String (Int -> AssociateWirelessGatewayWithCertificateResponse)
-> Either String Int
-> Either String AssociateWirelessGatewayWithCertificateResponse
forall (f :: * -> *) a b. Applicative f => 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
AssociateWirelessGatewayWithCertificate
instance
Prelude.NFData
AssociateWirelessGatewayWithCertificate
instance
Core.ToHeaders
AssociateWirelessGatewayWithCertificate
where
toHeaders :: AssociateWirelessGatewayWithCertificate -> ResponseHeaders
toHeaders = ResponseHeaders
-> AssociateWirelessGatewayWithCertificate -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty
instance
Core.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
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"IotCertificateId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
iotCertificateId)
]
)
instance
Core.ToPath
AssociateWirelessGatewayWithCertificate
where
toPath :: AssociateWirelessGatewayWithCertificate -> ByteString
toPath AssociateWirelessGatewayWithCertificate' {Text
iotCertificateId :: Text
id :: Text
$sel:iotCertificateId:AssociateWirelessGatewayWithCertificate' :: AssociateWirelessGatewayWithCertificate -> Text
$sel:id:AssociateWirelessGatewayWithCertificate' :: AssociateWirelessGatewayWithCertificate -> Text
..} =
[ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ByteString
"/wireless-gateways/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
id, ByteString
"/certificate"]
instance
Core.ToQuery
AssociateWirelessGatewayWithCertificate
where
toQuery :: AssociateWirelessGatewayWithCertificate -> QueryString
toQuery = QueryString
-> AssociateWirelessGatewayWithCertificate -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
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
(AssociateWirelessGatewayWithCertificateResponse
-> AssociateWirelessGatewayWithCertificateResponse -> Bool)
-> (AssociateWirelessGatewayWithCertificateResponse
-> AssociateWirelessGatewayWithCertificateResponse -> Bool)
-> Eq AssociateWirelessGatewayWithCertificateResponse
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]
(Int -> ReadS AssociateWirelessGatewayWithCertificateResponse)
-> ReadS [AssociateWirelessGatewayWithCertificateResponse]
-> ReadPrec AssociateWirelessGatewayWithCertificateResponse
-> ReadPrec [AssociateWirelessGatewayWithCertificateResponse]
-> Read 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
(Int -> AssociateWirelessGatewayWithCertificateResponse -> ShowS)
-> (AssociateWirelessGatewayWithCertificateResponse -> String)
-> ([AssociateWirelessGatewayWithCertificateResponse] -> ShowS)
-> Show AssociateWirelessGatewayWithCertificateResponse
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.
AssociateWirelessGatewayWithCertificateResponse
-> Rep AssociateWirelessGatewayWithCertificateResponse x)
-> (forall x.
Rep AssociateWirelessGatewayWithCertificateResponse x
-> AssociateWirelessGatewayWithCertificateResponse)
-> Generic AssociateWirelessGatewayWithCertificateResponse
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' :: Maybe Text
-> Int -> AssociateWirelessGatewayWithCertificateResponse
AssociateWirelessGatewayWithCertificateResponse'
{ $sel:iotCertificateId:AssociateWirelessGatewayWithCertificateResponse' :: Maybe Text
iotCertificateId =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:httpStatus:AssociateWirelessGatewayWithCertificateResponse' :: Int
httpStatus = Int
pHttpStatus_
}
associateWirelessGatewayWithCertificateResponse_iotCertificateId :: Lens.Lens' AssociateWirelessGatewayWithCertificateResponse (Prelude.Maybe Prelude.Text)
associateWirelessGatewayWithCertificateResponse_iotCertificateId :: (Maybe Text -> f (Maybe Text))
-> AssociateWirelessGatewayWithCertificateResponse
-> f AssociateWirelessGatewayWithCertificateResponse
associateWirelessGatewayWithCertificateResponse_iotCertificateId = (AssociateWirelessGatewayWithCertificateResponse -> Maybe Text)
-> (AssociateWirelessGatewayWithCertificateResponse
-> Maybe Text -> AssociateWirelessGatewayWithCertificateResponse)
-> Lens
AssociateWirelessGatewayWithCertificateResponse
AssociateWirelessGatewayWithCertificateResponse
(Maybe Text)
(Maybe Text)
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 :: (Int -> f Int)
-> AssociateWirelessGatewayWithCertificateResponse
-> f AssociateWirelessGatewayWithCertificateResponse
associateWirelessGatewayWithCertificateResponse_httpStatus = (AssociateWirelessGatewayWithCertificateResponse -> Int)
-> (AssociateWirelessGatewayWithCertificateResponse
-> Int -> AssociateWirelessGatewayWithCertificateResponse)
-> Lens
AssociateWirelessGatewayWithCertificateResponse
AssociateWirelessGatewayWithCertificateResponse
Int
Int
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