{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.IoTWireless.CreateWirelessDevice
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Provisions a wireless device.
module Amazonka.IoTWireless.CreateWirelessDevice
  ( -- * Creating a Request
    CreateWirelessDevice (..),
    newCreateWirelessDevice,

    -- * Request Lenses
    createWirelessDevice_loRaWAN,
    createWirelessDevice_name,
    createWirelessDevice_clientRequestToken,
    createWirelessDevice_description,
    createWirelessDevice_tags,
    createWirelessDevice_type,
    createWirelessDevice_destinationName,

    -- * Destructuring the Response
    CreateWirelessDeviceResponse (..),
    newCreateWirelessDeviceResponse,

    -- * Response Lenses
    createWirelessDeviceResponse_arn,
    createWirelessDeviceResponse_id,
    createWirelessDeviceResponse_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

-- | /See:/ 'newCreateWirelessDevice' smart constructor.
data CreateWirelessDevice = CreateWirelessDevice'
  { -- | The device configuration information to use to create the wireless
    -- device.
    CreateWirelessDevice -> Maybe LoRaWANDevice
loRaWAN :: Prelude.Maybe LoRaWANDevice,
    -- | The name of the new resource.
    CreateWirelessDevice -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | Each resource must have a unique client request token. If you try to
    -- create a new resource with the same token as a resource that already
    -- exists, an exception occurs. If you omit this value, AWS SDKs will
    -- automatically generate a unique client request.
    CreateWirelessDevice -> Maybe Text
clientRequestToken :: Prelude.Maybe Prelude.Text,
    -- | The description of the new resource.
    CreateWirelessDevice -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The tags to attach to the new wireless device. Tags are metadata that
    -- you can use to manage a resource.
    CreateWirelessDevice -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The wireless device type.
    CreateWirelessDevice -> WirelessDeviceType
type' :: WirelessDeviceType,
    -- | The name of the destination to assign to the new wireless device.
    CreateWirelessDevice -> Text
destinationName :: Prelude.Text
  }
  deriving (CreateWirelessDevice -> CreateWirelessDevice -> Bool
(CreateWirelessDevice -> CreateWirelessDevice -> Bool)
-> (CreateWirelessDevice -> CreateWirelessDevice -> Bool)
-> Eq CreateWirelessDevice
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateWirelessDevice -> CreateWirelessDevice -> Bool
$c/= :: CreateWirelessDevice -> CreateWirelessDevice -> Bool
== :: CreateWirelessDevice -> CreateWirelessDevice -> Bool
$c== :: CreateWirelessDevice -> CreateWirelessDevice -> Bool
Prelude.Eq, ReadPrec [CreateWirelessDevice]
ReadPrec CreateWirelessDevice
Int -> ReadS CreateWirelessDevice
ReadS [CreateWirelessDevice]
(Int -> ReadS CreateWirelessDevice)
-> ReadS [CreateWirelessDevice]
-> ReadPrec CreateWirelessDevice
-> ReadPrec [CreateWirelessDevice]
-> Read CreateWirelessDevice
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateWirelessDevice]
$creadListPrec :: ReadPrec [CreateWirelessDevice]
readPrec :: ReadPrec CreateWirelessDevice
$creadPrec :: ReadPrec CreateWirelessDevice
readList :: ReadS [CreateWirelessDevice]
$creadList :: ReadS [CreateWirelessDevice]
readsPrec :: Int -> ReadS CreateWirelessDevice
$creadsPrec :: Int -> ReadS CreateWirelessDevice
Prelude.Read, Int -> CreateWirelessDevice -> ShowS
[CreateWirelessDevice] -> ShowS
CreateWirelessDevice -> String
(Int -> CreateWirelessDevice -> ShowS)
-> (CreateWirelessDevice -> String)
-> ([CreateWirelessDevice] -> ShowS)
-> Show CreateWirelessDevice
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateWirelessDevice] -> ShowS
$cshowList :: [CreateWirelessDevice] -> ShowS
show :: CreateWirelessDevice -> String
$cshow :: CreateWirelessDevice -> String
showsPrec :: Int -> CreateWirelessDevice -> ShowS
$cshowsPrec :: Int -> CreateWirelessDevice -> ShowS
Prelude.Show, (forall x. CreateWirelessDevice -> Rep CreateWirelessDevice x)
-> (forall x. Rep CreateWirelessDevice x -> CreateWirelessDevice)
-> Generic CreateWirelessDevice
forall x. Rep CreateWirelessDevice x -> CreateWirelessDevice
forall x. CreateWirelessDevice -> Rep CreateWirelessDevice x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep CreateWirelessDevice x -> CreateWirelessDevice
$cfrom :: forall x. CreateWirelessDevice -> Rep CreateWirelessDevice x
Prelude.Generic)

