{-# 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.UpdateFleetMetric
-- 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 the data for a fleet metric.
--
-- Requires permission to access the
-- <https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions UpdateFleetMetric>
-- action.
module Amazonka.IoT.UpdateFleetMetric
  ( -- * Creating a Request
    UpdateFleetMetric (..),
    newUpdateFleetMetric,

    -- * Request Lenses
    updateFleetMetric_aggregationField,
    updateFleetMetric_aggregationType,
    updateFleetMetric_description,
    updateFleetMetric_expectedVersion,
    updateFleetMetric_period,
    updateFleetMetric_queryString,
    updateFleetMetric_queryVersion,
    updateFleetMetric_unit,
    updateFleetMetric_metricName,
    updateFleetMetric_indexName,

    -- * Destructuring the Response
    UpdateFleetMetricResponse (..),
    newUpdateFleetMetricResponse,
  )
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:/ 'newUpdateFleetMetric' smart constructor.
data UpdateFleetMetric = UpdateFleetMetric'
  { -- | The field to aggregate.
    UpdateFleetMetric -> Maybe Text
aggregationField :: Prelude.Maybe Prelude.Text,
    -- | The type of the aggregation query.
    UpdateFleetMetric -> Maybe AggregationType
aggregationType :: Prelude.Maybe AggregationType,
    -- | The description of the fleet metric.
    UpdateFleetMetric -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The expected version of the fleet metric record in the registry.
    UpdateFleetMetric -> Maybe Integer
expectedVersion :: Prelude.Maybe Prelude.Integer,
    -- | The time in seconds between fleet metric emissions. Range [60(1 min),
    -- 86400(1 day)] and must be multiple of 60.
    UpdateFleetMetric -> Maybe Natural
period :: Prelude.Maybe Prelude.Natural,
    -- | The search query string.
    UpdateFleetMetric -> Maybe Text
queryString :: Prelude.Maybe Prelude.Text,
    -- | The version of the query.
    UpdateFleetMetric -> Maybe Text
queryVersion :: Prelude.Maybe Prelude.Text,
    -- | Used to support unit transformation such as milliseconds to seconds. The
    -- unit must be supported by
    -- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html CW metric>.
    UpdateFleetMetric -> Maybe FleetMetricUnit
unit :: Prelude.Maybe FleetMetricUnit,
    -- | The name of the fleet metric to update.
    UpdateFleetMetric -> Text
metricName :: Prelude.Text,
    -- | The name of the index to search.
    UpdateFleetMetric -> Text
indexName :: Prelude.Text
  }
  deriving (UpdateFleetMetric -> UpdateFleetMetric -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateFleetMetric -> UpdateFleetMetric -> Bool
$c/= :: UpdateFleetMetric -> UpdateFleetMetric -> Bool
== :: UpdateFleetMetric -> UpdateFleetMetric -> Bool
$c== :: UpdateFleetMetric -> UpdateFleetMetric -> Bool
Prelude.Eq, ReadPrec [UpdateFleetMetric]
ReadPrec UpdateFleetMetric
Int -> ReadS UpdateFleetMetric
ReadS [UpdateFleetMetric]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateFleetMetric]
$creadListPrec :: ReadPrec [UpdateFleetMetric]
readPrec :: ReadPrec UpdateFleetMetric
$creadPrec :: ReadPrec UpdateFleetMetric
readList :: ReadS [UpdateFleetMetric]
$creadList :: ReadS [UpdateFleetMetric]
readsPrec :: Int -> ReadS UpdateFleetMetric
$creadsPrec :: Int -> ReadS UpdateFleetMetric
Prelude.Read, Int -> UpdateFleetMetric -> ShowS
[UpdateFleetMetric] -> ShowS
UpdateFleetMetric -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateFleetMetric] -> ShowS
$cshowList :: [UpdateFleetMetric] -> ShowS
show :: UpdateFleetMetric -> String
$cshow :: UpdateFleetMetric -> String
showsPrec :: Int -> UpdateFleetMetric -> ShowS
$cshowsPrec :: Int -> UpdateFleetMetric -> ShowS
Prelude.Show, forall x. Rep UpdateFleetMetric x -> UpdateFleetMetric
forall x. UpdateFleetMetric -> Rep UpdateFleetMetric x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateFleetMetric x -> UpdateFleetMetric
$cfrom :: forall x. UpdateFleetMetric -> Rep UpdateFleetMetric x
Prelude.Generic)

