{-# 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.NetworkManager.UpdateDevice
-- 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)
--
-- Updates the details for an existing device. To remove information for
-- any of the parameters, specify an empty string.
module Amazonka.NetworkManager.UpdateDevice
  ( -- * Creating a Request
    UpdateDevice (..),
    newUpdateDevice,

    -- * Request Lenses
    updateDevice_vendor,
    updateDevice_location,
    updateDevice_aWSLocation,
    updateDevice_model,
    updateDevice_type,
    updateDevice_serialNumber,
    updateDevice_siteId,
    updateDevice_description,
    updateDevice_globalNetworkId,
    updateDevice_deviceId,

    -- * Destructuring the Response
    UpdateDeviceResponse (..),
    newUpdateDeviceResponse,

    -- * Response Lenses
    updateDeviceResponse_device,
    updateDeviceResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.NetworkManager.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newUpdateDevice' smart constructor.
data UpdateDevice = UpdateDevice'
  { -- | The vendor of the device.
    --
    -- Length Constraints: Maximum length of 128 characters.
    UpdateDevice -> Maybe Text
vendor :: Prelude.Maybe Prelude.Text,
    UpdateDevice -> Maybe (Sensitive Location)
location :: Prelude.Maybe (Core.Sensitive Location),
    -- | The AWS location of the device.
    UpdateDevice -> Maybe AWSLocation
aWSLocation :: Prelude.Maybe AWSLocation,
    -- | The model of the device.
    --
    -- Length Constraints: Maximum length of 128 characters.
    UpdateDevice -> Maybe Text
model :: Prelude.Maybe Prelude.Text,
    -- | The type of the device.
    UpdateDevice -> Maybe Text
type' :: Prelude.Maybe Prelude.Text,
    -- | The serial number of the device.
    --
    -- Length Constraints: Maximum length of 128 characters.
    UpdateDevice -> Maybe Text
serialNumber :: Prelude.Maybe Prelude.Text,
    -- | The ID of the site.
    UpdateDevice -> Maybe Text
siteId :: Prelude.Maybe Prelude.Text,
    -- | A description of the device.
    --
    -- Length Constraints: Maximum length of 256 characters.
    UpdateDevice -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The ID of the global network.
    UpdateDevice -> Text
globalNetworkId :: Prelude.Text,
    -- | The ID of the device.
    UpdateDevice -> Text
deviceId :: Prelude.Text
  }
  deriving (UpdateDevice -> UpdateDevice -> Bool
(UpdateDevice -> UpdateDevice -> Bool)
-> (UpdateDevice -> UpdateDevice -> Bool) -> Eq UpdateDevice
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDevice -> UpdateDevice -> Bool
$c/= :: UpdateDevice -> UpdateDevice -> Bool
== :: UpdateDevice -> UpdateDevice -> Bool
$c== :: UpdateDevice -> UpdateDevice -> Bool
Prelude.Eq, Int -> UpdateDevice -> ShowS
[UpdateDevice] -> ShowS
UpdateDevice -> String
(Int -> UpdateDevice -> ShowS)
-> (UpdateDevice -> String)
-> ([UpdateDevice] -> ShowS)
-> Show UpdateDevice
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDevice] -> ShowS
$cshowList :: [UpdateDevice] -> ShowS
show :: UpdateDevice -> String
$cshow :: UpdateDevice -> String
showsPrec :: Int -> UpdateDevice -> ShowS
$cshowsPrec :: Int -> UpdateDevice -> ShowS
Prelude.Show, (forall x. UpdateDevice -> Rep UpdateDevice x)
-> (forall x. Rep UpdateDevice x -> UpdateDevice)
-> Generic UpdateDevice
forall x. Rep UpdateDevice x -> UpdateDevice
forall x. UpdateDevice -> Rep UpdateDevice x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateDevice x -> UpdateDevice
$cfrom :: forall x. UpdateDevice -> Rep UpdateDevice x
Prelude.Generic)

