{-# 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.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 AssociateDeviceWithNetworkProfile = AssociateDeviceWithNetworkProfile'
{
AssociateDeviceWithNetworkProfile -> Text
deviceArn :: Prelude.Text,
AssociateDeviceWithNetworkProfile -> Text
networkProfileArn :: Prelude.Text
}
deriving (AssociateDeviceWithNetworkProfile
-> AssociateDeviceWithNetworkProfile -> Bool
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]
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
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.
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'
{ $sel:deviceArn:AssociateDeviceWithNetworkProfile' :: Text
deviceArn =
Text
pDeviceArn_,
$sel:networkProfileArn:AssociateDeviceWithNetworkProfile' :: Text
networkProfileArn = Text
pNetworkProfileArn_
}
associateDeviceWithNetworkProfile_deviceArn :: Lens.Lens' AssociateDeviceWithNetworkProfile Prelude.Text
associateDeviceWithNetworkProfile_deviceArn :: Lens' AssociateDeviceWithNetworkProfile Text
associateDeviceWithNetworkProfile_deviceArn = 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 :: Lens' AssociateDeviceWithNetworkProfile Text
associateDeviceWithNetworkProfile_networkProfileArn = 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 :: (Service -> Service)
-> AssociateDeviceWithNetworkProfile
-> Request AssociateDeviceWithNetworkProfile
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 AssociateDeviceWithNetworkProfile
-> ClientResponse ClientBody
-> m (Either
Error
(ClientResponse (AWSResponse AssociateDeviceWithNetworkProfile)))
response =
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
( \Int
s ResponseHeaders
h ()
x ->
Int -> AssociateDeviceWithNetworkProfileResponse
AssociateDeviceWithNetworkProfileResponse'
forall (f :: * -> *) a b. Functor 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
AssociateDeviceWithNetworkProfile
where
hashWithSalt :: Int -> AssociateDeviceWithNetworkProfile -> Int
hashWithSalt
Int
_salt
AssociateDeviceWithNetworkProfile' {Text
networkProfileArn :: Text
deviceArn :: Text
$sel:networkProfileArn:AssociateDeviceWithNetworkProfile' :: AssociateDeviceWithNetworkProfile -> Text
$sel:deviceArn:AssociateDeviceWithNetworkProfile' :: AssociateDeviceWithNetworkProfile -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
deviceArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
networkProfileArn
instance
Prelude.NFData
AssociateDeviceWithNetworkProfile
where
rnf :: AssociateDeviceWithNetworkProfile -> ()
rnf AssociateDeviceWithNetworkProfile' {Text
networkProfileArn :: Text
deviceArn :: Text
$sel:networkProfileArn:AssociateDeviceWithNetworkProfile' :: AssociateDeviceWithNetworkProfile -> Text
$sel:deviceArn:AssociateDeviceWithNetworkProfile' :: AssociateDeviceWithNetworkProfile -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
deviceArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
networkProfileArn
instance
Data.ToHeaders
AssociateDeviceWithNetworkProfile
where
toHeaders :: AssociateDeviceWithNetworkProfile -> ResponseHeaders
toHeaders =
forall a b. a -> b -> a
Prelude.const
( forall a. Monoid a => [a] -> a
Prelude.mconcat
[ HeaderName
"X-Amz-Target"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"AlexaForBusiness.AssociateDeviceWithNetworkProfile" ::
Prelude.ByteString
),
HeaderName
"Content-Type"
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.1" ::
Prelude.ByteString
)
]
)
instance
Data.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
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"DeviceArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
deviceArn),
forall a. a -> Maybe a
Prelude.Just
(Key
"NetworkProfileArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
networkProfileArn)
]
)
instance
Data.ToPath
AssociateDeviceWithNetworkProfile
where
toPath :: AssociateDeviceWithNetworkProfile -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"
instance
Data.ToQuery
AssociateDeviceWithNetworkProfile
where
toQuery :: AssociateDeviceWithNetworkProfile -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty
data AssociateDeviceWithNetworkProfileResponse = AssociateDeviceWithNetworkProfileResponse'
{
AssociateDeviceWithNetworkProfileResponse -> Int
httpStatus :: Prelude.Int
}
deriving (AssociateDeviceWithNetworkProfileResponse
-> AssociateDeviceWithNetworkProfileResponse -> Bool
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]
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
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.
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'
{ $sel:httpStatus:AssociateDeviceWithNetworkProfileResponse' :: Int
httpStatus =
Int
pHttpStatus_
}
associateDeviceWithNetworkProfileResponse_httpStatus :: Lens.Lens' AssociateDeviceWithNetworkProfileResponse Prelude.Int
associateDeviceWithNetworkProfileResponse_httpStatus :: Lens' AssociateDeviceWithNetworkProfileResponse Int
associateDeviceWithNetworkProfileResponse_httpStatus = 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
where
rnf :: AssociateDeviceWithNetworkProfileResponse -> ()
rnf AssociateDeviceWithNetworkProfileResponse' {Int
httpStatus :: Int
$sel:httpStatus:AssociateDeviceWithNetworkProfileResponse' :: AssociateDeviceWithNetworkProfileResponse -> Int
..} =
forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus