{-# 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.IoT.UpdateCustomMetric
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Updates a Device Defender detect custom metric.
--
-- Requires permission to access the
-- <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions UpdateCustomMetric>
-- action.
module Amazonka.IoT.UpdateCustomMetric
  ( -- * Creating a Request
    UpdateCustomMetric (..),
    newUpdateCustomMetric,

    -- * Request Lenses
    updateCustomMetric_metricName,
    updateCustomMetric_displayName,

    -- * Destructuring the Response
    UpdateCustomMetricResponse (..),
    newUpdateCustomMetricResponse,

    -- * Response Lenses
    updateCustomMetricResponse_creationDate,
    updateCustomMetricResponse_displayName,
    updateCustomMetricResponse_lastModifiedDate,
    updateCustomMetricResponse_metricArn,
    updateCustomMetricResponse_metricName,
    updateCustomMetricResponse_metricType,
    updateCustomMetricResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.IoT.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newUpdateCustomMetric' smart constructor.
data UpdateCustomMetric = UpdateCustomMetric'
  { -- | The name of the custom metric. Cannot be updated.
    UpdateCustomMetric -> Text
metricName :: Prelude.Text,
    -- | Field represents a friendly name in the console for the custom metric,
    -- it doesn\'t have to be unique. Don\'t use this name as the metric
    -- identifier in the device metric report. Can be updated.
    UpdateCustomMetric -> Text
displayName :: Prelude.Text
  }
  deriving (UpdateCustomMetric -> UpdateCustomMetric -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateCustomMetric -> UpdateCustomMetric -> Bool
$c/= :: UpdateCustomMetric -> UpdateCustomMetric -> Bool
== :: UpdateCustomMetric -> UpdateCustomMetric -> Bool
$c== :: UpdateCustomMetric -> UpdateCustomMetric -> Bool
Prelude.Eq, ReadPrec [UpdateCustomMetric]
ReadPrec UpdateCustomMetric
Int -> ReadS UpdateCustomMetric
ReadS [UpdateCustomMetric]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateCustomMetric]
$creadListPrec :: ReadPrec [UpdateCustomMetric]
readPrec :: ReadPrec UpdateCustomMetric
$creadPrec :: ReadPrec UpdateCustomMetric
readList :: ReadS [UpdateCustomMetric]
$creadList :: ReadS [UpdateCustomMetric]
readsPrec :: Int -> ReadS UpdateCustomMetric
$creadsPrec :: Int -> ReadS UpdateCustomMetric
Prelude.Read, Int -> UpdateCustomMetric -> ShowS
[UpdateCustomMetric] -> ShowS
UpdateCustomMetric -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateCustomMetric] -> ShowS
$cshowList :: [UpdateCustomMetric] -> ShowS
show :: UpdateCustomMetric -> String
$cshow :: UpdateCustomMetric -> String
showsPrec :: Int -> UpdateCustomMetric -> ShowS
$cshowsPrec :: Int -> UpdateCustomMetric -> ShowS
Prelude.Show, forall x. Rep UpdateCustomMetric x -> UpdateCustomMetric
forall x. UpdateCustomMetric -> Rep UpdateCustomMetric x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateCustomMetric x -> UpdateCustomMetric
$cfrom :: forall x. UpdateCustomMetric -> Rep UpdateCustomMetric x
Prelude.Generic)

-- |
-- Create a value of 'UpdateCustomMetric' 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:
--
-- 'metricName', 'updateCustomMetric_metricName' - The name of the custom metric. Cannot be updated.
--
-- 'displayName', 'updateCustomMetric_displayName' - Field represents a friendly name in the console for the custom metric,
-- it doesn\'t have to be unique. Don\'t use this name as the metric
-- identifier in the device metric report. Can be updated.
newUpdateCustomMetric ::
  -- | 'metricName'
  Prelude.Text ->
  -- | 'displayName'
  Prelude.Text ->
  UpdateCustomMetric
newUpdateCustomMetric :: Text -> Text -> UpdateCustomMetric
newUpdateCustomMetric Text
pMetricName_ Text
pDisplayName_ =
  UpdateCustomMetric'
    { $sel:metricName:UpdateCustomMetric' :: Text
metricName = Text
pMetricName_,
      $sel:displayName:UpdateCustomMetric' :: Text
displayName = Text
pDisplayName_
    }

-- | The name of the custom metric. Cannot be updated.
updateCustomMetric_metricName :: Lens.Lens' UpdateCustomMetric Prelude.Text
updateCustomMetric_metricName :: Lens' UpdateCustomMetric Text
updateCustomMetric_metricName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCustomMetric' {Text
metricName :: Text
$sel:metricName:UpdateCustomMetric' :: UpdateCustomMetric -> Text
metricName} -> Text
metricName) (\s :: UpdateCustomMetric
s@UpdateCustomMetric' {} Text
a -> UpdateCustomMetric
s {$sel:metricName:UpdateCustomMetric' :: Text
metricName = Text
a} :: UpdateCustomMetric)

-- | Field represents a friendly name in the console for the custom metric,
-- it doesn\'t have to be unique. Don\'t use this name as the metric
-- identifier in the device metric report. Can be updated.
updateCustomMetric_displayName :: Lens.Lens' UpdateCustomMetric Prelude.Text
updateCustomMetric_displayName :: Lens' UpdateCustomMetric Text
updateCustomMetric_displayName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCustomMetric' {Text
displayName :: Text
$sel:displayName:UpdateCustomMetric' :: UpdateCustomMetric -> Text
displayName} -> Text
displayName) (\s :: UpdateCustomMetric
s@UpdateCustomMetric' {} Text
a -> UpdateCustomMetric
s {$sel:displayName:UpdateCustomMetric' :: Text
displayName = Text
a} :: UpdateCustomMetric)

instance Core.AWSRequest UpdateCustomMetric where
  type
    AWSResponse UpdateCustomMetric =
      UpdateCustomMetricResponse
  request :: (Service -> Service)
-> UpdateCustomMetric -> Request UpdateCustomMetric
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy UpdateCustomMetric
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateCustomMetric)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe POSIX
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe CustomMetricType
-> Int
-> UpdateCustomMetricResponse
UpdateCustomMetricResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"creationDate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"displayName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"lastModifiedDate")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"metricArn")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"metricName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"metricType")
            forall (f :: * -> *) a b. Applicative f => 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 UpdateCustomMetric where
  hashWithSalt :: Int -> UpdateCustomMetric -> Int
hashWithSalt Int
_salt UpdateCustomMetric' {Text
displayName :: Text
metricName :: Text
$sel:displayName:UpdateCustomMetric' :: UpdateCustomMetric -> Text
$sel:metricName:UpdateCustomMetric' :: UpdateCustomMetric -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
metricName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
displayName

instance Prelude.NFData UpdateCustomMetric where
  rnf :: UpdateCustomMetric -> ()
rnf UpdateCustomMetric' {Text
displayName :: Text
metricName :: Text
$sel:displayName:UpdateCustomMetric' :: UpdateCustomMetric -> Text
$sel:metricName:UpdateCustomMetric' :: UpdateCustomMetric -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
metricName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
displayName

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

instance Data.ToJSON UpdateCustomMetric where
  toJSON :: UpdateCustomMetric -> Value
toJSON UpdateCustomMetric' {Text
displayName :: Text
metricName :: Text
$sel:displayName:UpdateCustomMetric' :: UpdateCustomMetric -> Text
$sel:metricName:UpdateCustomMetric' :: UpdateCustomMetric -> Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"displayName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
displayName)]
      )

instance Data.ToPath UpdateCustomMetric where
  toPath :: UpdateCustomMetric -> ByteString
toPath UpdateCustomMetric' {Text
displayName :: Text
metricName :: Text
$sel:displayName:UpdateCustomMetric' :: UpdateCustomMetric -> Text
$sel:metricName:UpdateCustomMetric' :: UpdateCustomMetric -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/custom-metric/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
metricName]

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

-- | /See:/ 'newUpdateCustomMetricResponse' smart constructor.
data UpdateCustomMetricResponse = UpdateCustomMetricResponse'
  { -- | The creation date of the custom metric in milliseconds since epoch.
    UpdateCustomMetricResponse -> Maybe POSIX
creationDate :: Prelude.Maybe Data.POSIX,
    -- | A friendly name in the console for the custom metric
    UpdateCustomMetricResponse -> Maybe Text
displayName :: Prelude.Maybe Prelude.Text,
    -- | The time the custom metric was last modified in milliseconds since
    -- epoch.
    UpdateCustomMetricResponse -> Maybe POSIX
lastModifiedDate :: Prelude.Maybe Data.POSIX,
    -- | The Amazon Resource Number (ARN) of the custom metric.
    UpdateCustomMetricResponse -> Maybe Text
metricArn :: Prelude.Maybe Prelude.Text,
    -- | The name of the custom metric.
    UpdateCustomMetricResponse -> Maybe Text
metricName :: Prelude.Maybe Prelude.Text,
    -- | The type of the custom metric.
    --
    -- The type @number@ only takes a single metric value as an input, but
    -- while submitting the metrics value in the DeviceMetrics report, it must
    -- be passed as an array with a single value.
    UpdateCustomMetricResponse -> Maybe CustomMetricType
metricType :: Prelude.Maybe CustomMetricType,
    -- | The response's http status code.
    UpdateCustomMetricResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateCustomMetricResponse -> UpdateCustomMetricResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateCustomMetricResponse -> UpdateCustomMetricResponse -> Bool
$c/= :: UpdateCustomMetricResponse -> UpdateCustomMetricResponse -> Bool
== :: UpdateCustomMetricResponse -> UpdateCustomMetricResponse -> Bool
$c== :: UpdateCustomMetricResponse -> UpdateCustomMetricResponse -> Bool
Prelude.Eq, ReadPrec [UpdateCustomMetricResponse]
ReadPrec UpdateCustomMetricResponse
Int -> ReadS UpdateCustomMetricResponse
ReadS [UpdateCustomMetricResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateCustomMetricResponse]
$creadListPrec :: ReadPrec [UpdateCustomMetricResponse]
readPrec :: ReadPrec UpdateCustomMetricResponse
$creadPrec :: ReadPrec UpdateCustomMetricResponse
readList :: ReadS [UpdateCustomMetricResponse]
$creadList :: ReadS [UpdateCustomMetricResponse]
readsPrec :: Int -> ReadS UpdateCustomMetricResponse
$creadsPrec :: Int -> ReadS UpdateCustomMetricResponse
Prelude.Read, Int -> UpdateCustomMetricResponse -> ShowS
[UpdateCustomMetricResponse] -> ShowS
UpdateCustomMetricResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateCustomMetricResponse] -> ShowS
$cshowList :: [UpdateCustomMetricResponse] -> ShowS
show :: UpdateCustomMetricResponse -> String
$cshow :: UpdateCustomMetricResponse -> String
showsPrec :: Int -> UpdateCustomMetricResponse -> ShowS
$cshowsPrec :: Int -> UpdateCustomMetricResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateCustomMetricResponse x -> UpdateCustomMetricResponse
forall x.
UpdateCustomMetricResponse -> Rep UpdateCustomMetricResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateCustomMetricResponse x -> UpdateCustomMetricResponse
$cfrom :: forall x.
UpdateCustomMetricResponse -> Rep UpdateCustomMetricResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateCustomMetricResponse' 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:
--
-- 'creationDate', 'updateCustomMetricResponse_creationDate' - The creation date of the custom metric in milliseconds since epoch.
--
-- 'displayName', 'updateCustomMetricResponse_displayName' - A friendly name in the console for the custom metric
--
-- 'lastModifiedDate', 'updateCustomMetricResponse_lastModifiedDate' - The time the custom metric was last modified in milliseconds since
-- epoch.
--
-- 'metricArn', 'updateCustomMetricResponse_metricArn' - The Amazon Resource Number (ARN) of the custom metric.
--
-- 'metricName', 'updateCustomMetricResponse_metricName' - The name of the custom metric.
--
-- 'metricType', 'updateCustomMetricResponse_metricType' - The type of the custom metric.
--
-- The type @number@ only takes a single metric value as an input, but
-- while submitting the metrics value in the DeviceMetrics report, it must
-- be passed as an array with a single value.
--
-- 'httpStatus', 'updateCustomMetricResponse_httpStatus' - The response's http status code.
newUpdateCustomMetricResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateCustomMetricResponse
newUpdateCustomMetricResponse :: Int -> UpdateCustomMetricResponse
newUpdateCustomMetricResponse Int
pHttpStatus_ =
  UpdateCustomMetricResponse'
    { $sel:creationDate:UpdateCustomMetricResponse' :: Maybe POSIX
creationDate =
        forall a. Maybe a
Prelude.Nothing,
      $sel:displayName:UpdateCustomMetricResponse' :: Maybe Text
displayName = forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedDate:UpdateCustomMetricResponse' :: Maybe POSIX
lastModifiedDate = forall a. Maybe a
Prelude.Nothing,
      $sel:metricArn:UpdateCustomMetricResponse' :: Maybe Text
metricArn = forall a. Maybe a
Prelude.Nothing,
      $sel:metricName:UpdateCustomMetricResponse' :: Maybe Text
metricName = forall a. Maybe a
Prelude.Nothing,
      $sel:metricType:UpdateCustomMetricResponse' :: Maybe CustomMetricType
metricType = forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateCustomMetricResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The creation date of the custom metric in milliseconds since epoch.
updateCustomMetricResponse_creationDate :: Lens.Lens' UpdateCustomMetricResponse (Prelude.Maybe Prelude.UTCTime)
updateCustomMetricResponse_creationDate :: Lens' UpdateCustomMetricResponse (Maybe UTCTime)
updateCustomMetricResponse_creationDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCustomMetricResponse' {Maybe POSIX
creationDate :: Maybe POSIX
$sel:creationDate:UpdateCustomMetricResponse' :: UpdateCustomMetricResponse -> Maybe POSIX
creationDate} -> Maybe POSIX
creationDate) (\s :: UpdateCustomMetricResponse
s@UpdateCustomMetricResponse' {} Maybe POSIX
a -> UpdateCustomMetricResponse
s {$sel:creationDate:UpdateCustomMetricResponse' :: Maybe POSIX
creationDate = Maybe POSIX
a} :: UpdateCustomMetricResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | A friendly name in the console for the custom metric
updateCustomMetricResponse_displayName :: Lens.Lens' UpdateCustomMetricResponse (Prelude.Maybe Prelude.Text)
updateCustomMetricResponse_displayName :: Lens' UpdateCustomMetricResponse (Maybe Text)
updateCustomMetricResponse_displayName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCustomMetricResponse' {Maybe Text
displayName :: Maybe Text
$sel:displayName:UpdateCustomMetricResponse' :: UpdateCustomMetricResponse -> Maybe Text
displayName} -> Maybe Text
displayName) (\s :: UpdateCustomMetricResponse
s@UpdateCustomMetricResponse' {} Maybe Text
a -> UpdateCustomMetricResponse
s {$sel:displayName:UpdateCustomMetricResponse' :: Maybe Text
displayName = Maybe Text
a} :: UpdateCustomMetricResponse)

-- | The time the custom metric was last modified in milliseconds since
-- epoch.
updateCustomMetricResponse_lastModifiedDate :: Lens.Lens' UpdateCustomMetricResponse (Prelude.Maybe Prelude.UTCTime)
updateCustomMetricResponse_lastModifiedDate :: Lens' UpdateCustomMetricResponse (Maybe UTCTime)
updateCustomMetricResponse_lastModifiedDate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCustomMetricResponse' {Maybe POSIX
lastModifiedDate :: Maybe POSIX
$sel:lastModifiedDate:UpdateCustomMetricResponse' :: UpdateCustomMetricResponse -> Maybe POSIX
lastModifiedDate} -> Maybe POSIX
lastModifiedDate) (\s :: UpdateCustomMetricResponse
s@UpdateCustomMetricResponse' {} Maybe POSIX
a -> UpdateCustomMetricResponse
s {$sel:lastModifiedDate:UpdateCustomMetricResponse' :: Maybe POSIX
lastModifiedDate = Maybe POSIX
a} :: UpdateCustomMetricResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The Amazon Resource Number (ARN) of the custom metric.
updateCustomMetricResponse_metricArn :: Lens.Lens' UpdateCustomMetricResponse (Prelude.Maybe Prelude.Text)
updateCustomMetricResponse_metricArn :: Lens' UpdateCustomMetricResponse (Maybe Text)
updateCustomMetricResponse_metricArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCustomMetricResponse' {Maybe Text
metricArn :: Maybe Text
$sel:metricArn:UpdateCustomMetricResponse' :: UpdateCustomMetricResponse -> Maybe Text
metricArn} -> Maybe Text
metricArn) (\s :: UpdateCustomMetricResponse
s@UpdateCustomMetricResponse' {} Maybe Text
a -> UpdateCustomMetricResponse
s {$sel:metricArn:UpdateCustomMetricResponse' :: Maybe Text
metricArn = Maybe Text
a} :: UpdateCustomMetricResponse)