-- |
-- Create a value of 'UpdateDevice' 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:
--
-- 'vendor', 'updateDevice_vendor' - The vendor of the device.
--
-- Length Constraints: Maximum length of 128 characters.
--
-- 'location', 'updateDevice_location' - Undocumented member.
--
-- 'aWSLocation', 'updateDevice_aWSLocation' - The AWS location of the device.
--
-- 'model', 'updateDevice_model' - The model of the device.
--
-- Length Constraints: Maximum length of 128 characters.
--
-- 'type'', 'updateDevice_type' - The type of the device.
--
-- 'serialNumber', 'updateDevice_serialNumber' - The serial number of the device.
--
-- Length Constraints: Maximum length of 128 characters.
--
-- 'siteId', 'updateDevice_siteId' - The ID of the site.
--
-- 'description', 'updateDevice_description' - A description of the device.
--
-- Length Constraints: Maximum length of 256 characters.
--
-- 'globalNetworkId', 'updateDevice_globalNetworkId' - The ID of the global network.
--
-- 'deviceId', 'updateDevice_deviceId' - The ID of the device.
newUpdateDevice ::
  -- | 'globalNetworkId'
  Prelude.Text ->
  -- | 'deviceId'
  Prelude.Text ->
  UpdateDevice
newUpdateDevice :: Text -> Text -> UpdateDevice
newUpdateDevice Text
pGlobalNetworkId_ Text
pDeviceId_ =
  UpdateDevice' :: Maybe Text
-> Maybe (Sensitive Location)
-> Maybe AWSLocation
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> Text
-> Text
-> UpdateDevice
UpdateDevice'
    { $sel:vendor:UpdateDevice' :: Maybe Text
vendor = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:location:UpdateDevice' :: Maybe (Sensitive Location)
location = Maybe (Sensitive Location)
forall a. Maybe a
Prelude.Nothing,
      $sel:aWSLocation:UpdateDevice' :: Maybe AWSLocation
aWSLocation = Maybe AWSLocation
forall a. Maybe a
Prelude.Nothing,
      $sel:model:UpdateDevice' :: Maybe Text
model = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:type':UpdateDevice' :: Maybe Text
type' = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:serialNumber:UpdateDevice' :: Maybe Text
serialNumber = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:siteId:UpdateDevice' :: Maybe Text
siteId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateDevice' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:globalNetworkId:UpdateDevice' :: Text
globalNetworkId = Text
pGlobalNetworkId_,
      $sel:deviceId:UpdateDevice' :: Text
deviceId = Text
pDeviceId_
    }

-- | The vendor of the device.
--
-- Length Constraints: Maximum length of 128 characters.
updateDevice_vendor :: Lens.Lens' UpdateDevice (Prelude.Maybe Prelude.Text)
updateDevice_vendor :: (Maybe Text -> f (Maybe Text)) -> UpdateDevice -> f UpdateDevice
updateDevice_vendor = (UpdateDevice -> Maybe Text)
-> (UpdateDevice -> Maybe Text -> UpdateDevice)
-> Lens UpdateDevice UpdateDevice (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDevice' {Maybe Text
vendor :: Maybe Text
$sel:vendor:UpdateDevice' :: UpdateDevice -> Maybe Text
vendor} -> Maybe Text
vendor) (\s :: UpdateDevice
s@UpdateDevice' {} Maybe Text
a -> UpdateDevice
s {$sel:vendor:UpdateDevice' :: Maybe Text
vendor = Maybe Text
a} :: UpdateDevice)

-- | Undocumented member.
updateDevice_location :: Lens.Lens' UpdateDevice (Prelude.Maybe Location)
updateDevice_location :: (Maybe Location -> f (Maybe Location))
-> UpdateDevice -> f UpdateDevice
updateDevice_location = (UpdateDevice -> Maybe (Sensitive Location))
-> (UpdateDevice -> Maybe (Sensitive Location) -> UpdateDevice)
-> Lens
     UpdateDevice
     UpdateDevice
     (Maybe (Sensitive Location))
     (Maybe (Sensitive Location))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDevice' {Maybe (Sensitive Location)
