{-# 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.RobOMaker.DeleteRobotApplication
-- 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)
--
-- Deletes a robot application.
module Amazonka.RobOMaker.DeleteRobotApplication
  ( -- * Creating a Request
    DeleteRobotApplication (..),
    newDeleteRobotApplication,

    -- * Request Lenses
    deleteRobotApplication_applicationVersion,
    deleteRobotApplication_application,

    -- * Destructuring the Response
    DeleteRobotApplicationResponse (..),
    newDeleteRobotApplicationResponse,

    -- * Response Lenses
    deleteRobotApplicationResponse_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.RobOMaker.Types

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

-- |
-- Create a value of 'DeleteRobotApplication' 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:
--
-- 'applicationVersion', 'deleteRobotApplication_applicationVersion' - The version of the robot application to delete.
--
-- 'application', 'deleteRobotApplication_application' - The Amazon Resource Name (ARN) of the the robot application.
newDeleteRobotApplication ::
  -- | 'application'
  Prelude.Text ->
  DeleteRobotApplication
newDeleteRobotApplication :: Text -> DeleteRobotApplication
newDeleteRobotApplication Text
pApplication_ =
  DeleteRobotApplication' :: Maybe Text -> Text -> DeleteRobotApplication
DeleteRobotApplication'
    { $sel:applicationVersion:DeleteRobotApplication' :: Maybe Text
applicationVersion =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:application:DeleteRobotApplication' :: Text
application = Text
pApplication_
    }

-- | The version of the robot application to delete.
deleteRobotApplication_applicationVersion :: Lens.Lens' DeleteRobotApplication (Prelude.Maybe Prelude.Text)
deleteRobotApplication_applicationVersion :: (Maybe Text -> f (Maybe Text))
-> DeleteRobotApplication -> f DeleteRobotApplication
deleteRobotApplication_applicationVersion = (DeleteRobotApplication -> Maybe Text)
-> (DeleteRobotApplication -> Maybe Text -> DeleteRobotApplication)
-> Lens
     DeleteRobotApplication
     DeleteRobotApplication
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRobotApplication' {Maybe Text
applicationVersion :: Maybe Text
$sel:applicationVersion:DeleteRobotApplication' :: DeleteRobotApplication -> Maybe Text
applicationVersion} -> Maybe Text
applicationVersion) (\s :: DeleteRobotApplication
s@DeleteRobotApplication' {} Maybe Text
a -> DeleteRobotApplication
s {$sel:applicationVersion:DeleteRobotApplication' :: Maybe Text
applicationVersion = Maybe Text
a} :: DeleteRobotApplication)

-- | The Amazon Resource Name (ARN) of the the robot application.
deleteRobotApplication_application :: Lens.Lens' DeleteRobotApplication Prelude.Text
deleteRobotApplication_application :: (Text -> f Text)
-> DeleteRobotApplication -> f DeleteRobotApplication
deleteRobotApplication_application = (DeleteRobotApplication -> Text)
-> (DeleteRobotApplication -> Text -> DeleteRobotApplication)
-> Lens DeleteRobotApplication DeleteRobotApplication Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRobotApplication' {Text
application :: Text
$sel:application:DeleteRobotApplication' :: DeleteRobotApplication -> Text
application} -> Text
application) (\s :: DeleteRobotApplication
s@DeleteRobotApplication' {} Text
a -> DeleteRobotApplication
s {$sel:application:DeleteRobotApplication' :: Text
application = Text
a} :: DeleteRobotApplication)

instance Core.AWSRequest DeleteRobotApplication where
  type
    AWSResponse DeleteRobotApplication =
      DeleteRobotApplicationResponse
  request :: DeleteRobotApplication -> Request DeleteRobotApplication
request = Service -> DeleteRobotApplication -> Request DeleteRobotApplication
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteRobotApplication
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteRobotApplication)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse DeleteRobotApplication))
-> Logger
-> Service
-> Proxy DeleteRobotApplication
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteRobotApplication)))
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 -> DeleteRobotApplicationResponse
DeleteRobotApplicationResponse'
            (Int -> DeleteRobotApplicationResponse)
-> Either String Int
-> Either String DeleteRobotApplicationResponse
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 DeleteRobotApplication

instance Prelude.NFData DeleteRobotApplication

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

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

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

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

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

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

instance
  Prelude.NFData
    DeleteRobotApplicationResponse