-- |
-- Create a value of 'CreateWirelessDevice' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'loRaWAN', 'createWirelessDevice_loRaWAN' - The device configuration information to use to create the wireless
-- device.
--
-- 'name', 'createWirelessDevice_name' - The name of the new resource.
--
-- 'clientRequestToken', 'createWirelessDevice_clientRequestToken' - Each resource must have a unique client request token. If you try to
-- create a new resource with the same token as a resource that already
-- exists, an exception occurs. If you omit this value, AWS SDKs will
-- automatically generate a unique client request.
--
-- 'description', 'createWirelessDevice_description' - The description of the new resource.
--
-- 'tags', 'createWirelessDevice_tags' - The tags to attach to the new wireless device. Tags are metadata that
-- you can use to manage a resource.
--
-- 'type'', 'createWirelessDevice_type' - The wireless device type.
--
-- 'destinationName', 'createWirelessDevice_destinationName' - The name of the destination to assign to the new wireless device.
newCreateWirelessDevice ::
  -- | 'type''
  WirelessDeviceType ->
  -- | 'destinationName'
  Prelude.Text ->
  CreateWirelessDevice
newCreateWirelessDevice :: WirelessDeviceType -> Text -> CreateWirelessDevice
newCreateWirelessDevice WirelessDeviceType
pType_ Text
pDestinationName_ =
  CreateWirelessDevice' :: Maybe LoRaWANDevice
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe [Tag]
-> WirelessDeviceType
-> Text
-> CreateWirelessDevice
CreateWirelessDevice'
    { $sel:loRaWAN:CreateWirelessDevice' :: Maybe LoRaWANDevice
loRaWAN = Maybe LoRaWANDevice
forall a. Maybe a
Prelude.Nothing,
      $sel:name:CreateWirelessDevice' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:clientRequestToken:CreateWirelessDevice' :: Maybe Text
clientRequestToken = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:CreateWirelessDevice' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:tags:CreateWirelessDevice' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
      $sel:type':CreateWirelessDevice' :: WirelessDeviceType
type' = WirelessDeviceType
pType_,
      $sel:destinationName:CreateWirelessDevice' :: Text
destinationName = Text
pDestinationName_
    }

-- | The device configuration information to use to create the wireless
-- device.
createWirelessDevice_loRaWAN :: Lens.Lens' CreateWirelessDevice (Prelude.Maybe LoRaWANDevice)
createWirelessDevice_loRaWAN :: (Maybe LoRaWANDevice -> f (Maybe LoRaWANDevice))
-> CreateWirelessDevice -> f CreateWirelessDevice
createWirelessDevice_loRaWAN = (CreateWirelessDevice -> Maybe LoRaWANDevice)
-> (CreateWirelessDevice
    -> Maybe LoRaWANDevice -> CreateWirelessDevice)
-> Lens
     CreateWirelessDevice
     CreateWirelessDevice
     (Maybe LoRaWANDevice)
     (Maybe LoRaWANDevice)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWirelessDevice' {Maybe LoRaWANDevice
loRaWAN :: Maybe LoRaWANDevice
$sel:loRaWAN:CreateWirelessDevice' :: CreateWirelessDevice -> Maybe LoRaWANDevice
loRaWAN} -> Maybe LoRaWANDevice
loRaWAN) (\s :: CreateWirelessDevice
s@CreateWirelessDevice' {} Maybe LoRaWANDevice
a -> CreateWirelessDevice
s {$sel:loRaWAN:CreateWirelessDevice' :: Maybe LoRaWANDevice
loRaWAN = Maybe LoRaWANDevice
a} :: CreateWirelessDevice)