-- | The name of the custom metric.
updateCustomMetricResponse_metricName :: Lens.Lens' UpdateCustomMetricResponse (Prelude.Maybe Prelude.Text)
updateCustomMetricResponse_metricName :: Lens' UpdateCustomMetricResponse (Maybe Text)
updateCustomMetricResponse_metricName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCustomMetricResponse' {Maybe Text
metricName :: Maybe Text
$sel:metricName:UpdateCustomMetricResponse' :: UpdateCustomMetricResponse -> Maybe Text
metricName} -> Maybe Text
metricName) (\s :: UpdateCustomMetricResponse
s@UpdateCustomMetricResponse' {} Maybe Text
a -> UpdateCustomMetricResponse
s {$sel:metricName:UpdateCustomMetricResponse' :: Maybe Text
metricName = Maybe Text
a} :: UpdateCustomMetricResponse)

-- | The type of the custom metric.
--
-- The type @number@ only takes a single metric value as an input, but
-- while submitting the metrics value in the DeviceMetrics report, it must
-- be passed as an array with a single value.
updateCustomMetricResponse_metricType :: Lens.Lens' UpdateCustomMetricResponse (Prelude.Maybe CustomMetricType)
updateCustomMetricResponse_metricType :: Lens' UpdateCustomMetricResponse (Maybe CustomMetricType)
updateCustomMetricResponse_metricType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateCustomMetricResponse' {Maybe CustomMetricType
metricType :: Maybe CustomMetricType
$sel:metricType:UpdateCustomMetricResponse' :: UpdateCustomMetricResponse -> Maybe CustomMetricType
metricType} -> Maybe CustomMetricType
metricType) (\s :: UpdateCustomMetricResponse
s@UpdateCustomMetricResponse' {} Maybe CustomMetricType
a -> UpdateCustomMetricResponse
s {$sel:metricType:UpdateCustomMetricResponse' :: Maybe CustomMetricType
metricType = Maybe CustomMetricType
a} :: UpdateCustomMetricResponse)

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

instance Prelude.NFData UpdateCustomMetricResponse where
  rnf :: UpdateCustomMetricResponse -> ()
rnf UpdateCustomMetricResponse' {Int
Maybe Text
Maybe POSIX
Maybe CustomMetricType
httpStatus :: Int
metricType :: Maybe CustomMetricType
metricName :: Maybe Text
metricArn :: Maybe Text
lastModifiedDate :: Maybe POSIX
displayName :: Maybe Text
creationDate :: Maybe POSIX
$sel:httpStatus:UpdateCustomMetricResponse' :: UpdateCustomMetricResponse -> Int
$sel:metricType:UpdateCustomMetricResponse' :: UpdateCustomMetricResponse -> Maybe CustomMetricType
$sel:metricName:UpdateCustomMetricResponse' :: UpdateCustomMetricResponse -> Maybe Text
$sel:metricArn:UpdateCustomMetricResponse' :: UpdateCustomMetricResponse -> Maybe Text
$sel:lastModifiedDate:UpdateCustomMetricResponse' :: UpdateCustomMetricResponse -> Maybe POSIX
$sel:displayName:UpdateCustomMetricResponse' :: UpdateCustomMetricResponse -> Maybe Text
$sel:creationDate:UpdateCustomMetricResponse' :: UpdateCustomMetricResponse -> Maybe POSIX
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
creationDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
displayName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastModifiedDate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
metricArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
metricName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe CustomMetricType
metricType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus