{-# 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.AlexaBusiness.AssociateDeviceWithNetworkProfile
(
AssociateDeviceWithNetworkProfile (..),
newAssociateDeviceWithNetworkProfile,
associateDeviceWithNetworkProfile_deviceArn,
associateDeviceWithNetworkProfile_networkProfileArn,
AssociateDeviceWithNetworkProfileResponse (..),
newAssociateDeviceWithNetworkProfileResponse,
associateDeviceWithNetworkProfileResponse_httpStatus,
)
where
import Amazonka.AlexaBusiness.Types
import qualified Amazonka.Core as Core
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 AssociateDeviceWithNetworkProfile = AssociateDeviceWithNetworkProfile'
{
AssociateDeviceWithNetworkProfile -> Text
deviceArn :: Prelude.Text,
AssociateDeviceWithNetworkProfile -> Text
networkProfileArn :: Prelude.Text
}
deriving (AssociateDeviceWithNetworkProfile
-> AssociateDeviceWithNetworkProfile -> Bool
(AssociateDeviceWithNetworkProfile
-> AssociateDeviceWithNetworkProfile -> Bool)
-> (AssociateDeviceWithNetworkProfile
-> AssociateDeviceWithNetworkProfile -> Bool)
-> Eq AssociateDeviceWithNetworkProfile
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateDeviceWithNetworkProfile
-> AssociateDeviceWithNetworkProfile -> Bool
$c/= :: AssociateDeviceWithNetworkProfile
-> AssociateDeviceWithNetworkProfile -> Bool
== :: AssociateDeviceWithNetworkProfile
-> AssociateDeviceWithNetworkProfile -> Bool
$c== :: AssociateDeviceWithNetworkProfile
-> AssociateDeviceWithNetworkProfile -> Bool
Prelude.Eq, ReadPrec [AssociateDeviceWithNetworkProfile]
ReadPrec AssociateDeviceWithNetworkProfile
Int -> ReadS AssociateDeviceWithNetworkProfile
ReadS [AssociateDeviceWithNetworkProfile]
(Int -> ReadS AssociateDeviceWithNetworkProfile)
-> ReadS [AssociateDeviceWithNetworkProfile]
-> ReadPrec AssociateDeviceWithNetworkProfile
-> ReadPrec [AssociateDeviceWithNetworkProfile]
-> Read AssociateDeviceWithNetworkProfile
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateDeviceWithNetworkProfile]
$creadListPrec :: ReadPrec [AssociateDeviceWithNetworkProfile]
readPrec :: ReadPrec AssociateDeviceWithNetworkProfile
$creadPrec :: ReadPrec AssociateDeviceWithNetworkProfile
readList :: ReadS [AssociateDeviceWithNetworkProfile]
$creadList :: ReadS [AssociateDeviceWithNetworkProfile]
readsPrec :: Int -> ReadS AssociateDeviceWithNetworkProfile
$creadsPrec :: Int -> ReadS AssociateDeviceWithNetworkProfile
Prelude.Read, Int -> AssociateDeviceWithNetworkProfile -> ShowS
[AssociateDeviceWithNetworkProfile] -> ShowS
AssociateDeviceWithNetworkProfile -> String
(Int -> AssociateDeviceWithNetworkProfile -> ShowS)
-> (AssociateDeviceWithNetworkProfile -> String)
-> ([AssociateDeviceWithNetworkProfile] -> ShowS)
-> Show AssociateDeviceWithNetworkProfile
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateDeviceWithNetworkProfile] -> ShowS
$cshowList :: [AssociateDeviceWithNetworkProfile] -> ShowS
show :: AssociateDeviceWithNetworkProfile -> String
$cshow :: AssociateDeviceWithNetworkProfile -> String
showsPrec :: Int -> AssociateDeviceWithNetworkProfile -> ShowS
$cshowsPrec :: Int -> AssociateDeviceWithNetworkProfile -> ShowS
Prelude.Show, (forall x.
AssociateDeviceWithNetworkProfile
-> Rep AssociateDeviceWithNetworkProfile x)
-> (forall x.
Rep AssociateDeviceWithNetworkProfile x
-> AssociateDeviceWithNetworkProfile)
-> Generic AssociateDeviceWithNetworkProfile
forall x.
Rep AssociateDeviceWithNetworkProfile x
-> AssociateDeviceWithNetworkProfile
forall x.
AssociateDeviceWithNetworkProfile
-> Rep AssociateDeviceWithNetworkProfile x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateDeviceWithNetworkProfile x
-> AssociateDeviceWithNetworkProfile
$cfrom :: forall x.
AssociateDeviceWithNetworkProfile
-> Rep AssociateDeviceWithNetworkProfile x
Prelude.Generic)
newAssociateDeviceWithNetworkProfile ::
Prelude.Text ->
Prelude.Text ->
AssociateDeviceWithNetworkProfile
newAssociateDeviceWithNetworkProfile :: Text -> Text -> AssociateDeviceWithNetworkProfile
newAssociateDeviceWithNetworkProfile
Text
pDeviceArn_
Text
pNetworkProfileArn_ =
AssociateDeviceWithNetworkProfile' :: Text -> Text -> AssociateDeviceWithNetworkProfile
AssociateDeviceWithNetworkProfile'
{ $sel:deviceArn:AssociateDeviceWithNetworkProfile' :: Text
deviceArn =
Text
pDeviceArn_,
$sel:networkProfileArn:AssociateDeviceWithNetworkProfile' :: Text
networkProfileArn = Text
pNetworkProfileArn_
}
associateDeviceWithNetworkProfile_deviceArn :: Lens.Lens' AssociateDeviceWithNetworkProfile Prelude.Text
associateDeviceWithNetworkProfile_deviceArn :: (Text -> f Text)
-> AssociateDeviceWithNetworkProfile
-> f AssociateDeviceWithNetworkProfile
associateDeviceWithNetworkProfile_deviceArn = (AssociateDeviceWithNetworkProfile -> Text)
-> (AssociateDeviceWithNetworkProfile
-> Text -> AssociateDeviceWithNetworkProfile)
-> Lens
AssociateDeviceWithNetworkProfile
AssociateDeviceWithNetworkProfile
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateDeviceWithNetworkProfile' {Text
deviceArn :: Text
$sel:deviceArn:AssociateDeviceWithNetworkProfile' :: AssociateDeviceWithNetworkProfile -> Text
deviceArn} -> Text
deviceArn) (\s :: AssociateDeviceWithNetworkProfile
s@AssociateDeviceWithNetworkProfile' {} Text
a -> AssociateDeviceWithNetworkProfile
s {$sel:deviceArn:AssociateDeviceWithNetworkProfile' :: Text
deviceArn = Text
a} :: AssociateDeviceWithNetworkProfile)
associateDeviceWithNetworkProfile_networkProfileArn :: Lens.Lens' AssociateDeviceWithNetworkProfile Prelude.Text
associateDeviceWithNetworkProfile_networkProfileArn :: (Text -> f Text)
-> AssociateDeviceWithNetworkProfile
-> f AssociateDeviceWithNetworkProfile
associateDeviceWithNetworkProfile_networkProfileArn = (AssociateDeviceWithNetworkProfile -> Text)
-> (AssociateDeviceWithNetworkProfile
-> Text -> AssociateDeviceWithNetworkProfile)
-> Lens
AssociateDeviceWithNetworkProfile
AssociateDeviceWithNetworkProfile
Text
Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateDeviceWithNetworkProfile' {Text
networkProfileArn :: Text
$sel:networkProfileArn:AssociateDeviceWithNetworkProfile' :: AssociateDeviceWithNetworkProfile -> Text
networkProfileArn} -> Text
networkProfileArn) (\s :: AssociateDeviceWithNetworkProfile
s@AssociateDeviceWithNetworkProfile' {} Text
a -> AssociateDeviceWithNetworkProfile
s {$sel:networkProfileArn:AssociateDeviceWithNetworkProfile' :: Text
networkProfileArn = Text
a} :: AssociateDeviceWithNetworkProfile)
instance
Core.AWSRequest
AssociateDeviceWithNetworkProfile
where
type
AWSResponse AssociateDeviceWithNetworkProfile =
AssociateDeviceWithNetworkProfileResponse
request :: AssociateDeviceWithNetworkProfile
-> Request AssociateDeviceWithNetworkProfile
request = Service
-> AssociateDeviceWithNetworkProfile
-> Request AssociateDeviceWithNetworkProfile
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
response :: Logger
-> Service
-> Proxy AssociateDeviceWithNetworkProfile
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse AssociateDeviceWithNetworkProfile)))
response =
(Int
-> ResponseHeaders
-> ()
-> Either String (AWSResponse AssociateDeviceWithNetworkProfile))
-> Logger
-> Service
-> Proxy AssociateDeviceWithNetworkProfile
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse AssociateDeviceWithNetworkProfile)))
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 -> AssociateDeviceWithNetworkProfileResponse
AssociateDeviceWithNetworkProfileResponse'
(Int -> AssociateDeviceWithNetworkProfileResponse)
-> Either String Int
-> Either String AssociateDeviceWithNetworkProfileResponse
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
AssociateDeviceWithNetworkProfile
instance
Prelude.NFData
AssociateDeviceWithNetworkProfile
instance
Core.ToHeaders
AssociateDeviceWithNetworkProfile
where
toHeaders :: AssociateDeviceWithNetworkProfile -> ResponseHeaders
toHeaders =
ResponseHeaders
-> AssociateDeviceWithNetworkProfile -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AlexaForBusiness.AssociateDeviceWithNetworkProfile" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance
Core.ToJSON
AssociateDeviceWithNetworkProfile
where
toJSON :: AssociateDeviceWithNetworkProfile -> Value
toJSON AssociateDeviceWithNetworkProfile' {Text
networkProfileArn :: Text
deviceArn :: Text
$sel:networkProfileArn:AssociateDeviceWithNetworkProfile' :: AssociateDeviceWithNetworkProfile -> Text
$sel:deviceArn:AssociateDeviceWithNetworkProfile' :: AssociateDeviceWithNetworkProfile -> 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
"DeviceArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
deviceArn),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"NetworkProfileArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
networkProfileArn)
]
)
instance
Core.ToPath
AssociateDeviceWithNetworkProfile
where
toPath :: AssociateDeviceWithNetworkProfile -> ByteString
toPath = ByteString -> AssociateDeviceWithNetworkProfile -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance
Core.ToQuery
AssociateDeviceWithNetworkProfile
where
toQuery :: AssociateDeviceWithNetworkProfile -> QueryString
toQuery = QueryString -> AssociateDeviceWithNetworkProfile -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty
data AssociateDeviceWithNetworkProfileResponse = AssociateDeviceWithNetworkProfileResponse'
{
AssociateDeviceWithNetworkProfileResponse -> Int
httpStatus :: Prelude.Int
}
deriving (AssociateDeviceWithNetworkProfileResponse
-> AssociateDeviceWithNetworkProfileResponse -> Bool
(AssociateDeviceWithNetworkProfileResponse
-> AssociateDeviceWithNetworkProfileResponse -> Bool)
-> (AssociateDeviceWithNetworkProfileResponse
-> AssociateDeviceWithNetworkProfileResponse -> Bool)
-> Eq AssociateDeviceWithNetworkProfileResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AssociateDeviceWithNetworkProfileResponse
-> AssociateDeviceWithNetworkProfileResponse -> Bool
$c/= :: AssociateDeviceWithNetworkProfileResponse
-> AssociateDeviceWithNetworkProfileResponse -> Bool
== :: AssociateDeviceWithNetworkProfileResponse
-> AssociateDeviceWithNetworkProfileResponse -> Bool
$c== :: AssociateDeviceWithNetworkProfileResponse
-> AssociateDeviceWithNetworkProfileResponse -> Bool
Prelude.Eq, ReadPrec [AssociateDeviceWithNetworkProfileResponse]
ReadPrec AssociateDeviceWithNetworkProfileResponse
Int -> ReadS AssociateDeviceWithNetworkProfileResponse
ReadS [AssociateDeviceWithNetworkProfileResponse]
(Int -> ReadS AssociateDeviceWithNetworkProfileResponse)
-> ReadS [AssociateDeviceWithNetworkProfileResponse]
-> ReadPrec AssociateDeviceWithNetworkProfileResponse
-> ReadPrec [AssociateDeviceWithNetworkProfileResponse]
-> Read AssociateDeviceWithNetworkProfileResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AssociateDeviceWithNetworkProfileResponse]
$creadListPrec :: ReadPrec [AssociateDeviceWithNetworkProfileResponse]
readPrec :: ReadPrec AssociateDeviceWithNetworkProfileResponse
$creadPrec :: ReadPrec AssociateDeviceWithNetworkProfileResponse
readList :: ReadS [AssociateDeviceWithNetworkProfileResponse]
$creadList :: ReadS [AssociateDeviceWithNetworkProfileResponse]
readsPrec :: Int -> ReadS AssociateDeviceWithNetworkProfileResponse
$creadsPrec :: Int -> ReadS AssociateDeviceWithNetworkProfileResponse
Prelude.Read, Int -> AssociateDeviceWithNetworkProfileResponse -> ShowS
[AssociateDeviceWithNetworkProfileResponse] -> ShowS
AssociateDeviceWithNetworkProfileResponse -> String
(Int -> AssociateDeviceWithNetworkProfileResponse -> ShowS)
-> (AssociateDeviceWithNetworkProfileResponse -> String)
-> ([AssociateDeviceWithNetworkProfileResponse] -> ShowS)
-> Show AssociateDeviceWithNetworkProfileResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AssociateDeviceWithNetworkProfileResponse] -> ShowS
$cshowList :: [AssociateDeviceWithNetworkProfileResponse] -> ShowS
show :: AssociateDeviceWithNetworkProfileResponse -> String
$cshow :: AssociateDeviceWithNetworkProfileResponse -> String
showsPrec :: Int -> AssociateDeviceWithNetworkProfileResponse -> ShowS
$cshowsPrec :: Int -> AssociateDeviceWithNetworkProfileResponse -> ShowS
Prelude.Show, (forall x.
AssociateDeviceWithNetworkProfileResponse
-> Rep AssociateDeviceWithNetworkProfileResponse x)
-> (forall x.
Rep AssociateDeviceWithNetworkProfileResponse x
-> AssociateDeviceWithNetworkProfileResponse)
-> Generic AssociateDeviceWithNetworkProfileResponse
forall x.
Rep AssociateDeviceWithNetworkProfileResponse x
-> AssociateDeviceWithNetworkProfileResponse
forall x.
AssociateDeviceWithNetworkProfileResponse
-> Rep AssociateDeviceWithNetworkProfileResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AssociateDeviceWithNetworkProfileResponse x
-> AssociateDeviceWithNetworkProfileResponse
$cfrom :: forall x.
AssociateDeviceWithNetworkProfileResponse
-> Rep AssociateDeviceWithNetworkProfileResponse x
Prelude.Generic)
newAssociateDeviceWithNetworkProfileResponse ::
Prelude.Int ->
AssociateDeviceWithNetworkProfileResponse
newAssociateDeviceWithNetworkProfileResponse :: Int -> AssociateDeviceWithNetworkProfileResponse
newAssociateDeviceWithNetworkProfileResponse
Int
pHttpStatus_ =
AssociateDeviceWithNetworkProfileResponse' :: Int -> AssociateDeviceWithNetworkProfileResponse
AssociateDeviceWithNetworkProfileResponse'
{ $sel:httpStatus:AssociateDeviceWithNetworkProfileResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
associateDeviceWithNetworkProfileResponse_httpStatus :: Lens.Lens' AssociateDeviceWithNetworkProfileResponse Prelude.Int
associateDeviceWithNetworkProfileResponse_httpStatus :: (Int -> f Int)
-> AssociateDeviceWithNetworkProfileResponse
-> f AssociateDeviceWithNetworkProfileResponse
associateDeviceWithNetworkProfileResponse_httpStatus = (AssociateDeviceWithNetworkProfileResponse -> Int)
-> (AssociateDeviceWithNetworkProfileResponse
-> Int -> AssociateDeviceWithNetworkProfileResponse)
-> Lens
AssociateDeviceWithNetworkProfileResponse
AssociateDeviceWithNetworkProfileResponse
Int
Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AssociateDeviceWithNetworkProfileResponse' {Int
httpStatus :: Int
$sel:httpStatus:AssociateDeviceWithNetworkProfileResponse' :: AssociateDeviceWithNetworkProfileResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: AssociateDeviceWithNetworkProfileResponse
s@AssociateDeviceWithNetworkProfileResponse' {} Int
a -> AssociateDeviceWithNetworkProfileResponse
s {$sel:httpStatus:AssociateDeviceWithNetworkProfileResponse' :: Int
httpStatus = Int
a} :: AssociateDeviceWithNetworkProfileResponse)
instance
Prelude.NFData
AssociateDeviceWithNetworkProfileResponse