{-# 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.CreateAlertManagerDefinition
-- 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)
--
-- Create an alert manager definition.
module Amazonka.AMP.CreateAlertManagerDefinition
  ( -- * Creating a Request
    CreateAlertManagerDefinition (..),
    newCreateAlertManagerDefinition,

    -- * Request Lenses
    createAlertManagerDefinition_clientToken,
    createAlertManagerDefinition_data,
    createAlertManagerDefinition_workspaceId,

    -- * Destructuring the Response
    CreateAlertManagerDefinitionResponse (..),
    newCreateAlertManagerDefinitionResponse,

    -- * Response Lenses
    createAlertManagerDefinitionResponse_httpStatus,
    createAlertManagerDefinitionResponse_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 CreateAlertManagerDefinition operation.
--
-- /See:/ 'newCreateAlertManagerDefinition' smart constructor.
data CreateAlertManagerDefinition = CreateAlertManagerDefinition'
  { -- | Optional, unique, case-sensitive, user-provided identifier to ensure the
    -- idempotency of the request.
    CreateAlertManagerDefinition -> Maybe Text
clientToken :: Prelude.Maybe Prelude.Text,
    -- | The alert manager definition data.
    CreateAlertManagerDefinition -> Base64
data' :: Core.Base64,
    -- | The ID of the workspace in which to create the alert manager definition.
    CreateAlertManagerDefinition -> Text
workspaceId :: Prelude.Text
  }
  deriving (CreateAlertManagerDefinition
-> CreateAlertManagerDefinition -> Bool
(CreateAlertManagerDefinition
 -> CreateAlertManagerDefinition -> Bool)
-> (CreateAlertManagerDefinition
    -> CreateAlertManagerDefinition -> Bool)
-> Eq CreateAlertManagerDefinition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAlertManagerDefinition
-> CreateAlertManagerDefinition -> Bool
$c/= :: CreateAlertManagerDefinition
-> CreateAlertManagerDefinition -> Bool
== :: CreateAlertManagerDefinition
-> CreateAlertManagerDefinition -> Bool
$c== :: CreateAlertManagerDefinition
-> CreateAlertManagerDefinition -> Bool
Prelude.Eq, ReadPrec [CreateAlertManagerDefinition]
ReadPrec CreateAlertManagerDefinition
Int -> ReadS CreateAlertManagerDefinition
ReadS [CreateAlertManagerDefinition]
(Int -> ReadS CreateAlertManagerDefinition)
-> ReadS [CreateAlertManagerDefinition]
-> ReadPrec CreateAlertManagerDefinition
-> ReadPrec [CreateAlertManagerDefinition]
-> Read CreateAlertManagerDefinition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAlertManagerDefinition]
$creadListPrec :: ReadPrec [CreateAlertManagerDefinition]
readPrec :: ReadPrec CreateAlertManagerDefinition
$creadPrec :: ReadPrec CreateAlertManagerDefinition
readList :: ReadS [CreateAlertManagerDefinition]
$creadList :: ReadS [CreateAlertManagerDefinition]
readsPrec :: Int -> ReadS CreateAlertManagerDefinition
$creadsPrec :: Int -> ReadS CreateAlertManagerDefinition
Prelude.Read, Int -> CreateAlertManagerDefinition -> ShowS
[CreateAlertManagerDefinition] -> ShowS
CreateAlertManagerDefinition -> String
(Int -> CreateAlertManagerDefinition -> ShowS)
-> (CreateAlertManagerDefinition -> String)
-> ([CreateAlertManagerDefinition] -> ShowS)
-> Show CreateAlertManagerDefinition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAlertManagerDefinition] -> ShowS
$cshowList :: [CreateAlertManagerDefinition] -> ShowS
show :: CreateAlertManagerDefinition -> String
$cshow :: CreateAlertManagerDefinition -> String
showsPrec :: Int -> CreateAlertManagerDefinition -> ShowS
$cshowsPrec :: Int -> CreateAlertManagerDefinition -> ShowS
Prelude.Show, (forall x.
 CreateAlertManagerDefinition -> Rep CreateAlertManagerDefinition x)
-> (forall x.
    Rep CreateAlertManagerDefinition x -> CreateAlertManagerDefinition)
