{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

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

-- |
-- Module      : Amazonka.XRay.Types.SamplingRuleUpdate
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.XRay.Types.SamplingRuleUpdate where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | A document specifying changes to a sampling rule\'s configuration.
--
-- /See:/ 'newSamplingRuleUpdate' smart constructor.
data SamplingRuleUpdate = SamplingRuleUpdate'
  { -- | Matches attributes derived from the request.
    SamplingRuleUpdate -> Maybe (HashMap Text Text)
attributes :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The percentage of matching requests to instrument, after the reservoir
    -- is exhausted.
    SamplingRuleUpdate -> Maybe Double
fixedRate :: Prelude.Maybe Prelude.Double,
    -- | Matches the HTTP method of a request.
    SamplingRuleUpdate -> Maybe Text
hTTPMethod :: Prelude.Maybe Prelude.Text,
    -- | Matches the hostname from a request URL.
    SamplingRuleUpdate -> Maybe Text
host :: Prelude.Maybe Prelude.Text,
    -- | The priority of the sampling rule.
    SamplingRuleUpdate -> Maybe Int
priority :: Prelude.Maybe Prelude.Int,
    -- | A fixed number of matching requests to instrument per second, prior to
    -- applying the fixed rate. The reservoir is not used directly by services,
    -- but applies to all services using the rule collectively.
    SamplingRuleUpdate -> Maybe Int
reservoirSize :: Prelude.Maybe Prelude.Int,
    -- | Matches the ARN of the Amazon Web Services resource on which the service
    -- runs.
    SamplingRuleUpdate -> Maybe Text
resourceARN :: Prelude.Maybe Prelude.Text,
    -- | The ARN of the sampling rule. Specify a rule by either name or ARN, but
    -- not both.
    SamplingRuleUpdate -> Maybe Text
ruleARN :: Prelude.Maybe Prelude.Text,
    -- | The name of the sampling rule. Specify a rule by either name or ARN, but
    -- not both.
    SamplingRuleUpdate -> Maybe Text
ruleName :: Prelude.Maybe Prelude.Text,
    -- | Matches the @name@ that the service uses to identify itself in segments.
    SamplingRuleUpdate -> Maybe Text
serviceName :: Prelude.Maybe Prelude.Text,
    -- | Matches the @origin@ that the service uses to identify its type in
    -- segments.
    SamplingRuleUpdate -> Maybe Text
serviceType :: Prelude.Maybe Prelude.Text,
    -- | Matches the path from a request URL.
    SamplingRuleUpdate -> Maybe Text
uRLPath :: Prelude.Maybe Prelude.Text
  }
  deriving (SamplingRuleUpdate -> SamplingRuleUpdate -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SamplingRuleUpdate -> SamplingRuleUpdate -> Bool
$c/= :: SamplingRuleUpdate -> SamplingRuleUpdate -> Bool
== :: SamplingRuleUpdate -> SamplingRuleUpdate -> Bool
$c== :: SamplingRuleUpdate -> SamplingRuleUpdate -> Bool
Prelude.Eq, ReadPrec [SamplingRuleUpdate]
ReadPrec SamplingRuleUpdate
Int -> ReadS SamplingRuleUpdate
ReadS [SamplingRuleUpdate]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SamplingRuleUpdate]
$creadListPrec :: ReadPrec [SamplingRuleUpdate]
readPrec :: ReadPrec SamplingRuleUpdate
$creadPrec :: ReadPrec SamplingRuleUpdate
readList :: ReadS [SamplingRuleUpdate]
$creadList :: ReadS [SamplingRuleUpdate]
readsPrec :: Int -> ReadS SamplingRuleUpdate
$creadsPrec :: Int -> ReadS SamplingRuleUpdate
Prelude.Read, Int -> SamplingRuleUpdate -> ShowS
[SamplingRuleUpdate] -> ShowS
SamplingRuleUpdate -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SamplingRuleUpdate] -> ShowS
$cshowList :: [SamplingRuleUpdate] -> ShowS
show :: SamplingRuleUpdate -> String
$cshow :: SamplingRuleUpdate -> String
showsPrec :: Int -> SamplingRuleUpdate -> ShowS
$cshowsPrec :: Int -> SamplingRuleUpdate -> ShowS
Prelude.Show, forall x. Rep SamplingRuleUpdate x -> SamplingRuleUpdate
forall x. SamplingRuleUpdate -> Rep SamplingRuleUpdate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SamplingRuleUpdate x -> SamplingRuleUpdate
$cfrom :: forall x. SamplingRuleUpdate -> Rep SamplingRuleUpdate x
Prelude.Generic)

