{-# 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.AMP.PutRuleGroupsNamespace
-- 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)
--
-- Update a rule groups namespace.
module Amazonka.AMP.PutRuleGroupsNamespace
  ( -- * Creating a Request
    PutRuleGroupsNamespace (..),
    newPutRuleGroupsNamespace,

    -- * Request Lenses
    putRuleGroupsNamespace_clientToken,
    putRuleGroupsNamespace_data,
    putRuleGroupsNamespace_name,
    putRuleGroupsNamespace_workspaceId,

    -- * Destructuring the Response
    PutRuleGroupsNamespaceResponse (..),
    newPutRuleGroupsNamespaceResponse,

    -- * Response Lenses
    putRuleGroupsNamespaceResponse_tags,
    putRuleGroupsNamespaceResponse_httpStatus,
    putRuleGroupsNamespaceResponse_arn,
    putRuleGroupsNamespaceResponse_name,
    putRuleGroupsNamespaceResponse_status,
  )
where

import Amazonka.AMP.Types
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Represents the input of a PutRuleGroupsNamespace operation.
--
-- /See:/ 'newPutRuleGroupsNamespace' smart constructor.
data PutRuleGroupsNamespace = PutRuleGroupsNamespace'
  { -- | Optional, unique, case-sensitive, user-provided identifier to ensure the
    -- idempotency of the request.
    PutRuleGroupsNamespace -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The namespace data that define the rule groups.
    PutRuleGroupsNamespace -> Base64
data' :: Core.Base64,
    -- | The rule groups namespace name.
    PutRuleGroupsNamespace -> Text
name :: Prelude.Text,
    -- | The ID of the workspace in which to update the rule group namespace.
    PutRuleGroupsNamespace -> Text
workspaceId :: Prelude.Text
  }
  deriving (PutRuleGroupsNamespace -> PutRuleGroupsNamespace -> Bool
(PutRuleGroupsNamespace -> PutRuleGroupsNamespace -> Bool)
-> (PutRuleGroupsNamespace -> PutRuleGroupsNamespace -> Bool)
-> Eq PutRuleGroupsNamespace
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutRuleGroupsNamespace -> PutRuleGroupsNamespace -> Bool
$c/= :: PutRuleGroupsNamespace -> PutRuleGroupsNamespace -> Bool
== :: PutRuleGroupsNamespace -> PutRuleGroupsNamespace -> Bool
$c== :: PutRuleGroupsNamespace -> PutRuleGroupsNamespace -> Bool
Prelude.Eq, ReadPrec [PutRuleGroupsNamespace]
ReadPrec PutRuleGroupsNamespace
Int -> ReadS PutRuleGroupsNamespace
ReadS [PutRuleGroupsNamespace]
(Int -> ReadS PutRuleGroupsNamespace)
-> ReadS [PutRuleGroupsNamespace]
-> ReadPrec PutRuleGroupsNamespace
-> ReadPrec [PutRuleGroupsNamespace]
-> Read PutRuleGroupsNamespace
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutRuleGroupsNamespace]
$creadListPrec :: ReadPrec [PutRuleGroupsNamespace]
readPrec :: ReadPrec PutRuleGroupsNamespace
$creadPrec :: ReadPrec PutRuleGroupsNamespace
readList :: ReadS [PutRuleGroupsNamespace]
$creadList :: ReadS [PutRuleGroupsNamespace]
readsPrec :: Int -> ReadS PutRuleGroupsNamespace
$creadsPrec :: Int -> ReadS PutRuleGroupsNamespace
Prelude.Read, Int -> PutRuleGroupsNamespace -> ShowS
[PutRuleGroupsNamespace] -> ShowS
PutRuleGroupsNamespace -> String
(Int -> PutRuleGroupsNamespace -> ShowS)
-> (PutRuleGroupsNamespace -> String)
-> ([PutRuleGroupsNamespace] -> ShowS)
-> Show PutRuleGroupsNamespace
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutRuleGroupsNamespace] -> ShowS
$cshowList :: [PutRuleGroupsNamespace] -> ShowS
show :: PutRuleGroupsNamespace -> String
$cshow :: PutRuleGroupsNamespace -> String
showsPrec :: Int -> PutRuleGroupsNamespace -> ShowS
$cshowsPrec :: Int -> PutRuleGroupsNamespace -> ShowS
Prelude.Show, (forall x. PutRuleGroupsNamespace -> Rep PutRuleGroupsNamespace x)
-> (forall x.
    Rep PutRuleGroupsNamespace x -> PutRuleGroupsNamespace)