-> Generic CreateAlertManagerDefinition
forall x.
Rep CreateAlertManagerDefinition x -> CreateAlertManagerDefinition
forall x.
CreateAlertManagerDefinition -> Rep CreateAlertManagerDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateAlertManagerDefinition x -> CreateAlertManagerDefinition
$cfrom :: forall x.
CreateAlertManagerDefinition -> Rep CreateAlertManagerDefinition x
Prelude.Generic)

-- |
-- Create a value of 'CreateAlertManagerDefinition' 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', 'createAlertManagerDefinition_clientToken' - Optional, unique, case-sensitive, user-provided identifier to ensure the
-- idempotency of the request.
--
-- 'data'', 'createAlertManagerDefinition_data' - The alert manager definition data.--
-- -- /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.
--
-- 'workspaceId', 'createAlertManagerDefinition_workspaceId' - The ID of the workspace in which to create the alert manager definition.
newCreateAlertManagerDefinition ::
  -- | 'data''
  Prelude.ByteString ->
  -- | 'workspaceId'
  Prelude.Text ->
  CreateAlertManagerDefinition
newCreateAlertManagerDefinition :: ByteString -> Text -> CreateAlertManagerDefinition
newCreateAlertManagerDefinition ByteString
pData_ Text
pWorkspaceId_ =
  CreateAlertManagerDefinition' :: Maybe Text -> Base64 -> Text -> CreateAlertManagerDefinition
CreateAlertManagerDefinition'
    { $sel:clientToken:CreateAlertManagerDefinition' :: Maybe Text
clientToken =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:data':CreateAlertManagerDefinition' :: 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:workspaceId:CreateAlertManagerDefinition' :: Text
workspaceId = Text
pWorkspaceId_
    }

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

-- | The alert manager definition data.--
-- -- /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.
createAlertManagerDefinition_data :: Lens.Lens' CreateAlertManagerDefinition Prelude.ByteString
createAlertManagerDefinition_data :: (ByteString -> f ByteString)
-> CreateAlertManagerDefinition -> f CreateAlertManagerDefinition
createAlertManagerDefinition_data = (CreateAlertManagerDefinition -> Base64)
-> (CreateAlertManagerDefinition
    -> Base64 -> CreateAlertManagerDefinition)
-> Lens
     CreateAlertManagerDefinition
     CreateAlertManagerDefinition
     Base64
     Base64
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAlertManagerDefinition' {Base64
data' :: Base64
$sel:data':CreateAlertManagerDefinition' :: CreateAlertManagerDefinition -> Base64
data'} -> Base64
data') (\s :: CreateAlertManagerDefinition
s@CreateAlertManagerDefinition' {} Base64
a -> CreateAlertManagerDefinition
s {$sel:data':CreateAlertManagerDefinition' :: Base64
data' = Base64
a} :: CreateAlertManagerDefinition) ((Base64 -> f Base64)
 -> CreateAlertManagerDefinition -> f CreateAlertManagerDefinition)
-> ((ByteString -> f ByteString) -> Base64 -> f Base64)
-> (ByteString -> f ByteString)
-> CreateAlertManagerDefinition
-> f CreateAlertManagerDefinition
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (ByteString -> f ByteString) -> Base64 -> f Base64
Iso' Base64 ByteString
Core._Base64

-- | The ID of the workspace in which to create the alert manager definition.
createAlertManagerDefinition_workspaceId :: Lens.Lens' CreateAlertManagerDefinition Prelude.Text
createAlertManagerDefinition_workspaceId :: (Text -> f Text)
-> CreateAlertManagerDefinition -> f CreateAlertManagerDefinition
createAlertManagerDefinition_workspaceId = (CreateAlertManagerDefinition -> Text)
-> (CreateAlertManagerDefinition
    -> Text -> CreateAlertManagerDefinition)
-> Lens
     CreateAlertManagerDefinition CreateAlertManagerDefinition Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAlertManagerDefinition' {Text
workspaceId :: Text
$sel:workspaceId:CreateAlertManagerDefinition' :: CreateAlertManagerDefinition -> Text
workspaceId} -> Text
workspaceId) (\s :: CreateAlertManagerDefinition
s@CreateAlertManagerDefinition' {} Text
a -> CreateAlertManagerDefinition
s {$sel:workspaceId:CreateAlertManagerDefinition' :: Text
workspaceId = Text
a} :: CreateAlertManagerDefinition)

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

instance
  Prelude.Hashable
    CreateAlertManagerDefinition

instance Prelude.NFData CreateAlertManagerDefinition

