{-# 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.SSM.DeleteOpsMetadata
-- 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)
--
-- Delete OpsMetadata related to an application.
module Amazonka.SSM.DeleteOpsMetadata
  ( -- * Creating a Request
    DeleteOpsMetadata (..),
    newDeleteOpsMetadata,

    -- * Request Lenses
    deleteOpsMetadata_opsMetadataArn,

    -- * Destructuring the Response
    DeleteOpsMetadataResponse (..),
    newDeleteOpsMetadataResponse,

    -- * Response Lenses
    deleteOpsMetadataResponse_httpStatus,
  )
where

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
import Amazonka.SSM.Types

-- | /See:/ 'newDeleteOpsMetadata' smart constructor.
data DeleteOpsMetadata = DeleteOpsMetadata'
  { -- | The Amazon Resource Name (ARN) of an OpsMetadata Object to delete.
    DeleteOpsMetadata -> Text
opsMetadataArn :: Prelude.Text
  }
  deriving (DeleteOpsMetadata -> DeleteOpsMetadata -> Bool
(DeleteOpsMetadata -> DeleteOpsMetadata -> Bool)
-> (DeleteOpsMetadata -> DeleteOpsMetadata -> Bool)
-> Eq DeleteOpsMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteOpsMetadata -> DeleteOpsMetadata -> Bool
$c/= :: DeleteOpsMetadata -> DeleteOpsMetadata -> Bool
== :: DeleteOpsMetadata -> DeleteOpsMetadata -> Bool
$c== :: DeleteOpsMetadata -> DeleteOpsMetadata -> Bool
Prelude.Eq, ReadPrec [DeleteOpsMetadata]
ReadPrec DeleteOpsMetadata
Int -> ReadS DeleteOpsMetadata
ReadS [DeleteOpsMetadata]
(Int -> ReadS DeleteOpsMetadata)
-> ReadS [DeleteOpsMetadata]
-> ReadPrec DeleteOpsMetadata
-> ReadPrec [DeleteOpsMetadata]
-> Read DeleteOpsMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteOpsMetadata]
$creadListPrec :: ReadPrec [DeleteOpsMetadata]
readPrec :: ReadPrec DeleteOpsMetadata
$creadPrec :: ReadPrec DeleteOpsMetadata
readList :: ReadS [DeleteOpsMetadata]
$creadList :: ReadS [DeleteOpsMetadata]
readsPrec :: Int -> ReadS DeleteOpsMetadata
$creadsPrec :: Int -> ReadS DeleteOpsMetadata
Prelude.Read, Int -> DeleteOpsMetadata -> ShowS
[DeleteOpsMetadata] -> ShowS
DeleteOpsMetadata -> String
(Int -> DeleteOpsMetadata -> ShowS)
-> (DeleteOpsMetadata -> String)
-> ([DeleteOpsMetadata] -> ShowS)
-> Show DeleteOpsMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteOpsMetadata] -> ShowS
$cshowList :: [DeleteOpsMetadata] -> ShowS
show :: DeleteOpsMetadata -> String
$cshow :: DeleteOpsMetadata -> String
showsPrec :: Int -> DeleteOpsMetadata -> ShowS
$cshowsPrec :: Int -> DeleteOpsMetadata -> ShowS
Prelude.Show, (forall x. DeleteOpsMetadata -> Rep DeleteOpsMetadata x)
-> (forall x. Rep DeleteOpsMetadata x -> DeleteOpsMetadata)
-> Generic DeleteOpsMetadata
forall x. Rep DeleteOpsMetadata x -> DeleteOpsMetadata
forall x. DeleteOpsMetadata -> Rep DeleteOpsMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteOpsMetadata x -> DeleteOpsMetadata
$cfrom :: forall x. DeleteOpsMetadata -> Rep DeleteOpsMetadata x
Prelude.Generic)

-- |
-- Create a value of 'DeleteOpsMetadata' 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:
--
-- 'opsMetadataArn', 'deleteOpsMetadata_opsMetadataArn' - The Amazon Resource Name (ARN) of an OpsMetadata Object to delete.
newDeleteOpsMetadata ::
  -- | 'opsMetadataArn'
  Prelude.Text ->
  DeleteOpsMetadata
newDeleteOpsMetadata :: Text -> DeleteOpsMetadata
newDeleteOpsMetadata Text
pOpsMetadataArn_ =
  DeleteOpsMetadata' :: Text -> DeleteOpsMetadata
DeleteOpsMetadata'
    { $sel:opsMetadataArn:DeleteOpsMetadata' :: Text
opsMetadataArn =
        Text
pOpsMetadataArn_
    }

-- | The Amazon Resource Name (ARN) of an OpsMetadata Object to delete.
deleteOpsMetadata_opsMetadataArn :: Lens.Lens' DeleteOpsMetadata Prelude.Text
deleteOpsMetadata_opsMetadataArn :: (Text -> f Text) -> DeleteOpsMetadata -> f DeleteOpsMetadata
deleteOpsMetadata_opsMetadataArn = (DeleteOpsMetadata -> Text)
-> (DeleteOpsMetadata -> Text -> DeleteOpsMetadata)
-> Lens DeleteOpsMetadata DeleteOpsMetadata Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteOpsMetadata' {Text
opsMetadataArn :: Text
$sel:opsMetadataArn:DeleteOpsMetadata' :: DeleteOpsMetadata -> Text
opsMetadataArn} -> Text
opsMetadataArn) (\s :: DeleteOpsMetadata
s@DeleteOpsMetadata' {} Text
a -> DeleteOpsMetadata
s {$sel:opsMetadataArn:DeleteOpsMetadata' :: Text
opsMetadataArn = Text
a} :: DeleteOpsMetadata)

instance Core.AWSRequest DeleteOpsMetadata where
  type
    AWSResponse DeleteOpsMetadata =
      DeleteOpsMetadataResponse
  request :: DeleteOpsMetadata -> Request DeleteOpsMetadata
request = Service -> DeleteOpsMetadata -> Request DeleteOpsMetadata
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteOpsMetadata
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteOpsMetadata)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse DeleteOpsMetadata))
-> Logger
-> Service
-> Proxy DeleteOpsMetadata
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteOpsMetadata)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> DeleteOpsMetadataResponse
DeleteOpsMetadataResponse'
            (Int -> DeleteOpsMetadataResponse)
-> Either String Int -> Either String DeleteOpsMetadataResponse
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))
      )

instance Prelude.Hashable DeleteOpsMetadata

instance Prelude.NFData DeleteOpsMetadata

instance Core.ToHeaders DeleteOpsMetadata where
  toHeaders :: DeleteOpsMetadata -> ResponseHeaders
toHeaders =
    ResponseHeaders -> DeleteOpsMetadata -> 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
"AmazonSSM.DeleteOpsMetadata" ::
                          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 DeleteOpsMetadata where
  toJSON :: DeleteOpsMetadata -> Value
toJSON DeleteOpsMetadata' {Text
opsMetadataArn :: Text
$sel:opsMetadataArn:DeleteOpsMetadata' :: DeleteOpsMetadata -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"OpsMetadataArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
opsMetadataArn)
          ]
      )

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

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

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

-- |
-- Create a value of 'DeleteOpsMetadataResponse' 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', 'deleteOpsMetadataResponse_httpStatus' - The response's http status code.
newDeleteOpsMetadataResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DeleteOpsMetadataResponse
newDeleteOpsMetadataResponse :: Int -> DeleteOpsMetadataResponse
newDeleteOpsMetadataResponse Int
pHttpStatus_ =
  DeleteOpsMetadataResponse' :: Int -> DeleteOpsMetadataResponse
DeleteOpsMetadataResponse'
    { $sel:httpStatus:DeleteOpsMetadataResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

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

instance Prelude.NFData DeleteOpsMetadataResponse