-> Generic PutRuleGroupsNamespace
forall x. Rep PutRuleGroupsNamespace x -> PutRuleGroupsNamespace
forall x. PutRuleGroupsNamespace -> Rep PutRuleGroupsNamespace x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PutRuleGroupsNamespace x -> PutRuleGroupsNamespace
$cfrom :: forall x. PutRuleGroupsNamespace -> Rep PutRuleGroupsNamespace x
Prelude.Generic)

-- |
-- Create a value of 'PutRuleGroupsNamespace' 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:
--
-- 'clientToken', 'putRuleGroupsNamespace_clientToken' - Optional, unique, case-sensitive, user-provided identifier to ensure the
-- idempotency of the request.
--
-- 'data'', 'putRuleGroupsNamespace_data' - The namespace data that define the rule groups.--
-- -- /Note:/ This 'Lens' automatically encodes and decodes Base64 data.
-- -- The underlying isomorphism will encode to Base64 representation during
-- -- serialisation, and decode from Base64 representation during deserialisation.
-- -- This 'Lens' accepts and returns only raw unencoded data.
--
-- 'name', 'putRuleGroupsNamespace_name' - The rule groups namespace name.
--
-- 'workspaceId', 'putRuleGroupsNamespace_workspaceId' - The ID of the workspace in which to update the rule group namespace.
newPutRuleGroupsNamespace ::
  -- | 'data''
  Prelude.ByteString ->
  -- | 'name'
  Prelude.Text ->
  -- | 'workspaceId'
  Prelude.Text ->
  PutRuleGroupsNamespace
newPutRuleGroupsNamespace :: ByteString -> Text -> Text -> PutRuleGroupsNamespace
newPutRuleGroupsNamespace ByteString
pData_ Text
pName_ Text
pWorkspaceId_ =
  PutRuleGroupsNamespace' :: Maybe Text -> Base64 -> Text -> Text -> PutRuleGroupsNamespace
PutRuleGroupsNamespace'
    { $sel:clientToken:PutRuleGroupsNamespace' :: Maybe Text
clientToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:data':PutRuleGroupsNamespace' :: Base64
data' = Tagged ByteString (Identity ByteString)
-> Tagged Base64 (Identity Base64)
Iso' Base64 ByteString
Core._Base64 (Tagged ByteString (Identity ByteString)
 -> Tagged Base64 (Identity Base64))
-> ByteString -> Base64
forall t b. AReview t b -> b -> t
Lens.# ByteString
pData_,
      $sel:name:PutRuleGroupsNamespace' :: Text
name = Text
pName_,
      $sel:workspaceId:PutRuleGroupsNamespace' :: Text
workspaceId = Text
pWorkspaceId_
    }

-- | Optional, unique, case-sensitive, user-provided identifier to ensure the
-- idempotency of the request.
putRuleGroupsNamespace_clientToken :: Lens.Lens' PutRuleGroupsNamespace (Prelude.Maybe Prelude.Text)
putRuleGroupsNamespace_clientToken :: (Maybe Text -> f (Maybe Text))
-> PutRuleGroupsNamespace -> f PutRuleGroupsNamespace
putRuleGroupsNamespace_clientToken = (PutRuleGroupsNamespace -> Maybe Text)
-> (PutRuleGroupsNamespace -> Maybe Text -> PutRuleGroupsNamespace)
-> Lens
     PutRuleGroupsNamespace
     PutRuleGroupsNamespace
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRuleGroupsNamespace' {Maybe Text
clientToken :: Maybe Text
$sel:clientToken:PutRuleGroupsNamespace' :: PutRuleGroupsNamespace -> Maybe Text
clientToken} -> Maybe Text
clientToken) (\s :: PutRuleGroupsNamespace
s@PutRuleGroupsNamespace' {} Maybe Text
a -> PutRuleGroupsNamespace
s {$sel:clientToken:PutRuleGroupsNamespace' :: Maybe Text
clientToken = Maybe Text
a} :: PutRuleGroupsNamespace)

