{-# 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.FraudDetector.UpdateRuleVersion
-- 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 rule version resulting in a new rule version. Updates a rule
-- version resulting in a new rule version (version 1, 2, 3 ...).
module Amazonka.FraudDetector.UpdateRuleVersion
  ( -- * Creating a Request
    UpdateRuleVersion (..),
    newUpdateRuleVersion,

    -- * Request Lenses
    updateRuleVersion_description,
    updateRuleVersion_tags,
    updateRuleVersion_rule,
    updateRuleVersion_expression,
    updateRuleVersion_language,
    updateRuleVersion_outcomes,

    -- * Destructuring the Response
    UpdateRuleVersionResponse (..),
    newUpdateRuleVersionResponse,

    -- * Response Lenses
    updateRuleVersionResponse_rule,
    updateRuleVersionResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import Amazonka.FraudDetector.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:/ 'newUpdateRuleVersion' smart constructor.
data UpdateRuleVersion = UpdateRuleVersion'
  { -- | The description.
    UpdateRuleVersion -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The tags to assign to the rule version.
    UpdateRuleVersion -> Maybe [Tag]
tags :: Prelude.Maybe [Tag],
    -- | The rule to update.
    UpdateRuleVersion -> Rule
rule :: Rule,
    -- | The rule expression.
    UpdateRuleVersion -> Sensitive Text
expression :: Core.Sensitive Prelude.Text,
    -- | The language.
    UpdateRuleVersion -> Language
language :: Language,
    -- | The outcomes.
    UpdateRuleVersion -> NonEmpty Text
outcomes :: Prelude.NonEmpty Prelude.Text
  }
  deriving (UpdateRuleVersion -> UpdateRuleVersion -> Bool
(UpdateRuleVersion -> UpdateRuleVersion -> Bool)
-> (UpdateRuleVersion -> UpdateRuleVersion -> Bool)
-> Eq UpdateRuleVersion
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRuleVersion -> UpdateRuleVersion -> Bool
$c/= :: UpdateRuleVersion -> UpdateRuleVersion -> Bool
== :: UpdateRuleVersion -> UpdateRuleVersion -> Bool
$c== :: UpdateRuleVersion -> UpdateRuleVersion -> Bool
Prelude.Eq, Int -> UpdateRuleVersion -> ShowS
[UpdateRuleVersion] -> ShowS
UpdateRuleVersion -> String
(Int -> UpdateRuleVersion -> ShowS)
-> (UpdateRuleVersion -> String)
-> ([UpdateRuleVersion] -> ShowS)
-> Show UpdateRuleVersion
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRuleVersion] -> ShowS
$cshowList :: [UpdateRuleVersion] -> ShowS
show :: UpdateRuleVersion -> String
$cshow :: UpdateRuleVersion -> String
showsPrec :: Int -> UpdateRuleVersion -> ShowS
$cshowsPrec :: Int -> UpdateRuleVersion -> ShowS
Prelude.Show, (forall x. UpdateRuleVersion -> Rep UpdateRuleVersion x)
-> (forall x. Rep UpdateRuleVersion x -> UpdateRuleVersion)
-> Generic UpdateRuleVersion
forall x. Rep UpdateRuleVersion x -> UpdateRuleVersion
forall x. UpdateRuleVersion -> Rep UpdateRuleVersion x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateRuleVersion x -> UpdateRuleVersion
$cfrom :: forall x. UpdateRuleVersion -> Rep UpdateRuleVersion x
Prelude.Generic)

-- |
-- Create a value of 'UpdateRuleVersion' 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:
--
-- 'description', 'updateRuleVersion_description' - The description.
--
-- 'tags', 'updateRuleVersion_tags' - The tags to assign to the rule version.
--
-- 'rule', 'updateRuleVersion_rule' - The rule to update.
--
-- 'expression', 'updateRuleVersion_expression' - The rule expression.
--
-- 'language', 'updateRuleVersion_language' - The language.
--
-- 'outcomes', 'updateRuleVersion_outcomes' - The outcomes.
newUpdateRuleVersion ::
  -- | 'rule'
  Rule ->
  -- | 'expression'
  Prelude.Text ->
  -- | 'language'
  Language ->
  -- | 'outcomes'
  Prelude.NonEmpty Prelude.Text ->
  UpdateRuleVersion
newUpdateRuleVersion :: Rule -> Text -> Language -> NonEmpty Text -> UpdateRuleVersion
newUpdateRuleVersion
  Rule
pRule_
  Text
pExpression_
  Language
pLanguage_
  NonEmpty Text
pOutcomes_ =
    UpdateRuleVersion' :: Maybe Text
-> Maybe [Tag]
-> Rule
-> Sensitive Text
-> Language
-> NonEmpty Text
-> UpdateRuleVersion
UpdateRuleVersion'
      { $sel:description:UpdateRuleVersion' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:UpdateRuleVersion' :: Maybe [Tag]
tags = Maybe [Tag]
forall a. Maybe a
Prelude.Nothing,
        $sel:rule:UpdateRuleVersion' :: Rule
rule = Rule
pRule_,
        $sel:expression:UpdateRuleVersion' :: Sensitive Text
expression = Tagged Text (Identity Text)
-> Tagged (Sensitive Text) (Identity (Sensitive Text))
forall a. Iso' (Sensitive a) a
Core._Sensitive (Tagged Text (Identity Text)
 -> Tagged (Sensitive Text) (Identity (Sensitive Text)))
-> Text -> Sensitive Text
forall t b. AReview t b -> b -> t
Lens.# Text
pExpression_,
        $sel:language:UpdateRuleVersion' :: Language
language = Language
pLanguage_,
        $sel:outcomes:UpdateRuleVersion' :: NonEmpty Text
outcomes = Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged (NonEmpty Text) (Identity (NonEmpty Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Text) (Identity (NonEmpty Text))
 -> Tagged (NonEmpty Text) (Identity (NonEmpty Text)))
-> NonEmpty Text -> NonEmpty Text
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pOutcomes_
      }

-- | The description.
updateRuleVersion_description :: Lens.Lens' UpdateRuleVersion (Prelude.Maybe Prelude.Text)
updateRuleVersion_description :: (Maybe Text -> f (Maybe Text))
-> UpdateRuleVersion -> f UpdateRuleVersion
updateRuleVersion_description = (UpdateRuleVersion -> Maybe Text)
-> (UpdateRuleVersion -> Maybe Text -> UpdateRuleVersion)
-> Lens
     UpdateRuleVersion UpdateRuleVersion (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRuleVersion' {Maybe Text
description :: Maybe Text
$sel:description:UpdateRuleVersion' :: UpdateRuleVersion -> Maybe Text
description} -> Maybe Text
description) (\s :: UpdateRuleVersion
s@UpdateRuleVersion' {} Maybe Text
a -> UpdateRuleVersion
s {$sel:description:UpdateRuleVersion' :: Maybe Text
description = Maybe Text
a} :: UpdateRuleVersion)

-- | The tags to assign to the rule version.
updateRuleVersion_tags :: Lens.Lens' UpdateRuleVersion (Prelude.Maybe [Tag])
updateRuleVersion_tags :: (Maybe [Tag] -> f (Maybe [Tag]))
-> UpdateRuleVersion -> f UpdateRuleVersion
updateRuleVersion_tags = (UpdateRuleVersion -> Maybe [Tag])
-> (UpdateRuleVersion -> Maybe [Tag] -> UpdateRuleVersion)
-> Lens
     UpdateRuleVersion UpdateRuleVersion (Maybe [Tag]) (Maybe [Tag])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRuleVersion' {Maybe [Tag]
tags :: Maybe [Tag]
$sel:tags:UpdateRuleVersion' :: UpdateRuleVersion -> Maybe [Tag]
tags} -> Maybe [Tag]
tags) (\s :: UpdateRuleVersion
s@UpdateRuleVersion' {} Maybe [Tag]
a -> UpdateRuleVersion
s {$sel:tags:UpdateRuleVersion' :: Maybe [Tag]
tags = Maybe [Tag]
a} :: UpdateRuleVersion) ((Maybe [Tag] -> f (Maybe [Tag]))
 -> UpdateRuleVersion -> f UpdateRuleVersion)
-> ((Maybe [Tag] -> f (Maybe [Tag]))
    -> Maybe [Tag] -> f (Maybe [Tag]))