location :: Maybe (Sensitive Location)
$sel:location:UpdateDevice' :: UpdateDevice -> Maybe (Sensitive Location)
location} -> Maybe (Sensitive Location)
location) (\s :: UpdateDevice
s@UpdateDevice' {} Maybe (Sensitive Location)
a -> UpdateDevice
s {$sel:location:UpdateDevice' :: Maybe (Sensitive Location)
location = Maybe (Sensitive Location)
a} :: UpdateDevice) ((Maybe (Sensitive Location) -> f (Maybe (Sensitive Location)))
 -> UpdateDevice -> f UpdateDevice)
-> ((Maybe Location -> f (Maybe Location))
    -> Maybe (Sensitive Location) -> f (Maybe (Sensitive Location)))
-> (Maybe Location -> f (Maybe Location))
-> UpdateDevice
-> f UpdateDevice
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (Sensitive Location) (Sensitive Location) Location Location
-> Iso
     (Maybe (Sensitive Location))
     (Maybe (Sensitive Location))
     (Maybe Location)
     (Maybe Location)
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 (Sensitive Location) (Sensitive Location) Location Location
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The AWS location of the device.
updateDevice_aWSLocation :: Lens.Lens' UpdateDevice (Prelude.Maybe AWSLocation)
updateDevice_aWSLocation :: (Maybe AWSLocation -> f (Maybe AWSLocation))
-> UpdateDevice -> f UpdateDevice
updateDevice_aWSLocation = (UpdateDevice -> Maybe AWSLocation)
-> (UpdateDevice -> Maybe AWSLocation -> UpdateDevice)
-> Lens
     UpdateDevice UpdateDevice (Maybe AWSLocation) (Maybe AWSLocation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDevice' {Maybe AWSLocation
aWSLocation :: Maybe AWSLocation
$sel:aWSLocation:UpdateDevice' :: UpdateDevice -> Maybe AWSLocation
aWSLocation} -> Maybe AWSLocation
aWSLocation) (\s :: UpdateDevice
s@UpdateDevice' {} Maybe AWSLocation
a -> UpdateDevice
s {$sel:aWSLocation:UpdateDevice' :: Maybe AWSLocation
aWSLocation = Maybe AWSLocation
a} :: UpdateDevice)

-- | The model of the device.
--
-- Length Constraints: Maximum length of 128 characters.
updateDevice_model :: Lens.Lens' UpdateDevice (Prelude.Maybe Prelude.Text)
updateDevice_model :: (Maybe Text -> f (Maybe Text)) -> UpdateDevice -> f UpdateDevice
updateDevice_model = (UpdateDevice -> Maybe Text)
-> (UpdateDevice -> Maybe Text -> UpdateDevice)
-> Lens UpdateDevice UpdateDevice (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDevice' {Maybe Text
model :: Maybe Text
$sel:model:UpdateDevice' :: UpdateDevice -> Maybe Text
model} -> Maybe Text
model) (\s :: UpdateDevice
s@UpdateDevice' {} Maybe Text
a -> UpdateDevice
s {$sel:model:UpdateDevice' :: Maybe Text
model = Maybe Text
a} :: UpdateDevice)

-- | The type of the device.
updateDevice_type :: Lens.Lens' UpdateDevice (Prelude.Maybe Prelude.Text)
updateDevice_type :: (Maybe Text -> f (Maybe Text)) -> UpdateDevice -> f UpdateDevice
updateDevice_type = (UpdateDevice -> Maybe Text)
-> (UpdateDevice -> Maybe Text -> UpdateDevice)
-> Lens UpdateDevice UpdateDevice (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDevice' {Maybe Text
type' :: Maybe Text
$sel:type':UpdateDevice' :: UpdateDevice -> Maybe Text
type'} -> Maybe Text
type') (\s :: UpdateDevice
s@UpdateDevice' {} Maybe Text
a -> UpdateDevice
s {$sel:type':UpdateDevice' :: Maybe Text
type' = Maybe Text
a} :: UpdateDevice)

-- | The serial number of the device.
--
-- Length Constraints: Maximum length of 128 characters.
updateDevice_serialNumber :: Lens.Lens' UpdateDevice (Prelude.Maybe Prelude.Text)
updateDevice_serialNumber :: (Maybe Text -> f (Maybe Text)) -> UpdateDevice -> f UpdateDevice
updateDevice_serialNumber = (UpdateDevice -> Maybe Text)
-> (UpdateDevice -> Maybe Text -> UpdateDevice)
-> Lens UpdateDevice UpdateDevice (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDevice' {Maybe Text
serialNumber :: Maybe Text
$sel:serialNumber:UpdateDevice' :: UpdateDevice -> Maybe Text
serialNumber} -> Maybe Text
serialNumber) (\s :: UpdateDevice
s@UpdateDevice' {} Maybe Text
a -> UpdateDevice
s {$sel:serialNumber:UpdateDevice' :: Maybe Text
serialNumber = Maybe Text
a} :: UpdateDevice)

-- | The ID of the site.
updateDevice_siteId :: Lens.Lens' UpdateDevice (Prelude.Maybe Prelude.Text)
updateDevice_siteId :: (Maybe Text -> f (Maybe Text)) -> UpdateDevice -> f UpdateDevice
updateDevice_siteId = (UpdateDevice -> Maybe Text)
-> (UpdateDevice -> Maybe Text -> UpdateDevice)
-> Lens UpdateDevice UpdateDevice (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDevice' {Maybe Text
siteId :: Maybe Text
$sel:siteId:UpdateDevice' :: UpdateDevice -> Maybe Text
siteId} -> Maybe Text
siteId) (\s :: UpdateDevice
s@UpdateDevice' {} Maybe Text
a -> UpdateDevice
s {$sel:siteId:UpdateDevice' :: Maybe Text
siteId = Maybe Text
a} :: UpdateDevice)

-- | A description of the device.
--
-- Length Constraints: Maximum length of 256 characters.
updateDevice_description :: Lens.Lens' UpdateDevice (Prelude.Maybe Prelude.Text)
updateDevice_description :: (Maybe Text -> f (Maybe Text)) -> UpdateDevice -> f UpdateDevice
updateDevice_description = (UpdateDevice -> Maybe Text)
-> (UpdateDevice -> Maybe Text -> UpdateDevice)
-> Lens UpdateDevice UpdateDevice (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDevice' {Maybe Text
description :: Maybe Text
$sel:description:UpdateDevice' :: UpdateDevice -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateDevice
s@UpdateDevice' {} Maybe Text
a -> UpdateDevice
s {$sel:description:UpdateDevice' :: Maybe Text
description = Maybe Text
a} :: UpdateDevice)

-- | The ID of the global network.
updateDevice_globalNetworkId :: Lens.Lens' UpdateDevice Prelude.Text
updateDevice_globalNetworkId :: (Text -> f Text) -> UpdateDevice -> f UpdateDevice
updateDevice_globalNetworkId = (UpdateDevice -> Text)
-> (UpdateDevice -> Text -> UpdateDevice)
-> Lens UpdateDevice UpdateDevice Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDevice' {Text
globalNetworkId :: Text
$sel:globalNetworkId:UpdateDevice' :: UpdateDevice -> Text
globalNetworkId} -> Text
globalNetworkId) (\s :: UpdateDevice
s@UpdateDevice' {} Text
a -> UpdateDevice
s {$sel:globalNetworkId:UpdateDevice' :: Text
globalNetworkId = Text
a} :: UpdateDevice)

-- | The ID of the device.
updateDevice_deviceId :: Lens.Lens' UpdateDevice Prelude.Text
updateDevice_deviceId :: (Text -> f Text) -> UpdateDevice -> f UpdateDevice
updateDevice_deviceId = (UpdateDevice -> Text)
-> (UpdateDevice -> Text -> UpdateDevice)
-> Lens UpdateDevice UpdateDevice Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDevice' {Text
deviceId :: Text
$sel:deviceId:UpdateDevice' :: UpdateDevice -> Text
deviceId} -> Text
deviceId) (\s :: UpdateDevice
s@UpdateDevice' {} Text
a -> UpdateDevice
s {$sel:deviceId:UpdateDevice' :: Text
deviceId = Text
a} :: UpdateDevice)

instance Core.AWSRequest UpdateDevice where
  type AWSResponse UpdateDevice = UpdateDeviceResponse
  request :: UpdateDevice -> Request UpdateDevice
request = Service -> UpdateDevice -> Request UpdateDevice
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateDevice
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateDevice)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateDevice))
-> Logger
-> Service
-> Proxy UpdateDevice
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateDevice)))
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 Device -> Int -> UpdateDeviceResponse
UpdateDeviceResponse'
            (Maybe Device -> Int -> UpdateDeviceResponse)
-> Either String (Maybe Device)
-> Either String (Int -> UpdateDeviceResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Device)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Device")
            Either String (Int -> UpdateDeviceResponse)
-> Either String Int -> Either String UpdateDeviceResponse
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 UpdateDevice

instance Prelude.NFData UpdateDevice

instance Core.ToHeaders UpdateDevice where
  toHeaders :: UpdateDevice -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateDevice -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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 UpdateDevice where
  toJSON :: UpdateDevice -> Value
toJSON UpdateDevice' {Maybe Text
Maybe (Sensitive Location)
Maybe AWSLocation
Text
deviceId :: Text
globalNetworkId :: Text
description :: Maybe Text
siteId :: Maybe Text
serialNumber :: Maybe Text
type' :: Maybe Text
model :: Maybe Text
aWSLocation :: Maybe AWSLocation
location :: Maybe (Sensitive Location)
vendor :: Maybe Text
$sel:deviceId:UpdateDevice' :: UpdateDevice -> Text
$sel:globalNetworkId:UpdateDevice' :: UpdateDevice -> Text
$sel:description:UpdateDevice' :: UpdateDevice -> Maybe Text
$sel:siteId:UpdateDevice' :: UpdateDevice -> Maybe Text
$sel:serialNumber:UpdateDevice' :: UpdateDevice -> Maybe Text
$sel:type':UpdateDevice' :: UpdateDevice -> Maybe Text
$sel:model:UpdateDevice' :: UpdateDevice -> Maybe Text
$sel:aWSLocation:UpdateDevice' :: UpdateDevice -> Maybe AWSLocation
$sel:location:UpdateDevice' :: UpdateDevice -> Maybe (Sensitive Location)
$sel:vendor:UpdateDevice' :: UpdateDevice -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Vendor" 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
vendor,
            (Text
"Location" Text -> Sensitive Location -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Sensitive Location -> Pair)
-> Maybe (Sensitive Location) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (Sensitive Location)
location,
            (Text
"AWSLocation" Text -> AWSLocation -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AWSLocation -> Pair) -> Maybe AWSLocation -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AWSLocation
aWSLocation,
            (Text
"Model" 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
model,
            (Text
"Type" 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
type',
            (Text
"SerialNumber" 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
serialNumber,
            (Text
"SiteId" 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
siteId,
            (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
          ]
      )

instance Core.ToPath UpdateDevice where
  toPath :: UpdateDevice -> ByteString
toPath UpdateDevice' {Maybe Text
Maybe (Sensitive Location)
Maybe AWSLocation
Text
deviceId :: Text
globalNetworkId :: Text
description :: Maybe Text
siteId :: Maybe Text
serialNumber :: Maybe Text
type' :: Maybe Text
model :: Maybe Text
aWSLocation :: Maybe AWSLocation
location :: Maybe (Sensitive Location)
vendor :: Maybe Text
$sel:deviceId:UpdateDevice' :: UpdateDevice -> Text
$sel:globalNetworkId:UpdateDevice' :: UpdateDevice -> Text
$sel:description:UpdateDevice' :: UpdateDevice -> Maybe Text
$sel:siteId:UpdateDevice' :: UpdateDevice -> Maybe Text
$sel:serialNumber:UpdateDevice' :: UpdateDevice -> Maybe Text
$sel:type':UpdateDevice' :: UpdateDevice -> Maybe Text
$sel:model:UpdateDevice' :: UpdateDevice -> Maybe Text
$sel:aWSLocation:UpdateDevice' :: UpdateDevice -> Maybe AWSLocation
$sel:location:UpdateDevice' :: UpdateDevice -> Maybe (Sensitive Location)
$sel:vendor:UpdateDevice' :: UpdateDevice -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/global-networks/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
globalNetworkId,
        ByteString
"/devices/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
deviceId
      ]

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

-- | /See:/ 'newUpdateDeviceResponse' smart constructor.
data UpdateDeviceResponse = UpdateDeviceResponse'
  { -- | Information about the device.
    UpdateDeviceResponse -> Maybe Device
device :: Prelude.Maybe Device,
    -- | The response's http status code.
    UpdateDeviceResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateDeviceResponse -> UpdateDeviceResponse -> Bool
(UpdateDeviceResponse -> UpdateDeviceResponse -> Bool)
-> (UpdateDeviceResponse -> UpdateDeviceResponse -> Bool)
-> Eq UpdateDeviceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateDeviceResponse -> UpdateDeviceResponse -> Bool
$c/= :: UpdateDeviceResponse -> UpdateDeviceResponse -> Bool
== :: UpdateDeviceResponse -> UpdateDeviceResponse -> Bool
$c== :: UpdateDeviceResponse -> UpdateDeviceResponse -> Bool
Prelude.Eq, Int -> UpdateDeviceResponse -> ShowS
[UpdateDeviceResponse] -> ShowS
UpdateDeviceResponse -> String
(Int -> UpdateDeviceResponse -> ShowS)
-> (UpdateDeviceResponse -> String)
-> ([UpdateDeviceResponse] -> ShowS)
-> Show UpdateDeviceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateDeviceResponse] -> ShowS
$cshowList :: [UpdateDeviceResponse] -> ShowS
show :: UpdateDeviceResponse -> String
$cshow :: UpdateDeviceResponse -> String
showsPrec :: Int -> UpdateDeviceResponse -> ShowS
$cshowsPrec :: Int -> UpdateDeviceResponse -> ShowS
Prelude.Show, (forall x. UpdateDeviceResponse -> Rep UpdateDeviceResponse x)
-> (forall x. Rep UpdateDeviceResponse x -> UpdateDeviceResponse)
-> Generic UpdateDeviceResponse
forall x. Rep UpdateDeviceResponse x -> UpdateDeviceResponse
forall x. UpdateDeviceResponse -> Rep UpdateDeviceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateDeviceResponse x -> UpdateDeviceResponse
$cfrom :: forall x. UpdateDeviceResponse -> Rep UpdateDeviceResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateDeviceResponse' 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:
--
-- 'device', 'updateDeviceResponse_device' - Information about the device.
--
-- 'httpStatus', 'updateDeviceResponse_httpStatus' - The response's http status code.
newUpdateDeviceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateDeviceResponse
newUpdateDeviceResponse :: Int -> UpdateDeviceResponse
newUpdateDeviceResponse Int
pHttpStatus_ =
  UpdateDeviceResponse' :: Maybe Device -> Int -> UpdateDeviceResponse
UpdateDeviceResponse'
    { $sel:device:UpdateDeviceResponse' :: Maybe Device
device = Maybe Device
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateDeviceResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Information about the device.
updateDeviceResponse_device :: Lens.Lens' UpdateDeviceResponse (Prelude.Maybe Device)
updateDeviceResponse_device :: (Maybe Device -> f (Maybe Device))
-> UpdateDeviceResponse -> f UpdateDeviceResponse
updateDeviceResponse_device = (UpdateDeviceResponse -> Maybe Device)
-> (UpdateDeviceResponse -> Maybe Device -> UpdateDeviceResponse)
-> Lens
     UpdateDeviceResponse
     UpdateDeviceResponse
     (Maybe Device)
     (Maybe Device)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateDeviceResponse' {Maybe Device
device :: Maybe Device
$sel:device:UpdateDeviceResponse' :: UpdateDeviceResponse -> Maybe Device
device} -> Maybe Device
device) (\s :: UpdateDeviceResponse
s@UpdateDeviceResponse' {} Maybe Device
a -> UpdateDeviceResponse
s {$sel:device:UpdateDeviceResponse' :: Maybe Device
device = Maybe Device
a} :: UpdateDeviceResponse)

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

instance Prelude.NFData UpdateDeviceResponse