-- | The namespace data that define the rule groups.--
-- -- /Note:/ This 'Lens' automatically encodes and decodes Base64 data.
-- -- The underlying isomorphism will encode to Base64 representation during
-- -- serialisation, and decode from Base64 representation during deserialisation.
-- -- This 'Lens' accepts and returns only raw unencoded data.
putRuleGroupsNamespace_data :: Lens.Lens' PutRuleGroupsNamespace Prelude.ByteString
putRuleGroupsNamespace_data :: (ByteString -> f ByteString)
-> PutRuleGroupsNamespace -> f PutRuleGroupsNamespace
putRuleGroupsNamespace_data = (PutRuleGroupsNamespace -> Base64)
-> (PutRuleGroupsNamespace -> Base64 -> PutRuleGroupsNamespace)
-> Lens PutRuleGroupsNamespace PutRuleGroupsNamespace Base64 Base64
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRuleGroupsNamespace' {Base64
data' :: Base64
$sel:data':PutRuleGroupsNamespace' :: PutRuleGroupsNamespace -> Base64
data'} -> Base64
data') (\s :: PutRuleGroupsNamespace
s@PutRuleGroupsNamespace' {} Base64
a -> PutRuleGroupsNamespace
s {$sel:data':PutRuleGroupsNamespace' :: Base64
data' = Base64
a} :: PutRuleGroupsNamespace) ((Base64 -> f Base64)
 -> PutRuleGroupsNamespace -> f PutRuleGroupsNamespace)
-> ((ByteString -> f ByteString) -> Base64 -> f Base64)
-> (ByteString -> f ByteString)
-> PutRuleGroupsNamespace
-> f PutRuleGroupsNamespace
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ByteString -> f ByteString) -> Base64 -> f Base64
Iso' Base64 ByteString
Core._Base64

-- | The rule groups namespace name.
putRuleGroupsNamespace_name :: Lens.Lens' PutRuleGroupsNamespace Prelude.Text
putRuleGroupsNamespace_name :: (Text -> f Text)
-> PutRuleGroupsNamespace -> f PutRuleGroupsNamespace
putRuleGroupsNamespace_name = (PutRuleGroupsNamespace -> Text)
-> (PutRuleGroupsNamespace -> Text -> PutRuleGroupsNamespace)
-> Lens PutRuleGroupsNamespace PutRuleGroupsNamespace Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRuleGroupsNamespace' {Text
name :: Text
$sel:name:PutRuleGroupsNamespace' :: PutRuleGroupsNamespace -> Text
name} -> Text
name) (\s :: PutRuleGroupsNamespace
s@PutRuleGroupsNamespace' {} Text
a -> PutRuleGroupsNamespace
s {$sel:name:PutRuleGroupsNamespace' :: Text
name = Text
a} :: PutRuleGroupsNamespace)

-- | The ID of the workspace in which to update the rule group namespace.
putRuleGroupsNamespace_workspaceId :: Lens.Lens' PutRuleGroupsNamespace Prelude.Text
putRuleGroupsNamespace_workspaceId :: (Text -> f Text)
-> PutRuleGroupsNamespace -> f PutRuleGroupsNamespace
putRuleGroupsNamespace_workspaceId = (PutRuleGroupsNamespace -> Text)
-> (PutRuleGroupsNamespace -> Text -> PutRuleGroupsNamespace)
-> Lens PutRuleGroupsNamespace PutRuleGroupsNamespace Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRuleGroupsNamespace' {Text
workspaceId :: Text
$sel:workspaceId:PutRuleGroupsNamespace' :: PutRuleGroupsNamespace -> Text
workspaceId} -> Text
workspaceId) (\s :: PutRuleGroupsNamespace
s@PutRuleGroupsNamespace' {} Text
a -> PutRuleGroupsNamespace
s {$sel:workspaceId:PutRuleGroupsNamespace' :: Text
workspaceId = Text
a} :: PutRuleGroupsNamespace)

instance Core.AWSRequest PutRuleGroupsNamespace where
  type
    AWSResponse PutRuleGroupsNamespace =
      PutRuleGroupsNamespaceResponse
  request :: PutRuleGroupsNamespace -> Request PutRuleGroupsNamespace
request = Service -> PutRuleGroupsNamespace -> Request PutRuleGroupsNamespace
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.putJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy PutRuleGroupsNamespace
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse PutRuleGroupsNamespace)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse PutRuleGroupsNamespace))
-> Logger
-> Service
-> Proxy PutRuleGroupsNamespace
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse PutRuleGroupsNamespace)))
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 (HashMap Text Text)
-> Int
-> Text
-> Text
-> RuleGroupsNamespaceStatus
-> PutRuleGroupsNamespaceResponse
PutRuleGroupsNamespaceResponse'
            (Maybe (HashMap Text Text)
 -> Int
 -> Text
 -> Text
 -> RuleGroupsNamespaceStatus
 -> PutRuleGroupsNamespaceResponse)
-> Either String (Maybe (HashMap Text Text))
-> Either
     String
     (Int
      -> Text
      -> Text
      -> RuleGroupsNamespaceStatus
      -> PutRuleGroupsNamespaceResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"tags" Either String (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text)
-> Either String (Maybe (HashMap Text Text))
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Either
  String
  (Int
   -> Text
   -> Text
   -> RuleGroupsNamespaceStatus
   -> PutRuleGroupsNamespaceResponse)
-> Either String Int
-> Either
     String
     (Text
      -> Text
      -> RuleGroupsNamespaceStatus
      -> PutRuleGroupsNamespaceResponse)
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))
            Either
  String
  (Text
   -> Text
   -> RuleGroupsNamespaceStatus
   -> PutRuleGroupsNamespaceResponse)
-> Either String Text
-> Either
     String
     (Text
      -> RuleGroupsNamespaceStatus -> PutRuleGroupsNamespaceResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"arn")
            Either
  String
  (Text
   -> RuleGroupsNamespaceStatus -> PutRuleGroupsNamespaceResponse)
-> Either String Text
-> Either
     String
     (RuleGroupsNamespaceStatus -> PutRuleGroupsNamespaceResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String Text
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"name")
            Either
  String
  (RuleGroupsNamespaceStatus -> PutRuleGroupsNamespaceResponse)
-> Either String RuleGroupsNamespaceStatus
-> Either String PutRuleGroupsNamespaceResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String RuleGroupsNamespaceStatus
forall a. FromJSON a => Object -> Text -> Either String a
Core..:> Text
"status")
      )

instance Prelude.Hashable PutRuleGroupsNamespace

instance Prelude.NFData PutRuleGroupsNamespace

instance Core.ToHeaders PutRuleGroupsNamespace where
  toHeaders :: PutRuleGroupsNamespace -> ResponseHeaders
toHeaders =
    ResponseHeaders -> PutRuleGroupsNamespace -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ 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 PutRuleGroupsNamespace where
  toJSON :: PutRuleGroupsNamespace -> Value
toJSON PutRuleGroupsNamespace' {Maybe Text
Text
Base64
workspaceId :: Text
name :: Text
data' :: Base64
clientToken :: Maybe Text
$sel:workspaceId:PutRuleGroupsNamespace' :: PutRuleGroupsNamespace -> Text
$sel:name:PutRuleGroupsNamespace' :: PutRuleGroupsNamespace -> Text
$sel:data':PutRuleGroupsNamespace' :: PutRuleGroupsNamespace -> Base64
$sel:clientToken:PutRuleGroupsNamespace' :: PutRuleGroupsNamespace -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"clientToken" 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
clientToken,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"data" Text -> Base64 -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Base64
data')
          ]
      )

instance Core.ToPath PutRuleGroupsNamespace where
  toPath :: PutRuleGroupsNamespace -> ByteString
toPath PutRuleGroupsNamespace' {Maybe Text
Text
Base64
workspaceId :: Text
name :: Text
data' :: Base64
clientToken :: Maybe Text
$sel:workspaceId:PutRuleGroupsNamespace' :: PutRuleGroupsNamespace -> Text
$sel:name:PutRuleGroupsNamespace' :: PutRuleGroupsNamespace -> Text
$sel:data':PutRuleGroupsNamespace' :: PutRuleGroupsNamespace -> Base64
$sel:clientToken:PutRuleGroupsNamespace' :: PutRuleGroupsNamespace -> Maybe Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/workspaces/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
workspaceId,
        ByteString