-> (Maybe [Tag] -> f (Maybe [Tag]))
-> UpdateRuleVersion
-> f UpdateRuleVersion
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Tag] [Tag] [Tag] [Tag]
-> Iso (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag]) (Maybe [Tag])
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 [Tag] [Tag] [Tag] [Tag]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The rule to update.
updateRuleVersion_rule :: Lens.Lens' UpdateRuleVersion Rule
updateRuleVersion_rule :: (Rule -> f Rule) -> UpdateRuleVersion -> f UpdateRuleVersion
updateRuleVersion_rule = (UpdateRuleVersion -> Rule)
-> (UpdateRuleVersion -> Rule -> UpdateRuleVersion)
-> Lens UpdateRuleVersion UpdateRuleVersion Rule Rule
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRuleVersion' {Rule
rule :: Rule
$sel:rule:UpdateRuleVersion' :: UpdateRuleVersion -> Rule
rule} -> Rule
rule) (\s :: UpdateRuleVersion
s@UpdateRuleVersion' {} Rule
a -> UpdateRuleVersion
s {$sel:rule:UpdateRuleVersion' :: Rule
rule = Rule
a} :: UpdateRuleVersion)

-- | The rule expression.
updateRuleVersion_expression :: Lens.Lens' UpdateRuleVersion Prelude.Text
updateRuleVersion_expression :: (Text -> f Text) -> UpdateRuleVersion -> f UpdateRuleVersion
updateRuleVersion_expression = (UpdateRuleVersion -> Sensitive Text)
-> (UpdateRuleVersion -> Sensitive Text -> UpdateRuleVersion)
-> Lens
     UpdateRuleVersion
     UpdateRuleVersion
     (Sensitive Text)
     (Sensitive Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRuleVersion' {Sensitive Text
expression :: Sensitive Text
$sel:expression:UpdateRuleVersion' :: UpdateRuleVersion -> Sensitive Text
expression} -> Sensitive Text
expression) (\s :: UpdateRuleVersion
s@UpdateRuleVersion' {} Sensitive Text
a -> UpdateRuleVersion
s {$sel:expression:UpdateRuleVersion' :: Sensitive Text
expression = Sensitive Text
a} :: UpdateRuleVersion) ((Sensitive Text -> f (Sensitive Text))
 -> UpdateRuleVersion -> f UpdateRuleVersion)
-> ((Text -> f Text) -> Sensitive Text -> f (Sensitive Text))
-> (Text -> f Text)
-> UpdateRuleVersion
-> f UpdateRuleVersion
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (Text -> f Text) -> Sensitive Text -> f (Sensitive Text)
forall a. Iso' (Sensitive a) a
Core._Sensitive

-- | The language.
updateRuleVersion_language :: Lens.Lens' UpdateRuleVersion Language
updateRuleVersion_language :: (Language -> f Language)
-> UpdateRuleVersion -> f UpdateRuleVersion
updateRuleVersion_language = (UpdateRuleVersion -> Language)
-> (UpdateRuleVersion -> Language -> UpdateRuleVersion)
-> Lens UpdateRuleVersion UpdateRuleVersion Language Language
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRuleVersion' {Language
language :: Language
$sel:language:UpdateRuleVersion' :: UpdateRuleVersion -> Language
language} -> Language
language) (\s :: UpdateRuleVersion
s@UpdateRuleVersion' {} Language
a -> UpdateRuleVersion
s {$sel:language:UpdateRuleVersion' :: Language
language = Language
a} :: UpdateRuleVersion)

-- | The outcomes.
updateRuleVersion_outcomes :: Lens.Lens' UpdateRuleVersion (Prelude.NonEmpty Prelude.Text)
updateRuleVersion_outcomes :: (NonEmpty Text -> f (NonEmpty Text))
-> UpdateRuleVersion -> f UpdateRuleVersion
updateRuleVersion_outcomes = (UpdateRuleVersion -> NonEmpty Text)
-> (UpdateRuleVersion -> NonEmpty Text -> UpdateRuleVersion)
-> Lens
     UpdateRuleVersion UpdateRuleVersion (NonEmpty Text) (NonEmpty Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRuleVersion' {NonEmpty Text
outcomes :: NonEmpty Text
$sel:outcomes:UpdateRuleVersion' :: UpdateRuleVersion -> NonEmpty Text
outcomes} -> NonEmpty Text
outcomes) (\s :: UpdateRuleVersion
s@UpdateRuleVersion' {} NonEmpty Text
a -> UpdateRuleVersion
s {$sel:outcomes:UpdateRuleVersion' :: NonEmpty Text
outcomes = NonEmpty Text
a} :: UpdateRuleVersion) ((NonEmpty Text -> f (NonEmpty Text))
 -> UpdateRuleVersion -> f UpdateRuleVersion)
-> ((NonEmpty Text -> f (NonEmpty Text))
    -> NonEmpty Text -> f (NonEmpty Text))
-> (NonEmpty Text -> f (NonEmpty Text))
-> UpdateRuleVersion
-> f UpdateRuleVersion
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty Text -> f (NonEmpty Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData UpdateRuleVersion

instance Core.ToHeaders UpdateRuleVersion where
  toHeaders :: UpdateRuleVersion -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateRuleVersion -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"AWSHawksNestServiceFacade.UpdateRuleVersion" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON UpdateRuleVersion where
  toJSON :: UpdateRuleVersion -> Value
toJSON UpdateRuleVersion' {Maybe [Tag]
Maybe Text
NonEmpty Text
Sensitive Text
Language
Rule
outcomes :: NonEmpty Text
language :: Language
expression :: Sensitive Text
rule :: Rule
tags :: Maybe [Tag]
description :: Maybe Text
$sel:outcomes:UpdateRuleVersion' :: UpdateRuleVersion -> NonEmpty Text
$sel:language:UpdateRuleVersion' :: UpdateRuleVersion -> Language
$sel:expression:UpdateRuleVersion' :: UpdateRuleVersion -> Sensitive Text
$sel:rule:UpdateRuleVersion' :: UpdateRuleVersion -> Rule
$sel:tags:UpdateRuleVersion' :: UpdateRuleVersion -> Maybe [Tag]
$sel:description:UpdateRuleVersion' :: UpdateRuleVersion -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"description" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
description,
            (Text
"tags" Text -> [Tag] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) ([Tag] -> Pair) -> Maybe [Tag] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Tag]
tags,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"rule" Text -> Rule -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Rule
rule),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"expression" Text -> Sensitive Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Sensitive Text
expression),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"language" Text -> Language -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Language
language),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"outcomes" Text -> NonEmpty Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= NonEmpty Text
outcomes)
          ]
      )

instance Core.ToPath UpdateRuleVersion where
  toPath :: UpdateRuleVersion -> ByteString