-- |
-- Create a value of 'SamplingRuleUpdate' 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:
--
-- 'attributes', 'samplingRuleUpdate_attributes' - Matches attributes derived from the request.
--
-- 'fixedRate', 'samplingRuleUpdate_fixedRate' - The percentage of matching requests to instrument, after the reservoir
-- is exhausted.
--
-- 'hTTPMethod', 'samplingRuleUpdate_hTTPMethod' - Matches the HTTP method of a request.
--
-- 'host', 'samplingRuleUpdate_host' - Matches the hostname from a request URL.
--
-- 'priority', 'samplingRuleUpdate_priority' - The priority of the sampling rule.
--
-- 'reservoirSize', 'samplingRuleUpdate_reservoirSize' - A fixed number of matching requests to instrument per second, prior to
-- applying the fixed rate. The reservoir is not used directly by services,
-- but applies to all services using the rule collectively.
--
-- 'resourceARN', 'samplingRuleUpdate_resourceARN' - Matches the ARN of the Amazon Web Services resource on which the service
-- runs.
--
-- 'ruleARN', 'samplingRuleUpdate_ruleARN' - The ARN of the sampling rule. Specify a rule by either name or ARN, but
-- not both.
--
-- 'ruleName', 'samplingRuleUpdate_ruleName' - The name of the sampling rule. Specify a rule by either name or ARN, but
-- not both.
--
-- 'serviceName', 'samplingRuleUpdate_serviceName' - Matches the @name@ that the service uses to identify itself in segments.
--
-- 'serviceType', 'samplingRuleUpdate_serviceType' - Matches the @origin@ that the service uses to identify its type in
-- segments.
--
-- 'uRLPath', 'samplingRuleUpdate_uRLPath' - Matches the path from a request URL.
newSamplingRuleUpdate ::
  SamplingRuleUpdate
newSamplingRuleUpdate :: SamplingRuleUpdate
newSamplingRuleUpdate =
  SamplingRuleUpdate'
    { $sel:attributes:SamplingRuleUpdate' :: Maybe (HashMap Text Text)
attributes = forall a. Maybe a
Prelude.Nothing,
      $sel:fixedRate:SamplingRuleUpdate' :: Maybe Double
fixedRate = forall a. Maybe a
Prelude.Nothing,
      $sel:hTTPMethod:SamplingRuleUpdate' :: Maybe Text
hTTPMethod = forall a. Maybe a
Prelude.Nothing,
      $sel:host:SamplingRuleUpdate' :: Maybe Text
host = forall a. Maybe a
Prelude.Nothing,
      $sel:priority:SamplingRuleUpdate' :: Maybe Int
priority = forall a. Maybe a
Prelude.Nothing,
      $sel:reservoirSize:SamplingRuleUpdate' :: Maybe Int
reservoirSize = forall a. Maybe a
Prelude.Nothing,
      $sel:resourceARN:SamplingRuleUpdate' :: Maybe Text
resourceARN = forall a. Maybe a
Prelude.Nothing,
      $sel:ruleARN:SamplingRuleUpdate' :: Maybe Text
ruleARN = forall a. Maybe a
Prelude.Nothing,
      $sel:ruleName:SamplingRuleUpdate' :: Maybe Text
ruleName = forall a. Maybe a
Prelude.Nothing,
      $sel:serviceName:SamplingRuleUpdate' :: Maybe Text
serviceName = forall a. Maybe a
Prelude.Nothing,
      $sel:serviceType:SamplingRuleUpdate' :: Maybe Text
serviceType = forall a. Maybe a
Prelude.Nothing,
      $sel:uRLPath:SamplingRuleUpdate' :: Maybe Text
uRLPath = forall a. Maybe a
Prelude.Nothing
    }