-- |
-- Create a value of 'UpdateFleetMetric' 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:
--
-- 'aggregationField', 'updateFleetMetric_aggregationField' - The field to aggregate.
--
-- 'aggregationType', 'updateFleetMetric_aggregationType' - The type of the aggregation query.
--
-- 'description', 'updateFleetMetric_description' - The description of the fleet metric.
--
-- 'expectedVersion', 'updateFleetMetric_expectedVersion' - The expected version of the fleet metric record in the registry.
--
-- 'period', 'updateFleetMetric_period' - The time in seconds between fleet metric emissions. Range [60(1 min),
-- 86400(1 day)] and must be multiple of 60.
--
-- 'queryString', 'updateFleetMetric_queryString' - The search query string.
--
-- 'queryVersion', 'updateFleetMetric_queryVersion' - The version of the query.
--
-- 'unit', 'updateFleetMetric_unit' - Used to support unit transformation such as milliseconds to seconds. The
-- unit must be supported by
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html CW metric>.
--
-- 'metricName', 'updateFleetMetric_metricName' - The name of the fleet metric to update.
--
-- 'indexName', 'updateFleetMetric_indexName' - The name of the index to search.
newUpdateFleetMetric ::
  -- | 'metricName'
  Prelude.Text ->
  -- | 'indexName'
  Prelude.Text ->
  UpdateFleetMetric
newUpdateFleetMetric :: Text -> Text -> UpdateFleetMetric
newUpdateFleetMetric Text
pMetricName_ Text
pIndexName_ =
  UpdateFleetMetric'
    { $sel:aggregationField:UpdateFleetMetric' :: Maybe Text
aggregationField =
        forall a. Maybe a
Prelude.Nothing,
      $sel:aggregationType:UpdateFleetMetric' :: Maybe AggregationType
aggregationType = forall a. Maybe a
Prelude.Nothing,
      $sel:description:UpdateFleetMetric' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
      $sel:expectedVersion:UpdateFleetMetric' :: Maybe Integer
expectedVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:period:UpdateFleetMetric' :: Maybe Natural
period = forall a. Maybe a
Prelude.Nothing,
      $sel:queryString:UpdateFleetMetric' :: Maybe Text
queryString = forall a. Maybe a
Prelude.Nothing,
      $sel:queryVersion:UpdateFleetMetric' :: Maybe Text
queryVersion = forall a. Maybe a
Prelude.Nothing,
      $sel:unit:UpdateFleetMetric' :: Maybe FleetMetricUnit
unit = forall a. Maybe a
Prelude.Nothing,
      $sel:metricName:UpdateFleetMetric' :: Text
metricName = Text
pMetricName_,
      $sel:indexName:UpdateFleetMetric' :: Text
indexName = Text
pIndexName_
    }

-- | The field to aggregate.
updateFleetMetric_aggregationField :: Lens.Lens' UpdateFleetMetric (Prelude.Maybe Prelude.Text)
updateFleetMetric_aggregationField :: Lens' UpdateFleetMetric (Maybe Text)
updateFleetMetric_aggregationField = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFleetMetric' {Maybe Text
aggregationField :: Maybe Text
$sel:aggregationField:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe Text
aggregationField} -> Maybe Text
aggregationField) (\s :: UpdateFleetMetric
s@UpdateFleetMetric' {} Maybe Text
a -> UpdateFleetMetric
s {$sel:aggregationField:UpdateFleetMetric' :: Maybe Text
aggregationField = Maybe Text
a} :: UpdateFleetMetric)

-- | The type of the aggregation query.
updateFleetMetric_aggregationType :: Lens.Lens' UpdateFleetMetric (Prelude.Maybe AggregationType)
updateFleetMetric_aggregationType :: Lens' UpdateFleetMetric (Maybe AggregationType)
updateFleetMetric_aggregationType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFleetMetric' {Maybe AggregationType
aggregationType :: Maybe AggregationType
$sel:aggregationType:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe AggregationType
aggregationType} -> Maybe AggregationType
aggregationType) (\s :: UpdateFleetMetric
s@UpdateFleetMetric' {} Maybe AggregationType
a -> UpdateFleetMetric
s {$sel:aggregationType:UpdateFleetMetric' :: Maybe AggregationType
aggregationType = Maybe AggregationType
a} :: UpdateFleetMetric)

-- | The description of the fleet metric.
updateFleetMetric_description :: Lens.Lens' UpdateFleetMetric (Prelude.Maybe Prelude.Text)
updateFleetMetric_description :: Lens' UpdateFleetMetric (Maybe Text)
updateFleetMetric_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFleetMetric' {Maybe Text
description :: Maybe Text
$sel:description:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateFleetMetric
s@UpdateFleetMetric' {} Maybe Text
a -> UpdateFleetMetric
s {$sel:description:UpdateFleetMetric' :: Maybe Text
description = Maybe Text
a} :: UpdateFleetMetric)

-- | The expected version of the fleet metric record in the registry.
updateFleetMetric_expectedVersion :: Lens.Lens' UpdateFleetMetric (Prelude.Maybe Prelude.Integer)
updateFleetMetric_expectedVersion :: Lens' UpdateFleetMetric (Maybe Integer)
updateFleetMetric_expectedVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFleetMetric' {Maybe Integer
expectedVersion :: Maybe Integer
$sel:expectedVersion:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe Integer
expectedVersion} -> Maybe Integer
expectedVersion) (\s :: UpdateFleetMetric
s@UpdateFleetMetric' {} Maybe Integer
a -> UpdateFleetMetric
s {$sel:expectedVersion:UpdateFleetMetric' :: Maybe Integer
expectedVersion = Maybe Integer
a} :: UpdateFleetMetric)

-- | The time in seconds between fleet metric emissions. Range [60(1 min),
-- 86400(1 day)] and must be multiple of 60.
updateFleetMetric_period :: Lens.Lens' UpdateFleetMetric (Prelude.Maybe Prelude.Natural)
updateFleetMetric_period :: Lens' UpdateFleetMetric (Maybe Natural)
updateFleetMetric_period = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFleetMetric' {Maybe Natural
period :: Maybe Natural
$sel:period:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe Natural
period} -> Maybe Natural
period) (\s :: UpdateFleetMetric
s@UpdateFleetMetric' {} Maybe Natural
a -> UpdateFleetMetric
s {$sel:period:UpdateFleetMetric' :: Maybe Natural
period = Maybe Natural
a} :: UpdateFleetMetric)

-- | The search query string.
updateFleetMetric_queryString :: Lens.Lens' UpdateFleetMetric (Prelude.Maybe Prelude.Text)
updateFleetMetric_queryString :: Lens' UpdateFleetMetric (Maybe Text)
updateFleetMetric_queryString = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFleetMetric' {Maybe Text
queryString :: Maybe Text
$sel:queryString:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe Text
queryString} -> Maybe Text
queryString) (\s :: UpdateFleetMetric
s@UpdateFleetMetric' {} Maybe Text
a -> UpdateFleetMetric
s {$sel:queryString:UpdateFleetMetric' :: Maybe Text
queryString = Maybe Text
a} :: UpdateFleetMetric)

-- | The version of the query.
updateFleetMetric_queryVersion :: Lens.Lens' UpdateFleetMetric (Prelude.Maybe Prelude.Text)
updateFleetMetric_queryVersion :: Lens' UpdateFleetMetric (Maybe Text)
updateFleetMetric_queryVersion = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFleetMetric' {Maybe Text
queryVersion :: Maybe Text
$sel:queryVersion:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe Text
queryVersion} -> Maybe Text
queryVersion) (\s :: UpdateFleetMetric
s@UpdateFleetMetric' {} Maybe Text
a -> UpdateFleetMetric
s {$sel:queryVersion:UpdateFleetMetric' :: Maybe Text
queryVersion = Maybe Text
a} :: UpdateFleetMetric)

-- | Used to support unit transformation such as milliseconds to seconds. The
-- unit must be supported by
-- <https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html CW metric>.
updateFleetMetric_unit :: Lens.Lens' UpdateFleetMetric (Prelude.Maybe FleetMetricUnit)
updateFleetMetric_unit :: Lens' UpdateFleetMetric (Maybe FleetMetricUnit)
updateFleetMetric_unit = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFleetMetric' {Maybe FleetMetricUnit
unit :: Maybe FleetMetricUnit
$sel:unit:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe FleetMetricUnit
unit} -> Maybe FleetMetricUnit
unit) (\s :: UpdateFleetMetric
s@UpdateFleetMetric' {} Maybe FleetMetricUnit
a -> UpdateFleetMetric
s {$sel:unit:UpdateFleetMetric' :: Maybe FleetMetricUnit
unit = Maybe FleetMetricUnit
a} :: UpdateFleetMetric)

-- | The name of the fleet metric to update.
updateFleetMetric_metricName :: Lens.Lens' UpdateFleetMetric Prelude.Text
updateFleetMetric_metricName :: Lens' UpdateFleetMetric Text
updateFleetMetric_metricName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFleetMetric' {Text
metricName :: Text
$sel:metricName:UpdateFleetMetric' :: UpdateFleetMetric -> Text
metricName} -> Text
metricName) (\s :: UpdateFleetMetric
s@UpdateFleetMetric' {} Text
a -> UpdateFleetMetric
s {$sel:metricName:UpdateFleetMetric' :: Text
metricName = Text
a} :: UpdateFleetMetric)

-- | The name of the index to search.
updateFleetMetric_indexName :: Lens.Lens' UpdateFleetMetric Prelude.Text
updateFleetMetric_indexName :: Lens' UpdateFleetMetric Text
updateFleetMetric_indexName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateFleetMetric' {Text
indexName :: Text
$sel:indexName:UpdateFleetMetric' :: UpdateFleetMetric -> Text
indexName} -> Text
indexName) (\s :: UpdateFleetMetric
s@UpdateFleetMetric' {} Text
a -> UpdateFleetMetric
s {$sel:indexName:UpdateFleetMetric' :: Text
indexName = Text
a} :: UpdateFleetMetric)

instance Core.AWSRequest UpdateFleetMetric where
  type
    AWSResponse UpdateFleetMetric =
      UpdateFleetMetricResponse
  request :: (Service -> Service)
-> UpdateFleetMetric -> Request UpdateFleetMetric
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 UpdateFleetMetric
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse UpdateFleetMetric)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull UpdateFleetMetricResponse
UpdateFleetMetricResponse'

instance Prelude.Hashable UpdateFleetMetric where
  hashWithSalt :: Int -> UpdateFleetMetric -> Int