toPath = ByteString -> UpdateRuleVersion -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newUpdateRuleVersionResponse' smart constructor.
data UpdateRuleVersionResponse = UpdateRuleVersionResponse'
  { -- | The new rule version that was created.
    UpdateRuleVersionResponse -> Maybe Rule
rule :: Prelude.Maybe Rule,
    -- | The response's http status code.
    UpdateRuleVersionResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateRuleVersionResponse -> UpdateRuleVersionResponse -> Bool
(UpdateRuleVersionResponse -> UpdateRuleVersionResponse -> Bool)
-> (UpdateRuleVersionResponse -> UpdateRuleVersionResponse -> Bool)
-> Eq UpdateRuleVersionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateRuleVersionResponse -> UpdateRuleVersionResponse -> Bool
$c/= :: UpdateRuleVersionResponse -> UpdateRuleVersionResponse -> Bool
== :: UpdateRuleVersionResponse -> UpdateRuleVersionResponse -> Bool
$c== :: UpdateRuleVersionResponse -> UpdateRuleVersionResponse -> Bool
Prelude.Eq, ReadPrec [UpdateRuleVersionResponse]
ReadPrec UpdateRuleVersionResponse
Int -> ReadS UpdateRuleVersionResponse
ReadS [UpdateRuleVersionResponse]
(Int -> ReadS UpdateRuleVersionResponse)
-> ReadS [UpdateRuleVersionResponse]
-> ReadPrec UpdateRuleVersionResponse
-> ReadPrec [UpdateRuleVersionResponse]
-> Read UpdateRuleVersionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateRuleVersionResponse]
$creadListPrec :: ReadPrec [UpdateRuleVersionResponse]
readPrec :: ReadPrec UpdateRuleVersionResponse
$creadPrec :: ReadPrec UpdateRuleVersionResponse
readList :: ReadS [UpdateRuleVersionResponse]
$creadList :: ReadS [UpdateRuleVersionResponse]
readsPrec :: Int -> ReadS UpdateRuleVersionResponse
$creadsPrec :: Int -> ReadS UpdateRuleVersionResponse
Prelude.Read, Int -> UpdateRuleVersionResponse -> ShowS
[UpdateRuleVersionResponse] -> ShowS
UpdateRuleVersionResponse -> String
(Int -> UpdateRuleVersionResponse -> ShowS)
-> (UpdateRuleVersionResponse -> String)
-> ([UpdateRuleVersionResponse] -> ShowS)
-> Show UpdateRuleVersionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateRuleVersionResponse] -> ShowS
$cshowList :: [UpdateRuleVersionResponse] -> ShowS
show :: UpdateRuleVersionResponse -> String
$cshow :: UpdateRuleVersionResponse -> String
showsPrec :: Int -> UpdateRuleVersionResponse -> ShowS
$cshowsPrec :: Int -> UpdateRuleVersionResponse -> ShowS
Prelude.Show, (forall x.
 UpdateRuleVersionResponse -> Rep UpdateRuleVersionResponse x)
-> (forall x.
    Rep UpdateRuleVersionResponse x -> UpdateRuleVersionResponse)
-> Generic UpdateRuleVersionResponse
forall x.
Rep UpdateRuleVersionResponse x -> UpdateRuleVersionResponse
forall x.
UpdateRuleVersionResponse -> Rep UpdateRuleVersionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep UpdateRuleVersionResponse x -> UpdateRuleVersionResponse
$cfrom :: forall x.
UpdateRuleVersionResponse -> Rep UpdateRuleVersionResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateRuleVersionResponse' 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:
--
-- 'rule', 'updateRuleVersionResponse_rule' - The new rule version that was created.
--
-- 'httpStatus', 'updateRuleVersionResponse_httpStatus' - The response's http status code.
newUpdateRuleVersionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateRuleVersionResponse
newUpdateRuleVersionResponse :: Int -> UpdateRuleVersionResponse
newUpdateRuleVersionResponse Int
pHttpStatus_ =
  UpdateRuleVersionResponse' :: Maybe Rule -> Int -> UpdateRuleVersionResponse
UpdateRuleVersionResponse'
    { $sel:rule:UpdateRuleVersionResponse' :: Maybe Rule
rule = Maybe Rule
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateRuleVersionResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The new rule version that was created.
updateRuleVersionResponse_rule :: Lens.Lens' UpdateRuleVersionResponse (Prelude.Maybe Rule)
updateRuleVersionResponse_rule :: (Maybe Rule -> f (Maybe Rule))
-> UpdateRuleVersionResponse -> f UpdateRuleVersionResponse
updateRuleVersionResponse_rule = (UpdateRuleVersionResponse -> Maybe Rule)
-> (UpdateRuleVersionResponse
    -> Maybe Rule -> UpdateRuleVersionResponse)
-> Lens
     UpdateRuleVersionResponse
     UpdateRuleVersionResponse
     (Maybe Rule)
     (Maybe Rule)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateRuleVersionResponse' {Maybe Rule
rule :: Maybe Rule
$sel:rule:UpdateRuleVersionResponse' :: UpdateRuleVersionResponse -> Maybe Rule
rule} -> Maybe Rule
rule) (\s :: UpdateRuleVersionResponse
s@UpdateRuleVersionResponse' {} Maybe Rule
a -> UpdateRuleVersionResponse
s {$sel:rule:UpdateRuleVersionResponse' :: Maybe Rule
rule = Maybe Rule
a} :: UpdateRuleVersionResponse)

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

instance Prelude.NFData UpdateRuleVersionResponse