instance Core.ToHeaders CreateAlertManagerDefinition where
  toHeaders :: CreateAlertManagerDefinition -> ResponseHeaders
toHeaders =
    ResponseHeaders -> CreateAlertManagerDefinition -> 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 CreateAlertManagerDefinition where
  toJSON :: CreateAlertManagerDefinition -> Value
toJSON CreateAlertManagerDefinition' {Maybe Text
Text
Base64
workspaceId :: Text
data' :: Base64
clientToken :: Maybe Text
$sel:workspaceId:CreateAlertManagerDefinition' :: CreateAlertManagerDefinition -> Text
$sel:data':CreateAlertManagerDefinition' :: CreateAlertManagerDefinition -> Base64
$sel:clientToken:CreateAlertManagerDefinition' :: CreateAlertManagerDefinition -> 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 CreateAlertManagerDefinition where
  toPath :: CreateAlertManagerDefinition -> ByteString
toPath CreateAlertManagerDefinition' {Maybe Text
Text
Base64
workspaceId :: Text
data' :: Base64
clientToken :: Maybe Text
$sel:workspaceId:CreateAlertManagerDefinition' :: CreateAlertManagerDefinition -> Text
$sel:data':CreateAlertManagerDefinition' :: CreateAlertManagerDefinition -> Base64
$sel:clientToken:CreateAlertManagerDefinition' :: CreateAlertManagerDefinition -> 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
"/alertmanager/definition"
      ]

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

-- | Represents the output of a CreateAlertManagerDefinition operation.
--
-- /See:/ 'newCreateAlertManagerDefinitionResponse' smart constructor.
data CreateAlertManagerDefinitionResponse = CreateAlertManagerDefinitionResponse'
  { -- | The response's http status code.
    CreateAlertManagerDefinitionResponse -> Int
httpStatus :: Prelude.Int,
    -- | The status of alert manager definition.
    CreateAlertManagerDefinitionResponse
-> AlertManagerDefinitionStatus
status :: AlertManagerDefinitionStatus
  }
  deriving (CreateAlertManagerDefinitionResponse
-> CreateAlertManagerDefinitionResponse -> Bool
(CreateAlertManagerDefinitionResponse
 -> CreateAlertManagerDefinitionResponse -> Bool)
-> (CreateAlertManagerDefinitionResponse
    -> CreateAlertManagerDefinitionResponse -> Bool)
-> Eq CreateAlertManagerDefinitionResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CreateAlertManagerDefinitionResponse
-> CreateAlertManagerDefinitionResponse -> Bool
$c/= :: CreateAlertManagerDefinitionResponse
-> CreateAlertManagerDefinitionResponse -> Bool
== :: CreateAlertManagerDefinitionResponse
-> CreateAlertManagerDefinitionResponse -> Bool
$c== :: CreateAlertManagerDefinitionResponse
-> CreateAlertManagerDefinitionResponse -> Bool
Prelude.Eq, ReadPrec [CreateAlertManagerDefinitionResponse]
ReadPrec CreateAlertManagerDefinitionResponse
Int -> ReadS CreateAlertManagerDefinitionResponse
ReadS [CreateAlertManagerDefinitionResponse]
(Int -> ReadS CreateAlertManagerDefinitionResponse)
-> ReadS [CreateAlertManagerDefinitionResponse]
-> ReadPrec CreateAlertManagerDefinitionResponse
-> ReadPrec [CreateAlertManagerDefinitionResponse]
-> Read CreateAlertManagerDefinitionResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CreateAlertManagerDefinitionResponse]
$creadListPrec :: ReadPrec [CreateAlertManagerDefinitionResponse]
readPrec :: ReadPrec CreateAlertManagerDefinitionResponse
$creadPrec :: ReadPrec CreateAlertManagerDefinitionResponse
readList :: ReadS [CreateAlertManagerDefinitionResponse]
$creadList :: ReadS [CreateAlertManagerDefinitionResponse]
readsPrec :: Int -> ReadS CreateAlertManagerDefinitionResponse
$creadsPrec :: Int -> ReadS CreateAlertManagerDefinitionResponse
Prelude.Read, Int -> CreateAlertManagerDefinitionResponse -> ShowS
[CreateAlertManagerDefinitionResponse] -> ShowS
CreateAlertManagerDefinitionResponse -> String
(Int -> CreateAlertManagerDefinitionResponse -> ShowS)
-> (CreateAlertManagerDefinitionResponse -> String)
-> ([CreateAlertManagerDefinitionResponse] -> ShowS)
-> Show CreateAlertManagerDefinitionResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CreateAlertManagerDefinitionResponse] -> ShowS
$cshowList :: [CreateAlertManagerDefinitionResponse] -> ShowS
show :: CreateAlertManagerDefinitionResponse -> String
$cshow :: CreateAlertManagerDefinitionResponse -> String
showsPrec :: Int -> CreateAlertManagerDefinitionResponse -> ShowS
$cshowsPrec :: Int -> CreateAlertManagerDefinitionResponse -> ShowS
Prelude.Show, (forall x.
 CreateAlertManagerDefinitionResponse
 -> Rep CreateAlertManagerDefinitionResponse x)