hashWithSalt Int
_salt UpdateFleetMetric' {Maybe Integer
Maybe Natural
Maybe Text
Maybe AggregationType
Maybe FleetMetricUnit
Text
indexName :: Text
metricName :: Text
unit :: Maybe FleetMetricUnit
queryVersion :: Maybe Text
queryString :: Maybe Text
period :: Maybe Natural
expectedVersion :: Maybe Integer
description :: Maybe Text
aggregationType :: Maybe AggregationType
aggregationField :: Maybe Text
$sel:indexName:UpdateFleetMetric' :: UpdateFleetMetric -> Text
$sel:metricName:UpdateFleetMetric' :: UpdateFleetMetric -> Text
$sel:unit:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe FleetMetricUnit
$sel:queryVersion:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe Text
$sel:queryString:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe Text
$sel:period:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe Natural
$sel:expectedVersion:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe Integer
$sel:description:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe Text
$sel:aggregationType:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe AggregationType
$sel:aggregationField:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
aggregationField
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe AggregationType
aggregationType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
expectedVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
period
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
queryString
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
queryVersion
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe FleetMetricUnit
unit
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
metricName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
indexName

instance Prelude.NFData UpdateFleetMetric where
  rnf :: UpdateFleetMetric -> ()
rnf UpdateFleetMetric' {Maybe Integer
Maybe Natural
Maybe Text
Maybe AggregationType
Maybe FleetMetricUnit
Text
indexName :: Text
metricName :: Text
unit :: Maybe FleetMetricUnit
queryVersion :: Maybe Text
queryString :: Maybe Text
period :: Maybe Natural
expectedVersion :: Maybe Integer
description :: Maybe Text
aggregationType :: Maybe AggregationType
aggregationField :: Maybe Text
$sel:indexName:UpdateFleetMetric' :: UpdateFleetMetric -> Text
$sel:metricName:UpdateFleetMetric' :: UpdateFleetMetric -> Text
$sel:unit:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe FleetMetricUnit
$sel:queryVersion:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe Text
$sel:queryString:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe Text
$sel:period:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe Natural
$sel:expectedVersion:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe Integer
$sel:description:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe Text
$sel:aggregationType:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe AggregationType
$sel:aggregationField:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
aggregationField
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe AggregationType
aggregationType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
expectedVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
period
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
queryString
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
queryVersion
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe FleetMetricUnit
unit
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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
indexName

instance Data.ToHeaders UpdateFleetMetric where
  toHeaders :: UpdateFleetMetric -> [Header]
toHeaders = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

instance Data.ToJSON UpdateFleetMetric where
  toJSON :: UpdateFleetMetric -> Value
toJSON UpdateFleetMetric' {Maybe Integer
Maybe Natural
Maybe Text
Maybe AggregationType
Maybe FleetMetricUnit
Text
indexName :: Text
metricName :: Text
unit :: Maybe FleetMetricUnit
queryVersion :: Maybe Text
queryString :: Maybe Text
period :: Maybe Natural
expectedVersion :: Maybe Integer
description :: Maybe Text
aggregationType :: Maybe AggregationType
aggregationField :: Maybe Text
$sel:indexName:UpdateFleetMetric' :: UpdateFleetMetric -> Text
$sel:metricName:UpdateFleetMetric' :: UpdateFleetMetric -> Text
$sel:unit:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe FleetMetricUnit
$sel:queryVersion:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe Text
$sel:queryString:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe Text
$sel:period:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe Natural
$sel:expectedVersion:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe Integer
$sel:description:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe Text
$sel:aggregationType:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe AggregationType
$sel:aggregationField:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"aggregationField" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
aggregationField,
            (Key
"aggregationType" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AggregationType
aggregationType,
            (Key
"description" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Key
"expectedVersion" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Integer
expectedVersion,
            (Key
"period" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
period,
            (Key
"queryString" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
queryString,
            (Key
"queryVersion" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
queryVersion,
            (Key
"unit" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe FleetMetricUnit
unit,
            forall a. a -> Maybe a
Prelude.Just (Key
"indexName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
indexName)
          ]
      )

instance Data.ToPath UpdateFleetMetric where
  toPath :: UpdateFleetMetric -> ByteString
toPath UpdateFleetMetric' {Maybe Integer
Maybe Natural
Maybe Text
Maybe AggregationType
Maybe FleetMetricUnit
Text
indexName :: Text
metricName :: Text
unit :: Maybe FleetMetricUnit
queryVersion :: Maybe Text
queryString :: Maybe Text
period :: Maybe Natural
expectedVersion :: Maybe Integer
description :: Maybe Text
aggregationType :: Maybe AggregationType
aggregationField :: Maybe Text
$sel:indexName:UpdateFleetMetric' :: UpdateFleetMetric -> Text
$sel:metricName:UpdateFleetMetric' :: UpdateFleetMetric -> Text
$sel:unit:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe FleetMetricUnit
$sel:queryVersion:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe Text
$sel:queryString:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe Text
$sel:period:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe Natural
$sel:expectedVersion:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe Integer
$sel:description:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe Text
$sel:aggregationType:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe AggregationType
$sel:aggregationField:UpdateFleetMetric' :: UpdateFleetMetric -> Maybe Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/fleet-metric/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
metricName]

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

-- | /See:/ 'newUpdateFleetMetricResponse' smart constructor.
data UpdateFleetMetricResponse = UpdateFleetMetricResponse'
  {
  }
  deriving (UpdateFleetMetricResponse -> UpdateFleetMetricResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateFleetMetricResponse -> UpdateFleetMetricResponse -> Bool
$c/= :: UpdateFleetMetricResponse -> UpdateFleetMetricResponse -> Bool
== :: UpdateFleetMetricResponse -> UpdateFleetMetricResponse -> Bool
$c== :: UpdateFleetMetricResponse -> UpdateFleetMetricResponse -> Bool
Prelude.Eq, ReadPrec [UpdateFleetMetricResponse]
ReadPrec UpdateFleetMetricResponse
Int -> ReadS UpdateFleetMetricResponse
ReadS [UpdateFleetMetricResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateFleetMetricResponse]
$creadListPrec :: ReadPrec [UpdateFleetMetricResponse]
readPrec :: ReadPrec UpdateFleetMetricResponse
$creadPrec :: ReadPrec UpdateFleetMetricResponse
readList :: ReadS [UpdateFleetMetricResponse]
$creadList :: ReadS [UpdateFleetMetricResponse]
readsPrec :: Int -> ReadS UpdateFleetMetricResponse
$creadsPrec :: Int -> ReadS UpdateFleetMetricResponse
Prelude.Read, Int -> UpdateFleetMetricResponse -> ShowS
[UpdateFleetMetricResponse] -> ShowS
UpdateFleetMetricResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateFleetMetricResponse] -> ShowS
$cshowList :: [UpdateFleetMetricResponse] -> ShowS
show :: UpdateFleetMetricResponse -> String
$cshow :: UpdateFleetMetricResponse -> String
showsPrec :: Int -> UpdateFleetMetricResponse -> ShowS
$cshowsPrec :: Int -> UpdateFleetMetricResponse -> ShowS
Prelude.Show, forall x.
Rep UpdateFleetMetricResponse x -> UpdateFleetMetricResponse
forall x.
UpdateFleetMetricResponse -> Rep UpdateFleetMetricResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateFleetMetricResponse x -> UpdateFleetMetricResponse
$cfrom :: forall x.
UpdateFleetMetricResponse -> Rep UpdateFleetMetricResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateFleetMetricResponse' 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.
newUpdateFleetMetricResponse ::
  UpdateFleetMetricResponse
newUpdateFleetMetricResponse :: UpdateFleetMetricResponse
newUpdateFleetMetricResponse =
  UpdateFleetMetricResponse
UpdateFleetMetricResponse'

instance Prelude.NFData UpdateFleetMetricResponse where
  rnf :: UpdateFleetMetricResponse -> ()
rnf UpdateFleetMetricResponse
_ = ()