"/rulegroupsnamespaces/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
name
      ]

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

-- | Represents the output of a PutRuleGroupsNamespace operation.
--
-- /See:/ 'newPutRuleGroupsNamespaceResponse' smart constructor.
data PutRuleGroupsNamespaceResponse = PutRuleGroupsNamespaceResponse'
  { -- | The tags of this rule groups namespace.
    PutRuleGroupsNamespaceResponse -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The response's http status code.
    PutRuleGroupsNamespaceResponse -> Int
httpStatus :: Prelude.Int,
    -- | The Amazon Resource Name (ARN) of this rule groups namespace.
    PutRuleGroupsNamespaceResponse -> Text
arn :: Prelude.Text,
    -- | The rule groups namespace name.
    PutRuleGroupsNamespaceResponse -> Text
name :: Prelude.Text,
    -- | The status of rule groups namespace.
    PutRuleGroupsNamespaceResponse -> RuleGroupsNamespaceStatus
status :: RuleGroupsNamespaceStatus
  }
  deriving (PutRuleGroupsNamespaceResponse
-> PutRuleGroupsNamespaceResponse -> Bool
(PutRuleGroupsNamespaceResponse
 -> PutRuleGroupsNamespaceResponse -> Bool)
-> (PutRuleGroupsNamespaceResponse
    -> PutRuleGroupsNamespaceResponse -> Bool)
-> Eq PutRuleGroupsNamespaceResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PutRuleGroupsNamespaceResponse
-> PutRuleGroupsNamespaceResponse -> Bool
$c/= :: PutRuleGroupsNamespaceResponse
-> PutRuleGroupsNamespaceResponse -> Bool
== :: PutRuleGroupsNamespaceResponse
-> PutRuleGroupsNamespaceResponse -> Bool
$c== :: PutRuleGroupsNamespaceResponse
-> PutRuleGroupsNamespaceResponse -> Bool
Prelude.Eq, ReadPrec [PutRuleGroupsNamespaceResponse]
ReadPrec PutRuleGroupsNamespaceResponse
Int -> ReadS PutRuleGroupsNamespaceResponse
ReadS [PutRuleGroupsNamespaceResponse]
(Int -> ReadS PutRuleGroupsNamespaceResponse)
-> ReadS [PutRuleGroupsNamespaceResponse]
-> ReadPrec PutRuleGroupsNamespaceResponse
-> ReadPrec [PutRuleGroupsNamespaceResponse]
-> Read PutRuleGroupsNamespaceResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PutRuleGroupsNamespaceResponse]
$creadListPrec :: ReadPrec [PutRuleGroupsNamespaceResponse]
readPrec :: ReadPrec PutRuleGroupsNamespaceResponse
$creadPrec :: ReadPrec PutRuleGroupsNamespaceResponse
readList :: ReadS [PutRuleGroupsNamespaceResponse]
$creadList :: ReadS [PutRuleGroupsNamespaceResponse]
readsPrec :: Int -> ReadS PutRuleGroupsNamespaceResponse
$creadsPrec :: Int -> ReadS PutRuleGroupsNamespaceResponse
Prelude.Read, Int -> PutRuleGroupsNamespaceResponse -> ShowS
[PutRuleGroupsNamespaceResponse] -> ShowS
PutRuleGroupsNamespaceResponse -> String
(Int -> PutRuleGroupsNamespaceResponse -> ShowS)
-> (PutRuleGroupsNamespaceResponse -> String)
-> ([PutRuleGroupsNamespaceResponse] -> ShowS)
-> Show PutRuleGroupsNamespaceResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PutRuleGroupsNamespaceResponse] -> ShowS
$cshowList :: [PutRuleGroupsNamespaceResponse] -> ShowS
show :: PutRuleGroupsNamespaceResponse -> String
$cshow :: PutRuleGroupsNamespaceResponse -> String
showsPrec :: Int -> PutRuleGroupsNamespaceResponse -> ShowS
$cshowsPrec :: Int -> PutRuleGroupsNamespaceResponse -> ShowS
Prelude.Show, (forall x.
 PutRuleGroupsNamespaceResponse
 -> Rep PutRuleGroupsNamespaceResponse x)
-> (forall x.
    Rep PutRuleGroupsNamespaceResponse x
    -> PutRuleGroupsNamespaceResponse)
-> Generic PutRuleGroupsNamespaceResponse
forall x.
Rep PutRuleGroupsNamespaceResponse x
-> PutRuleGroupsNamespaceResponse
forall x.
PutRuleGroupsNamespaceResponse
-> Rep PutRuleGroupsNamespaceResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PutRuleGroupsNamespaceResponse x
-> PutRuleGroupsNamespaceResponse
$cfrom :: forall x.
PutRuleGroupsNamespaceResponse
-> Rep PutRuleGroupsNamespaceResponse x
Prelude.Generic)

-- |
-- Create a value of 'PutRuleGroupsNamespaceResponse' 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:
--
-- 'tags', 'putRuleGroupsNamespaceResponse_tags' - The tags of this rule groups namespace.
--
-- 'httpStatus', 'putRuleGroupsNamespaceResponse_httpStatus' - The response's http status code.
--
-- 'arn', 'putRuleGroupsNamespaceResponse_arn' - The Amazon Resource Name (ARN) of this rule groups namespace.
--
-- 'name', 'putRuleGroupsNamespaceResponse_name' - The rule groups namespace name.
--
-- 'status', 'putRuleGroupsNamespaceResponse_status' - The status of rule groups namespace.
newPutRuleGroupsNamespaceResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'arn'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  -- | 'status'
  RuleGroupsNamespaceStatus ->
  PutRuleGroupsNamespaceResponse
newPutRuleGroupsNamespaceResponse :: Int
-> Text
-> Text
-> RuleGroupsNamespaceStatus
-> PutRuleGroupsNamespaceResponse
newPutRuleGroupsNamespaceResponse
  Int
pHttpStatus_
  Text
pArn_
  Text
pName_
  RuleGroupsNamespaceStatus
pStatus_ =
    PutRuleGroupsNamespaceResponse' :: Maybe (HashMap Text Text)
-> Int
-> Text
-> Text
-> RuleGroupsNamespaceStatus
-> PutRuleGroupsNamespaceResponse
PutRuleGroupsNamespaceResponse'
      { $sel:tags:PutRuleGroupsNamespaceResponse' :: Maybe (HashMap Text Text)
tags =
          Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:PutRuleGroupsNamespaceResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:arn:PutRuleGroupsNamespaceResponse' :: Text
arn = Text
pArn_,
        $sel:name:PutRuleGroupsNamespaceResponse' :: Text
name = Text
pName_,
        $sel:status:PutRuleGroupsNamespaceResponse' :: RuleGroupsNamespaceStatus
status = RuleGroupsNamespaceStatus
pStatus_
      }

-- | The tags of this rule groups namespace.
putRuleGroupsNamespaceResponse_tags :: Lens.Lens' PutRuleGroupsNamespaceResponse (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
putRuleGroupsNamespaceResponse_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> PutRuleGroupsNamespaceResponse
-> f PutRuleGroupsNamespaceResponse
putRuleGroupsNamespaceResponse_tags = (PutRuleGroupsNamespaceResponse -> Maybe (HashMap Text Text))
-> (PutRuleGroupsNamespaceResponse
    -> Maybe (HashMap Text Text) -> PutRuleGroupsNamespaceResponse)
-> Lens
     PutRuleGroupsNamespaceResponse
     PutRuleGroupsNamespaceResponse
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRuleGroupsNamespaceResponse' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:PutRuleGroupsNamespaceResponse' :: PutRuleGroupsNamespaceResponse -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: PutRuleGroupsNamespaceResponse
s@PutRuleGroupsNamespaceResponse' {} Maybe (HashMap Text Text)
a -> PutRuleGroupsNamespaceResponse
s {$sel:tags:PutRuleGroupsNamespaceResponse' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: PutRuleGroupsNamespaceResponse) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> PutRuleGroupsNamespaceResponse
 -> f PutRuleGroupsNamespaceResponse)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> PutRuleGroupsNamespaceResponse
-> f PutRuleGroupsNamespaceResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
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
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

-- | The Amazon Resource Name (ARN) of this rule groups namespace.
putRuleGroupsNamespaceResponse_arn :: Lens.Lens' PutRuleGroupsNamespaceResponse Prelude.Text
putRuleGroupsNamespaceResponse_arn :: (Text -> f Text)
-> PutRuleGroupsNamespaceResponse
-> f PutRuleGroupsNamespaceResponse
putRuleGroupsNamespaceResponse_arn = (PutRuleGroupsNamespaceResponse -> Text)
-> (PutRuleGroupsNamespaceResponse
    -> Text -> PutRuleGroupsNamespaceResponse)
-> Lens
     PutRuleGroupsNamespaceResponse
     PutRuleGroupsNamespaceResponse
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRuleGroupsNamespaceResponse' {Text
arn :: Text
$sel:arn:PutRuleGroupsNamespaceResponse' :: PutRuleGroupsNamespaceResponse -> Text
arn} -> Text
arn) (\s :: PutRuleGroupsNamespaceResponse
s@PutRuleGroupsNamespaceResponse' {} Text
a -> PutRuleGroupsNamespaceResponse
s {$sel:arn:PutRuleGroupsNamespaceResponse' :: Text
arn = Text
a} :: PutRuleGroupsNamespaceResponse)

-- | The rule groups namespace name.
putRuleGroupsNamespaceResponse_name :: Lens.Lens' PutRuleGroupsNamespaceResponse Prelude.Text
putRuleGroupsNamespaceResponse_name :: (Text -> f Text)
-> PutRuleGroupsNamespaceResponse
-> f PutRuleGroupsNamespaceResponse
putRuleGroupsNamespaceResponse_name = (PutRuleGroupsNamespaceResponse -> Text)
-> (PutRuleGroupsNamespaceResponse
    -> Text -> PutRuleGroupsNamespaceResponse)
-> Lens
     PutRuleGroupsNamespaceResponse
     PutRuleGroupsNamespaceResponse
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRuleGroupsNamespaceResponse' {Text
name :: Text
$sel:name:PutRuleGroupsNamespaceResponse' :: PutRuleGroupsNamespaceResponse -> Text
name} -> Text
name) (\s :: PutRuleGroupsNamespaceResponse
s@PutRuleGroupsNamespaceResponse' {} Text
a -> PutRuleGroupsNamespaceResponse
s {$sel:name:PutRuleGroupsNamespaceResponse' :: Text
name = Text
a} :: PutRuleGroupsNamespaceResponse)

-- | The status of rule groups namespace.
putRuleGroupsNamespaceResponse_status :: Lens.Lens' PutRuleGroupsNamespaceResponse RuleGroupsNamespaceStatus
putRuleGroupsNamespaceResponse_status :: (RuleGroupsNamespaceStatus -> f RuleGroupsNamespaceStatus)
-> PutRuleGroupsNamespaceResponse
-> f PutRuleGroupsNamespaceResponse
putRuleGroupsNamespaceResponse_status = (PutRuleGroupsNamespaceResponse -> RuleGroupsNamespaceStatus)
-> (PutRuleGroupsNamespaceResponse
    -> RuleGroupsNamespaceStatus -> PutRuleGroupsNamespaceResponse)
-> Lens
     PutRuleGroupsNamespaceResponse
     PutRuleGroupsNamespaceResponse
     RuleGroupsNamespaceStatus
     RuleGroupsNamespaceStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PutRuleGroupsNamespaceResponse' {RuleGroupsNamespaceStatus
status :: RuleGroupsNamespaceStatus
$sel:status:PutRuleGroupsNamespaceResponse' :: PutRuleGroupsNamespaceResponse -> RuleGroupsNamespaceStatus
status} -> RuleGroupsNamespaceStatus
status) (\s :: PutRuleGroupsNamespaceResponse
s@PutRuleGroupsNamespaceResponse' {} RuleGroupsNamespaceStatus
a -> PutRuleGroupsNamespaceResponse
s {$sel:status:PutRuleGroupsNamespaceResponse' :: RuleGroupsNamespaceStatus
status = RuleGroupsNamespaceStatus
a} :: PutRuleGroupsNamespaceResponse)

instance
  Prelude.NFData
    PutRuleGroupsNamespaceResponse