-> (forall x.
    Rep CreateAlertManagerDefinitionResponse x
    -> CreateAlertManagerDefinitionResponse)
-> Generic CreateAlertManagerDefinitionResponse
forall x.
Rep CreateAlertManagerDefinitionResponse x
-> CreateAlertManagerDefinitionResponse
forall x.
CreateAlertManagerDefinitionResponse
-> Rep CreateAlertManagerDefinitionResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CreateAlertManagerDefinitionResponse x
-> CreateAlertManagerDefinitionResponse
$cfrom :: forall x.
CreateAlertManagerDefinitionResponse
-> Rep CreateAlertManagerDefinitionResponse x
Prelude.Generic)

-- |
-- Create a value of 'CreateAlertManagerDefinitionResponse' 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:
--
-- 'httpStatus', 'createAlertManagerDefinitionResponse_httpStatus' - The response's http status code.
--
-- 'status', 'createAlertManagerDefinitionResponse_status' - The status of alert manager definition.
newCreateAlertManagerDefinitionResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'status'
  AlertManagerDefinitionStatus ->
  CreateAlertManagerDefinitionResponse
newCreateAlertManagerDefinitionResponse :: Int
-> AlertManagerDefinitionStatus
-> CreateAlertManagerDefinitionResponse
newCreateAlertManagerDefinitionResponse
  Int
pHttpStatus_
  AlertManagerDefinitionStatus
pStatus_ =
    CreateAlertManagerDefinitionResponse' :: Int
-> AlertManagerDefinitionStatus
-> CreateAlertManagerDefinitionResponse
CreateAlertManagerDefinitionResponse'
      { $sel:httpStatus:CreateAlertManagerDefinitionResponse' :: Int
httpStatus =
          Int
pHttpStatus_,
        $sel:status:CreateAlertManagerDefinitionResponse' :: AlertManagerDefinitionStatus
status = AlertManagerDefinitionStatus
pStatus_
      }

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

-- | The status of alert manager definition.
createAlertManagerDefinitionResponse_status :: Lens.Lens' CreateAlertManagerDefinitionResponse AlertManagerDefinitionStatus
createAlertManagerDefinitionResponse_status :: (AlertManagerDefinitionStatus -> f AlertManagerDefinitionStatus)
-> CreateAlertManagerDefinitionResponse
-> f CreateAlertManagerDefinitionResponse
createAlertManagerDefinitionResponse_status = (CreateAlertManagerDefinitionResponse
 -> AlertManagerDefinitionStatus)
-> (CreateAlertManagerDefinitionResponse
    -> AlertManagerDefinitionStatus
    -> CreateAlertManagerDefinitionResponse)
-> Lens
     CreateAlertManagerDefinitionResponse
     CreateAlertManagerDefinitionResponse
     AlertManagerDefinitionStatus
     AlertManagerDefinitionStatus
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CreateAlertManagerDefinitionResponse' {AlertManagerDefinitionStatus
status :: AlertManagerDefinitionStatus
$sel:status:CreateAlertManagerDefinitionResponse' :: CreateAlertManagerDefinitionResponse
-> AlertManagerDefinitionStatus
status} -> AlertManagerDefinitionStatus
status) (\s :: CreateAlertManagerDefinitionResponse
s@CreateAlertManagerDefinitionResponse' {} AlertManagerDefinitionStatus
a -> CreateAlertManagerDefinitionResponse
s {$sel:status:CreateAlertManagerDefinitionResponse' :: AlertManagerDefinitionStatus
status = AlertManagerDefinitionStatus
a} :: CreateAlertManagerDefinitionResponse)

instance
  Prelude.NFData
    CreateAlertManagerDefinitionResponse