{-# 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-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 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_metricType,
    updateCustomMetricResponse_lastModifiedDate,
    updateCustomMetricResponse_metricName,
    updateCustomMetricResponse_displayName,
    updateCustomMetricResponse_creationDate,
    updateCustomMetricResponse_metricArn,
    updateCustomMetricResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.IoT.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:/ '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
(UpdateCustomMetric -> UpdateCustomMetric -> Bool)
-> (UpdateCustomMetric -> UpdateCustomMetric -> Bool)
-> Eq UpdateCustomMetric
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]
(Int -> ReadS UpdateCustomMetric)
-> ReadS [UpdateCustomMetric]
-> ReadPrec UpdateCustomMetric
-> ReadPrec [UpdateCustomMetric]
-> Read 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
(Int -> UpdateCustomMetric -> ShowS)
-> (UpdateCustomMetric -> String)
-> ([UpdateCustomMetric] -> ShowS)
-> Show UpdateCustomMetric
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. UpdateCustomMetric -> Rep UpdateCustomMetric x)
-> (forall x. Rep UpdateCustomMetric x -> UpdateCustomMetric)
-> Generic UpdateCustomMetric
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' :: Text -> Text -> UpdateCustomMetric
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 :: (Text -> f Text) -> UpdateCustomMetric -> f UpdateCustomMetric
updateCustomMetric_metricName = (UpdateCustomMetric -> Text)
-> (UpdateCustomMetric -> Text -> UpdateCustomMetric)
-> Lens UpdateCustomMetric UpdateCustomMetric Text Text
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 :: (Text -> f Text) -> UpdateCustomMetric -> f UpdateCustomMetric
updateCustomMetric_displayName = (UpdateCustomMetric -> Text)
-> (UpdateCustomMetric -> Text -> UpdateCustomMetric)
-> Lens UpdateCustomMetric UpdateCustomMetric Text Text
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 :: UpdateCustomMetric -> Request UpdateCustomMetric
request = Service -> UpdateCustomMetric -> Request UpdateCustomMetric
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.patchJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateCustomMetric
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateCustomMetric)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateCustomMetric))
-> Logger
-> Service
-> Proxy UpdateCustomMetric
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateCustomMetric)))
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 CustomMetricType
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Int
-> UpdateCustomMetricResponse
UpdateCustomMetricResponse'
            (Maybe CustomMetricType
 -> Maybe POSIX
 -> Maybe Text
 -> Maybe Text
 -> Maybe POSIX
 -> Maybe Text
 -> Int
 -> UpdateCustomMetricResponse)
-> Either String (Maybe CustomMetricType)
-> Either
     String
     (Maybe POSIX
      -> Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Int
      -> UpdateCustomMetricResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe CustomMetricType)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"metricType")
            Either
  String
  (Maybe POSIX
   -> Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Int
   -> UpdateCustomMetricResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Text
      -> Maybe Text
      -> Maybe POSIX
      -> Maybe Text
      -> Int
      -> UpdateCustomMetricResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"lastModifiedDate")
            Either
  String
  (Maybe Text
   -> Maybe Text
   -> Maybe POSIX
   -> Maybe Text
   -> Int
   -> UpdateCustomMetricResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe Text
      -> Maybe POSIX -> Maybe Text -> Int -> UpdateCustomMetricResponse)
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
"metricName")
            Either
  String
  (Maybe Text
   -> Maybe POSIX -> Maybe Text -> Int -> UpdateCustomMetricResponse)
-> Either String (Maybe Text)
-> Either
     String
     (Maybe POSIX -> Maybe Text -> Int -> UpdateCustomMetricResponse)
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
"displayName")
            Either
  String
  (Maybe POSIX -> Maybe Text -> Int -> UpdateCustomMetricResponse)
-> Either String (Maybe POSIX)
-> Either String (Maybe Text -> Int -> UpdateCustomMetricResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"creationDate")
            Either String (Maybe Text -> Int -> UpdateCustomMetricResponse)
-> Either String (Maybe Text)
-> Either String (Int -> UpdateCustomMetricResponse)
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
"metricArn")
            Either String (Int -> UpdateCustomMetricResponse)
-> Either String Int -> Either String UpdateCustomMetricResponse
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 UpdateCustomMetric

instance Prelude.NFData UpdateCustomMetric

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

instance Core.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
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"displayName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
displayName)]
      )

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

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

-- | /See:/ 'newUpdateCustomMetricResponse' smart constructor.
data UpdateCustomMetricResponse = UpdateCustomMetricResponse'
  { -- | The type of the custom metric. Types include @string-list@,
    -- @ip-address-list@, @number-list@, and @number@.
    UpdateCustomMetricResponse -> Maybe CustomMetricType
metricType :: Prelude.Maybe CustomMetricType,
    -- | The time the custom metric was last modified in milliseconds since
    -- epoch.
    UpdateCustomMetricResponse -> Maybe POSIX
lastModifiedDate :: Prelude.Maybe Core.POSIX,
    -- | The name of the custom metric.
    UpdateCustomMetricResponse -> Maybe Text
metricName :: Prelude.Maybe Prelude.Text,
    -- | A friendly name in the console for the custom metric
    UpdateCustomMetricResponse -> Maybe Text
displayName :: Prelude.Maybe Prelude.Text,
    -- | The creation date of the custom metric in milliseconds since epoch.
    UpdateCustomMetricResponse -> Maybe POSIX
creationDate :: Prelude.Maybe Core.POSIX,
    -- | The Amazon Resource Number (ARN) of the custom metric.
    UpdateCustomMetricResponse -> Maybe Text
metricArn :: Prelude.Maybe Prelude.Text,
    -- | The response's http status code.
    UpdateCustomMetricResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateCustomMetricResponse -> UpdateCustomMetricResponse -> Bool
(UpdateCustomMetricResponse -> UpdateCustomMetricResponse -> Bool)
-> (UpdateCustomMetricResponse
    -> UpdateCustomMetricResponse -> Bool)
-> Eq UpdateCustomMetricResponse
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]
(Int -> ReadS UpdateCustomMetricResponse)
-> ReadS [UpdateCustomMetricResponse]
-> ReadPrec UpdateCustomMetricResponse
-> ReadPrec [UpdateCustomMetricResponse]
-> Read 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
(Int -> UpdateCustomMetricResponse -> ShowS)
-> (UpdateCustomMetricResponse -> String)
-> ([UpdateCustomMetricResponse] -> ShowS)
-> Show UpdateCustomMetricResponse
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.
 UpdateCustomMetricResponse -> Rep UpdateCustomMetricResponse x)
-> (forall x.
    Rep UpdateCustomMetricResponse x -> UpdateCustomMetricResponse)
-> Generic UpdateCustomMetricResponse
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:
--
-- 'metricType', 'updateCustomMetricResponse_metricType' - The type of the custom metric. Types include @string-list@,
-- @ip-address-list@, @number-list@, and @number@.
--
-- 'lastModifiedDate', 'updateCustomMetricResponse_lastModifiedDate' - The time the custom metric was last modified in milliseconds since
-- epoch.
--
-- 'metricName', 'updateCustomMetricResponse_metricName' - The name of the custom metric.
--
-- 'displayName', 'updateCustomMetricResponse_displayName' - A friendly name in the console for the custom metric
--
-- 'creationDate', 'updateCustomMetricResponse_creationDate' - The creation date of the custom metric in milliseconds since epoch.
--
-- 'metricArn', 'updateCustomMetricResponse_metricArn' - The Amazon Resource Number (ARN) of the custom metric.
--
-- 'httpStatus', 'updateCustomMetricResponse_httpStatus' - The response's http status code.
newUpdateCustomMetricResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateCustomMetricResponse
newUpdateCustomMetricResponse :: Int -> UpdateCustomMetricResponse
newUpdateCustomMetricResponse Int
pHttpStatus_ =
  UpdateCustomMetricResponse' :: Maybe CustomMetricType
-> Maybe POSIX
-> Maybe Text
-> Maybe Text
-> Maybe POSIX
-> Maybe Text
-> Int
-> UpdateCustomMetricResponse
UpdateCustomMetricResponse'
    { $sel:metricType:UpdateCustomMetricResponse' :: Maybe CustomMetricType
metricType =
        Maybe CustomMetricType
forall a. Maybe a
Prelude.Nothing,
      $sel:lastModifiedDate:UpdateCustomMetricResponse' :: Maybe POSIX
lastModifiedDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:metricName:UpdateCustomMetricResponse' :: Maybe Text
metricName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:displayName:UpdateCustomMetricResponse' :: Maybe Text
displayName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creationDate:UpdateCustomMetricResponse' :: Maybe POSIX
creationDate = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:metricArn:UpdateCustomMetricResponse' :: Maybe Text
metricArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateCustomMetricResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The type of the custom metric. Types include @string-list@,
-- @ip-address-list@, @number-list@, and @number@.
updateCustomMetricResponse_metricType :: Lens.Lens' UpdateCustomMetricResponse (Prelude.Maybe CustomMetricType)
updateCustomMetricResponse_metricType :: (Maybe CustomMetricType -> f (Maybe CustomMetricType))
-> UpdateCustomMetricResponse -> f UpdateCustomMetricResponse
updateCustomMetricResponse_metricType = (UpdateCustomMetricResponse -> Maybe CustomMetricType)
-> (UpdateCustomMetricResponse
    -> Maybe CustomMetricType -> UpdateCustomMetricResponse)
-> Lens
     UpdateCustomMetricResponse
     UpdateCustomMetricResponse
     (Maybe CustomMetricType)
     (Maybe CustomMetricType)
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 time the custom metric was last modified in milliseconds since
-- epoch.
updateCustomMetricResponse_lastModifiedDate :: Lens.Lens' UpdateCustomMetricResponse (Prelude.Maybe Prelude.UTCTime)
updateCustomMetricResponse_lastModifiedDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateCustomMetricResponse -> f UpdateCustomMetricResponse
updateCustomMetricResponse_lastModifiedDate = (UpdateCustomMetricResponse -> Maybe POSIX)
-> (UpdateCustomMetricResponse
    -> Maybe POSIX -> UpdateCustomMetricResponse)
-> Lens
     UpdateCustomMetricResponse
     UpdateCustomMetricResponse
     (Maybe POSIX)
     (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX))
 -> UpdateCustomMetricResponse -> f UpdateCustomMetricResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateCustomMetricResponse
-> f UpdateCustomMetricResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The name of the custom metric.
updateCustomMetricResponse_metricName :: Lens.Lens' UpdateCustomMetricResponse (Prelude.Maybe Prelude.Text)
updateCustomMetricResponse_metricName :: (Maybe Text -> f (Maybe Text))
-> UpdateCustomMetricResponse -> f UpdateCustomMetricResponse
updateCustomMetricResponse_metricName = (UpdateCustomMetricResponse -> Maybe Text)
-> (UpdateCustomMetricResponse
    -> Maybe Text -> UpdateCustomMetricResponse)
-> Lens
     UpdateCustomMetricResponse
     UpdateCustomMetricResponse
     (Maybe Text)
     (Maybe Text)
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)

-- | A friendly name in the console for the custom metric
updateCustomMetricResponse_displayName :: Lens.Lens' UpdateCustomMetricResponse (Prelude.Maybe Prelude.Text)
updateCustomMetricResponse_displayName :: (Maybe Text -> f (Maybe Text))
-> UpdateCustomMetricResponse -> f UpdateCustomMetricResponse
updateCustomMetricResponse_displayName = (UpdateCustomMetricResponse -> Maybe Text)
-> (UpdateCustomMetricResponse
    -> Maybe Text -> UpdateCustomMetricResponse)
-> Lens
     UpdateCustomMetricResponse
     UpdateCustomMetricResponse
     (Maybe Text)
     (Maybe Text)
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 creation date of the custom metric in milliseconds since epoch.
updateCustomMetricResponse_creationDate :: Lens.Lens' UpdateCustomMetricResponse (Prelude.Maybe Prelude.UTCTime)
updateCustomMetricResponse_creationDate :: (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateCustomMetricResponse -> f UpdateCustomMetricResponse
updateCustomMetricResponse_creationDate = (UpdateCustomMetricResponse -> Maybe POSIX)
-> (UpdateCustomMetricResponse
    -> Maybe POSIX -> UpdateCustomMetricResponse)
-> Lens
     UpdateCustomMetricResponse
     UpdateCustomMetricResponse
     (Maybe POSIX)
     (Maybe POSIX)
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) ((Maybe POSIX -> f (Maybe POSIX))
 -> UpdateCustomMetricResponse -> f UpdateCustomMetricResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> UpdateCustomMetricResponse
-> f UpdateCustomMetricResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

-- | The Amazon Resource Number (ARN) of the custom metric.
updateCustomMetricResponse_metricArn :: Lens.Lens' UpdateCustomMetricResponse (Prelude.Maybe Prelude.Text)
updateCustomMetricResponse_metricArn :: (Maybe Text -> f (Maybe Text))
-> UpdateCustomMetricResponse -> f UpdateCustomMetricResponse
updateCustomMetricResponse_metricArn = (UpdateCustomMetricResponse -> Maybe Text)
-> (UpdateCustomMetricResponse
    -> Maybe Text -> UpdateCustomMetricResponse)
-> Lens
     UpdateCustomMetricResponse
     UpdateCustomMetricResponse
     (Maybe Text)
     (Maybe Text)
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 response's http status code.
updateCustomMetricResponse_httpStatus :: Lens.Lens' UpdateCustomMetricResponse Prelude.Int
updateCustomMetricResponse_httpStatus :: (Int -> f Int)
-> UpdateCustomMetricResponse -> f UpdateCustomMetricResponse
updateCustomMetricResponse_httpStatus = (UpdateCustomMetricResponse -> Int)
-> (UpdateCustomMetricResponse
    -> Int -> UpdateCustomMetricResponse)
-> Lens
     UpdateCustomMetricResponse UpdateCustomMetricResponse Int Int
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