-- | The name of the new resource.
createWirelessDevice_name :: Lens.Lens' CreateWirelessDevice (Prelude.Maybe Prelude.Text)
createWirelessDevice_name :: (Maybe Text -> f (Maybe Text))
-> CreateWirelessDevice -> f CreateWirelessDevice
createWirelessDevice_name = (CreateWirelessDevice -> Maybe Text)
-> (CreateWirelessDevice -> Maybe Text -> CreateWirelessDevice)
-> Lens
     CreateWirelessDevice CreateWirelessDevice (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWirelessDevice' {Maybe Text
name :: Maybe Text
$sel:name:CreateWirelessDevice' :: CreateWirelessDevice -> Maybe Text
name} -> Maybe Text
name) (\s :: CreateWirelessDevice
s@CreateWirelessDevice' {} Maybe Text
a -> CreateWirelessDevice
s {$sel:name:CreateWirelessDevice' :: Maybe Text
name = Maybe Text
a} :: CreateWirelessDevice)

-- | Each resource must have a unique client request token. If you try to
-- create a new resource with the same token as a resource that already
-- exists, an exception occurs. If you omit this value, AWS SDKs will
-- automatically generate a unique client request.
createWirelessDevice_clientRequestToken :: Lens.Lens' CreateWirelessDevice (Prelude.Maybe Prelude.Text)
createWirelessDevice_clientRequestToken :: (Maybe Text -> f (Maybe Text))
-> CreateWirelessDevice -> f CreateWirelessDevice
createWirelessDevice_clientRequestToken = (CreateWirelessDevice -> Maybe Text)
-> (CreateWirelessDevice -> Maybe Text -> CreateWirelessDevice)
-> Lens
     CreateWirelessDevice CreateWirelessDevice (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWirelessDevice' {Maybe Text
clientRequestToken :: Maybe Text
$sel:clientRequestToken:CreateWirelessDevice' :: CreateWirelessDevice -> Maybe Text
clientRequestToken} -> Maybe Text
clientRequestToken) (\s :: CreateWirelessDevice
s@CreateWirelessDevice' {} Maybe Text
a -> CreateWirelessDevice
s {$sel:clientRequestToken:CreateWirelessDevice' :: Maybe Text
clientRequestToken = Maybe Text
a} :: CreateWirelessDevice)

-- | The description of the new resource.
createWirelessDevice_description :: Lens.Lens' CreateWirelessDevice (Prelude.Maybe Prelude.Text)
createWirelessDevice_description :: (Maybe Text -> f (Maybe Text))
-> CreateWirelessDevice -> f CreateWirelessDevice
createWirelessDevice_description = (CreateWirelessDevice -> Maybe Text)
-> (CreateWirelessDevice -> Maybe Text -> CreateWirelessDevice)
-> Lens
     CreateWirelessDevice CreateWirelessDevice (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWirelessDevice' {Maybe Text
description :: Maybe Text
$sel:description:CreateWirelessDevice' :: CreateWirelessDevice -> Maybe Text
description} -> Maybe Text
description) (\s :: CreateWirelessDevice
s@CreateWirelessDevice' {} Maybe Text
a -> CreateWirelessDevice
s {$sel:description:CreateWirelessDevice' :: Maybe Text
description = Maybe Text
a} :: CreateWirelessDevice)

-- | The tags to attach to the new wireless device. Tags are metadata that
-- you can use to manage a resource.
createWirelessDevice_tags :: Lens.Lens' CreateWirelessDevice (Prelude.Maybe [Tag])
createWirelessDevice_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateWirelessDevice -> f CreateWirelessDevice
createWirelessDevice_tags = (CreateWirelessDevice -> Maybe [Tag])
-> (CreateWirelessDevice -> Maybe [Tag] -> CreateWirelessDevice)
-> Lens
     CreateWirelessDevice
     CreateWirelessDevice
     (Maybe [Tag])
     (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWirelessDevice' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:CreateWirelessDevice' :: CreateWirelessDevice -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: CreateWirelessDevice
s@CreateWirelessDevice' {} Maybe [Tag]
a -> CreateWirelessDevice
s {$sel:tags:CreateWirelessDevice' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: CreateWirelessDevice) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> CreateWirelessDevice -> f CreateWirelessDevice)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> CreateWirelessDevice
-> f CreateWirelessDevice
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The wireless device type.
createWirelessDevice_type :: Lens.Lens' CreateWirelessDevice WirelessDeviceType
createWirelessDevice_type :: (WirelessDeviceType -> f WirelessDeviceType)
-> CreateWirelessDevice -> f CreateWirelessDevice
createWirelessDevice_type = (CreateWirelessDevice -> WirelessDeviceType)
-> (CreateWirelessDevice
    -> WirelessDeviceType -> CreateWirelessDevice)
-> Lens
     CreateWirelessDevice
     CreateWirelessDevice
     WirelessDeviceType
     WirelessDeviceType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWirelessDevice' {WirelessDeviceType
type' :: WirelessDeviceType
$sel:type':CreateWirelessDevice' :: CreateWirelessDevice -> WirelessDeviceType
type'} -> WirelessDeviceType
type') (\s :: CreateWirelessDevice
s@CreateWirelessDevice' {} WirelessDeviceType
a -> CreateWirelessDevice
s {$sel:type':CreateWirelessDevice' :: WirelessDeviceType
type' = WirelessDeviceType
a} :: CreateWirelessDevice)

-- | The name of the destination to assign to the new wireless device.
createWirelessDevice_destinationName :: Lens.Lens' CreateWirelessDevice Prelude.Text
createWirelessDevice_destinationName :: (Text -> f Text) -> CreateWirelessDevice -> f CreateWirelessDevice
createWirelessDevice_destinationName = (CreateWirelessDevice -> Text)
-> (CreateWirelessDevice -> Text -> CreateWirelessDevice)
-> Lens CreateWirelessDevice CreateWirelessDevice Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWirelessDevice' {Text
destinationName :: Text
$sel:destinationName:CreateWirelessDevice' :: CreateWirelessDevice -> Text
destinationName} -> Text
destinationName) (\s :: CreateWirelessDevice
s@CreateWirelessDevice' {} Text
a -> CreateWirelessDevice
s {$sel:destinationName:CreateWirelessDevice' :: Text
destinationName = Text
a} :: CreateWirelessDevice)

instance Core.AWSRequest CreateWirelessDevice where
  type
    AWSResponse CreateWirelessDevice =
      CreateWirelessDeviceResponse
  request :: CreateWirelessDevice -> Request CreateWirelessDevice
request = Service -> CreateWirelessDevice -> Request CreateWirelessDevice
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy CreateWirelessDevice
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateWirelessDevice)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse CreateWirelessDevice))
-> Logger
-> Service
-> Proxy CreateWirelessDevice
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse CreateWirelessDevice)))
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 -> Maybe Text -> Int -> CreateWirelessDeviceResponse
CreateWirelessDeviceResponse'
            (Maybe Text -> Maybe Text -> Int -> CreateWirelessDeviceResponse)
-> Either String (Maybe Text)
-> Either
     String (Maybe Text -> Int -> CreateWirelessDeviceResponse)
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
"Arn")
            Either String (Maybe Text -> Int -> CreateWirelessDeviceResponse)
-> Either String (Maybe Text)
-> Either String (Int -> CreateWirelessDeviceResponse)
forall (f :: * -> *) a b. Applicative f => 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
"Id")
            Either String (Int -> CreateWirelessDeviceResponse)
-> Either String Int -> Either String CreateWirelessDeviceResponse
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 CreateWirelessDevice

instance Prelude.NFData CreateWirelessDevice

instance Core.ToHeaders CreateWirelessDevice where
  toHeaders :: CreateWirelessDevice -> ResponseHeaders
toHeaders = ResponseHeaders -> CreateWirelessDevice -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToJSON CreateWirelessDevice where
  toJSON :: CreateWirelessDevice -> Value
toJSON CreateWirelessDevice' {Maybe [Tag]
Maybe Text
Maybe LoRaWANDevice
Text
WirelessDeviceType
destinationName :: Text
type' :: WirelessDeviceType
tags :: Maybe [Tag]
description :: Maybe Text
clientRequestToken :: Maybe Text
name :: Maybe Text
loRaWAN :: Maybe LoRaWANDevice
$sel:destinationName:CreateWirelessDevice' :: CreateWirelessDevice -> Text
$sel:type':CreateWirelessDevice' :: CreateWirelessDevice -> WirelessDeviceType
$sel:tags:CreateWirelessDevice' :: CreateWirelessDevice -> Maybe [Tag]
$sel:description:CreateWirelessDevice' :: CreateWirelessDevice -> Maybe Text
$sel:clientRequestToken:CreateWirelessDevice' :: CreateWirelessDevice -> Maybe Text
$sel:name:CreateWirelessDevice' :: CreateWirelessDevice -> Maybe Text
$sel:loRaWAN:CreateWirelessDevice' :: CreateWirelessDevice -> Maybe LoRaWANDevice
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"LoRaWAN" Text -> LoRaWANDevice -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (LoRaWANDevice -> Pair) -> Maybe LoRaWANDevice -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe LoRaWANDevice
loRaWAN,
            (Text
"Name" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
name,
            (Text
"ClientRequestToken" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
clientRequestToken,
            (Text
"Description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Text
"Tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"Type" Text -> WirelessDeviceType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= WirelessDeviceType
type'),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"DestinationName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
destinationName)
          ]
      )

instance Core.ToPath CreateWirelessDevice where
  toPath :: CreateWirelessDevice -> ByteString
toPath = ByteString -> CreateWirelessDevice -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/wireless-devices"

instance Core.ToQuery CreateWirelessDevice where
  toQuery :: CreateWirelessDevice -> QueryString
toQuery = QueryString -> CreateWirelessDevice -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newCreateWirelessDeviceResponse' smart constructor.
data CreateWirelessDeviceResponse = CreateWirelessDeviceResponse'
  { -- | The Amazon Resource Name of the new resource.
    CreateWirelessDeviceResponse -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | The ID of the new wireless device.
    CreateWirelessDeviceResponse -> Maybe Text
id :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    CreateWirelessDeviceResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (CreateWirelessDeviceResponse
-> CreateWirelessDeviceResponse -> Bool
(CreateWirelessDeviceResponse
 -> CreateWirelessDeviceResponse -> Bool)
-> (CreateWirelessDeviceResponse
    -> CreateWirelessDeviceResponse -> Bool)
-> Eq CreateWirelessDeviceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateWirelessDeviceResponse
-> CreateWirelessDeviceResponse -> Bool
$c/= :: CreateWirelessDeviceResponse
-> CreateWirelessDeviceResponse -> Bool
== :: CreateWirelessDeviceResponse
-> CreateWirelessDeviceResponse -> Bool
$c== :: CreateWirelessDeviceResponse
-> CreateWirelessDeviceResponse -> Bool
Prelude.Eq, ReadPrec [CreateWirelessDeviceResponse]
ReadPrec CreateWirelessDeviceResponse
Int -> ReadS CreateWirelessDeviceResponse
ReadS [CreateWirelessDeviceResponse]
(Int -> ReadS CreateWirelessDeviceResponse)
-> ReadS [CreateWirelessDeviceResponse]
-> ReadPrec CreateWirelessDeviceResponse
-> ReadPrec [CreateWirelessDeviceResponse]
-> Read CreateWirelessDeviceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateWirelessDeviceResponse]
$creadListPrec :: ReadPrec [CreateWirelessDeviceResponse]
readPrec :: ReadPrec CreateWirelessDeviceResponse
$creadPrec :: ReadPrec CreateWirelessDeviceResponse
readList :: ReadS [CreateWirelessDeviceResponse]
$creadList :: ReadS [CreateWirelessDeviceResponse]
readsPrec :: Int -> ReadS CreateWirelessDeviceResponse
$creadsPrec :: Int -> ReadS CreateWirelessDeviceResponse
Prelude.Read, Int -> CreateWirelessDeviceResponse -> ShowS
[CreateWirelessDeviceResponse] -> ShowS
CreateWirelessDeviceResponse -> String
(Int -> CreateWirelessDeviceResponse -> ShowS)
-> (CreateWirelessDeviceResponse -> String)
-> ([CreateWirelessDeviceResponse] -> ShowS)
-> Show CreateWirelessDeviceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateWirelessDeviceResponse] -> ShowS
$cshowList :: [CreateWirelessDeviceResponse] -> ShowS
show :: CreateWirelessDeviceResponse -> String
$cshow :: CreateWirelessDeviceResponse -> String
showsPrec :: Int -> CreateWirelessDeviceResponse -> ShowS
$cshowsPrec :: Int -> CreateWirelessDeviceResponse -> ShowS
Prelude.Show, (forall x.
 CreateWirelessDeviceResponse -> Rep CreateWirelessDeviceResponse x)
-> (forall x.
    Rep CreateWirelessDeviceResponse x -> CreateWirelessDeviceResponse)
-> Generic CreateWirelessDeviceResponse
forall x.
Rep CreateWirelessDeviceResponse x -> CreateWirelessDeviceResponse
forall x.
CreateWirelessDeviceResponse -> Rep CreateWirelessDeviceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateWirelessDeviceResponse x -> CreateWirelessDeviceResponse
$cfrom :: forall x.
CreateWirelessDeviceResponse -> Rep CreateWirelessDeviceResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateWirelessDeviceResponse' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'arn', 'createWirelessDeviceResponse_arn' - The Amazon Resource Name of the new resource.
--
-- 'id', 'createWirelessDeviceResponse_id' - The ID of the new wireless device.
--
-- 'httpStatus', 'createWirelessDeviceResponse_httpStatus' - The response's http status code.
newCreateWirelessDeviceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  CreateWirelessDeviceResponse
newCreateWirelessDeviceResponse :: Int -> CreateWirelessDeviceResponse
newCreateWirelessDeviceResponse Int
pHttpStatus_ =
  CreateWirelessDeviceResponse' :: Maybe Text -> Maybe Text -> Int -> CreateWirelessDeviceResponse
CreateWirelessDeviceResponse'
    { $sel:arn:CreateWirelessDeviceResponse' :: Maybe Text
arn =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:CreateWirelessDeviceResponse' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:CreateWirelessDeviceResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The Amazon Resource Name of the new resource.
createWirelessDeviceResponse_arn :: Lens.Lens' CreateWirelessDeviceResponse (Prelude.Maybe Prelude.Text)
createWirelessDeviceResponse_arn :: (Maybe Text -> f (Maybe Text))
-> CreateWirelessDeviceResponse -> f CreateWirelessDeviceResponse
createWirelessDeviceResponse_arn = (CreateWirelessDeviceResponse -> Maybe Text)
-> (CreateWirelessDeviceResponse
    -> Maybe Text -> CreateWirelessDeviceResponse)
-> Lens
     CreateWirelessDeviceResponse
     CreateWirelessDeviceResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWirelessDeviceResponse' {Maybe Text
arn :: Maybe Text
$sel:arn:CreateWirelessDeviceResponse' :: CreateWirelessDeviceResponse -> Maybe Text
arn} -> Maybe Text
arn) (\s :: CreateWirelessDeviceResponse
s@CreateWirelessDeviceResponse' {} Maybe Text
a -> CreateWirelessDeviceResponse
s {$sel:arn:CreateWirelessDeviceResponse' :: Maybe Text
arn = Maybe Text
a} :: CreateWirelessDeviceResponse)

-- | The ID of the new wireless device.
createWirelessDeviceResponse_id :: Lens.Lens' CreateWirelessDeviceResponse (Prelude.Maybe Prelude.Text)
createWirelessDeviceResponse_id :: (Maybe Text -> f (Maybe Text))
-> CreateWirelessDeviceResponse -> f CreateWirelessDeviceResponse
createWirelessDeviceResponse_id = (CreateWirelessDeviceResponse -> Maybe Text)
-> (CreateWirelessDeviceResponse
    -> Maybe Text -> CreateWirelessDeviceResponse)
-> Lens
     CreateWirelessDeviceResponse
     CreateWirelessDeviceResponse
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWirelessDeviceResponse' {Maybe Text
id :: Maybe Text
$sel:id:CreateWirelessDeviceResponse' :: CreateWirelessDeviceResponse -> Maybe Text
id} -> Maybe Text
id) (\s :: CreateWirelessDeviceResponse
s@CreateWirelessDeviceResponse' {} Maybe Text
a -> CreateWirelessDeviceResponse
s {$sel:id:CreateWirelessDeviceResponse' :: Maybe Text
id = Maybe Text
a} :: CreateWirelessDeviceResponse)

-- | The response's http status code.
createWirelessDeviceResponse_httpStatus :: Lens.Lens' CreateWirelessDeviceResponse Prelude.Int
createWirelessDeviceResponse_httpStatus :: (Int -> f Int)
-> CreateWirelessDeviceResponse -> f CreateWirelessDeviceResponse
createWirelessDeviceResponse_httpStatus = (CreateWirelessDeviceResponse -> Int)
-> (CreateWirelessDeviceResponse
    -> Int -> CreateWirelessDeviceResponse)
-> Lens
     CreateWirelessDeviceResponse CreateWirelessDeviceResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateWirelessDeviceResponse' {Int
httpStatus :: Int
$sel:httpStatus:CreateWirelessDeviceResponse' :: CreateWirelessDeviceResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: CreateWirelessDeviceResponse
s@CreateWirelessDeviceResponse' {} Int
a -> CreateWirelessDeviceResponse
s {$sel:httpStatus:CreateWirelessDeviceResponse' :: Int
httpStatus = Int
a} :: CreateWirelessDeviceResponse)

instance Prelude.NFData CreateWirelessDeviceResponse