-- | Matches attributes derived from the request.
samplingRuleUpdate_attributes :: Lens.Lens' SamplingRuleUpdate (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
samplingRuleUpdate_attributes :: Lens' SamplingRuleUpdate (Maybe (HashMap Text Text))
samplingRuleUpdate_attributes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SamplingRuleUpdate' {Maybe (HashMap Text Text)
attributes :: Maybe (HashMap Text Text)
$sel:attributes:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe (HashMap Text Text)
attributes} -> Maybe (HashMap Text Text)
attributes) (\s :: SamplingRuleUpdate
s@SamplingRuleUpdate' {} Maybe (HashMap Text Text)
a -> SamplingRuleUpdate
s {$sel:attributes:SamplingRuleUpdate' :: Maybe (HashMap Text Text)
attributes = Maybe (HashMap Text Text)
a} :: SamplingRuleUpdate) 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 s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The percentage of matching requests to instrument, after the reservoir
-- is exhausted.
samplingRuleUpdate_fixedRate :: Lens.Lens' SamplingRuleUpdate (Prelude.Maybe Prelude.Double)
samplingRuleUpdate_fixedRate :: Lens' SamplingRuleUpdate (Maybe Double)
samplingRuleUpdate_fixedRate = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SamplingRuleUpdate' {Maybe Double
fixedRate :: Maybe Double
$sel:fixedRate:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Double
fixedRate} -> Maybe Double
fixedRate) (\s :: SamplingRuleUpdate
s@SamplingRuleUpdate' {} Maybe Double
a -> SamplingRuleUpdate
s {$sel:fixedRate:SamplingRuleUpdate' :: Maybe Double
fixedRate = Maybe Double
a} :: SamplingRuleUpdate)

-- | Matches the HTTP method of a request.
samplingRuleUpdate_hTTPMethod :: Lens.Lens' SamplingRuleUpdate (Prelude.Maybe Prelude.Text)
samplingRuleUpdate_hTTPMethod :: Lens' SamplingRuleUpdate (Maybe Text)
samplingRuleUpdate_hTTPMethod = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SamplingRuleUpdate' {Maybe Text
hTTPMethod :: Maybe Text
$sel:hTTPMethod:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Text
hTTPMethod} -> Maybe Text
hTTPMethod) (\s :: SamplingRuleUpdate
s@SamplingRuleUpdate' {} Maybe Text
a -> SamplingRuleUpdate
s {$sel:hTTPMethod:SamplingRuleUpdate' :: Maybe Text
hTTPMethod = Maybe Text
a} :: SamplingRuleUpdate)

-- | Matches the hostname from a request URL.
samplingRuleUpdate_host :: Lens.Lens' SamplingRuleUpdate (Prelude.Maybe Prelude.Text)
samplingRuleUpdate_host :: Lens' SamplingRuleUpdate (Maybe Text)
samplingRuleUpdate_host = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SamplingRuleUpdate' {Maybe Text
host :: Maybe Text
$sel:host:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Text
host} -> Maybe Text
host) (\s :: SamplingRuleUpdate
s@SamplingRuleUpdate' {} Maybe Text
a -> SamplingRuleUpdate
s {$sel:host:SamplingRuleUpdate' :: Maybe Text
host = Maybe Text
a} :: SamplingRuleUpdate)

-- | The priority of the sampling rule.
samplingRuleUpdate_priority :: Lens.Lens' SamplingRuleUpdate (Prelude.Maybe Prelude.Int)
samplingRuleUpdate_priority :: Lens' SamplingRuleUpdate (Maybe Int)
samplingRuleUpdate_priority = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SamplingRuleUpdate' {Maybe Int
priority :: Maybe Int
$sel:priority:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Int
priority} -> Maybe Int
priority) (\s :: SamplingRuleUpdate
s@SamplingRuleUpdate' {} Maybe Int
a -> SamplingRuleUpdate
s {$sel:priority:SamplingRuleUpdate' :: Maybe Int
priority = Maybe Int
a} :: SamplingRuleUpdate)

-- | A fixed number of matching requests to instrument per second, prior to
-- applying the fixed rate. The reservoir is not used directly by services,
-- but applies to all services using the rule collectively.
samplingRuleUpdate_reservoirSize :: Lens.Lens' SamplingRuleUpdate (Prelude.Maybe Prelude.Int)
samplingRuleUpdate_reservoirSize :: Lens' SamplingRuleUpdate (Maybe Int)
samplingRuleUpdate_reservoirSize = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SamplingRuleUpdate' {Maybe Int
reservoirSize :: Maybe Int
$sel:reservoirSize:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Int
reservoirSize} -> Maybe Int
reservoirSize) (\s :: SamplingRuleUpdate
s@SamplingRuleUpdate' {} Maybe Int
a -> SamplingRuleUpdate
s {$sel:reservoirSize:SamplingRuleUpdate' :: Maybe Int
reservoirSize = Maybe Int
a} :: SamplingRuleUpdate)

-- | Matches the ARN of the Amazon Web Services resource on which the service
-- runs.
samplingRuleUpdate_resourceARN :: Lens.Lens' SamplingRuleUpdate (Prelude.Maybe Prelude.Text)
samplingRuleUpdate_resourceARN :: Lens' SamplingRuleUpdate (Maybe Text)
samplingRuleUpdate_resourceARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SamplingRuleUpdate' {Maybe Text
resourceARN :: Maybe Text
$sel:resourceARN:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Text
resourceARN} -> Maybe Text
resourceARN) (\s :: SamplingRuleUpdate
s@SamplingRuleUpdate' {} Maybe Text
a -> SamplingRuleUpdate
s {$sel:resourceARN:SamplingRuleUpdate' :: Maybe Text
resourceARN = Maybe Text
a} :: SamplingRuleUpdate)

-- | The ARN of the sampling rule. Specify a rule by either name or ARN, but
-- not both.
samplingRuleUpdate_ruleARN :: Lens.Lens' SamplingRuleUpdate (Prelude.Maybe Prelude.Text)
samplingRuleUpdate_ruleARN :: Lens' SamplingRuleUpdate (Maybe Text)
samplingRuleUpdate_ruleARN = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SamplingRuleUpdate' {Maybe Text
ruleARN :: Maybe Text
$sel:ruleARN:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Text
ruleARN} -> Maybe Text
ruleARN) (\s :: SamplingRuleUpdate
s@SamplingRuleUpdate' {} Maybe Text
a -> SamplingRuleUpdate
s {$sel:ruleARN:SamplingRuleUpdate' :: Maybe Text
ruleARN = Maybe Text
a} :: SamplingRuleUpdate)

-- | The name of the sampling rule. Specify a rule by either name or ARN, but
-- not both.
samplingRuleUpdate_ruleName :: Lens.Lens' SamplingRuleUpdate (Prelude.Maybe Prelude.Text)
samplingRuleUpdate_ruleName :: Lens' SamplingRuleUpdate (Maybe Text)
samplingRuleUpdate_ruleName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SamplingRuleUpdate' {Maybe Text
ruleName :: Maybe Text
$sel:ruleName:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Text
ruleName} -> Maybe Text
ruleName) (\s :: SamplingRuleUpdate
s@SamplingRuleUpdate' {} Maybe Text
a -> SamplingRuleUpdate
s {$sel:ruleName:SamplingRuleUpdate' :: Maybe Text
ruleName = Maybe Text
a} :: SamplingRuleUpdate)

-- | Matches the @name@ that the service uses to identify itself in segments.
samplingRuleUpdate_serviceName :: Lens.Lens' SamplingRuleUpdate (Prelude.Maybe Prelude.Text)
samplingRuleUpdate_serviceName :: Lens' SamplingRuleUpdate (Maybe Text)
samplingRuleUpdate_serviceName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SamplingRuleUpdate' {Maybe Text
serviceName :: Maybe Text
$sel:serviceName:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Text
serviceName} -> Maybe Text
serviceName) (\s :: SamplingRuleUpdate
s@SamplingRuleUpdate' {} Maybe Text
a -> SamplingRuleUpdate
s {$sel:serviceName:SamplingRuleUpdate' :: Maybe Text
serviceName = Maybe Text
a} :: SamplingRuleUpdate)

-- | Matches the @origin@ that the service uses to identify its type in
-- segments.
samplingRuleUpdate_serviceType :: Lens.Lens' SamplingRuleUpdate (Prelude.Maybe Prelude.Text)
samplingRuleUpdate_serviceType :: Lens' SamplingRuleUpdate (Maybe Text)
samplingRuleUpdate_serviceType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SamplingRuleUpdate' {Maybe Text
serviceType :: Maybe Text
$sel:serviceType:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Text
serviceType} -> Maybe Text
serviceType) (\s :: SamplingRuleUpdate
s@SamplingRuleUpdate' {} Maybe Text
a -> SamplingRuleUpdate
s {$sel:serviceType:SamplingRuleUpdate' :: Maybe Text
serviceType = Maybe Text
a} :: SamplingRuleUpdate)

-- | Matches the path from a request URL.
samplingRuleUpdate_uRLPath :: Lens.Lens' SamplingRuleUpdate (Prelude.Maybe Prelude.Text)
samplingRuleUpdate_uRLPath :: Lens' SamplingRuleUpdate (Maybe Text)
samplingRuleUpdate_uRLPath = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SamplingRuleUpdate' {Maybe Text
uRLPath :: Maybe Text
$sel:uRLPath:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Text
uRLPath} -> Maybe Text
uRLPath) (\s :: SamplingRuleUpdate
s@SamplingRuleUpdate' {} Maybe Text
a -> SamplingRuleUpdate
s {$sel:uRLPath:SamplingRuleUpdate' :: Maybe Text
uRLPath = Maybe Text
a} :: SamplingRuleUpdate)

instance Prelude.Hashable SamplingRuleUpdate where
  hashWithSalt :: Int -> SamplingRuleUpdate -> Int
hashWithSalt Int
_salt SamplingRuleUpdate' {Maybe Double
Maybe Int
Maybe Text
Maybe (HashMap Text Text)
uRLPath :: Maybe Text
serviceType :: Maybe Text
serviceName :: Maybe Text
ruleName :: Maybe Text
ruleARN :: Maybe Text
resourceARN :: Maybe Text
reservoirSize :: Maybe Int
priority :: Maybe Int
host :: Maybe Text
hTTPMethod :: Maybe Text
fixedRate :: Maybe Double
attributes :: Maybe (HashMap Text Text)
$sel:uRLPath:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Text
$sel:serviceType:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Text
$sel:serviceName:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Text
$sel:ruleName:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Text
$sel:ruleARN:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Text
$sel:resourceARN:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Text
$sel:reservoirSize:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Int
$sel:priority:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Int
$sel:host:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Text
$sel:hTTPMethod:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Text
$sel:fixedRate:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Double
$sel:attributes:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe (HashMap Text Text)
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (HashMap Text Text)
attributes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
fixedRate
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
hTTPMethod
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
host
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
priority
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
reservoirSize
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
resourceARN
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ruleARN
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ruleName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
serviceName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
serviceType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
uRLPath

instance Prelude.NFData SamplingRuleUpdate where
  rnf :: SamplingRuleUpdate -> ()
rnf SamplingRuleUpdate' {Maybe Double
Maybe Int
Maybe Text
Maybe (HashMap Text Text)
uRLPath :: Maybe Text
serviceType :: Maybe Text
serviceName :: Maybe Text
ruleName :: Maybe Text
ruleARN :: Maybe Text
resourceARN :: Maybe Text
reservoirSize :: Maybe Int
priority :: Maybe Int
host :: Maybe Text
hTTPMethod :: Maybe Text
fixedRate :: Maybe Double
attributes :: Maybe (HashMap Text Text)
$sel:uRLPath:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Text
$sel:serviceType:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Text
$sel:serviceName:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Text
$sel:ruleName:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Text
$sel:ruleARN:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Text
$sel:resourceARN:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Text
$sel:reservoirSize:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Int
$sel:priority:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Int
$sel:host:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Text
$sel:hTTPMethod:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Text
$sel:fixedRate:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Double
$sel:attributes:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe (HashMap Text Text)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (HashMap Text Text)
attributes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
fixedRate
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
hTTPMethod
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
host
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
priority
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
reservoirSize
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
resourceARN
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ruleARN
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ruleName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
serviceName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
serviceType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
uRLPath

instance Data.ToJSON SamplingRuleUpdate where
  toJSON :: SamplingRuleUpdate -> Value
toJSON SamplingRuleUpdate' {Maybe Double
Maybe Int
Maybe Text
Maybe (HashMap Text Text)
uRLPath :: Maybe Text
serviceType :: Maybe Text
serviceName :: Maybe Text
ruleName :: Maybe Text
ruleARN :: Maybe Text
resourceARN :: Maybe Text
reservoirSize :: Maybe Int
priority :: Maybe Int
host :: Maybe Text
hTTPMethod :: Maybe Text
fixedRate :: Maybe Double
attributes :: Maybe (HashMap Text Text)
$sel:uRLPath:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Text
$sel:serviceType:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Text
$sel:serviceName:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Text
$sel:ruleName:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Text
$sel:ruleARN:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Text
$sel:resourceARN:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Text
$sel:reservoirSize:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Int
$sel:priority:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Int
$sel:host:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Text
$sel:hTTPMethod:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Text
$sel:fixedRate:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe Double
$sel:attributes:SamplingRuleUpdate' :: SamplingRuleUpdate -> Maybe (HashMap Text Text)
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Attributes" 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 (HashMap Text Text)
attributes,
            (Key
"FixedRate" 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 Double
fixedRate,
            (Key
"HTTPMethod" 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
hTTPMethod,
            (Key
"Host" 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
host,
            (Key
"Priority" 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 Int
priority,
            (Key
"ReservoirSize" 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 Int
reservoirSize,
            (Key
"ResourceARN" 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
resourceARN,
            (Key
"RuleARN" 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
ruleARN,
            (Key
"RuleName" 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
ruleName,
            (Key
"ServiceName" 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
serviceName,
            (Key
"ServiceType" 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
serviceType,
            (Key
"URLPath" 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
uRLPath
          ]
      )