{-# 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.Route53RecoveryReadiness.DeleteCrossAccountAuthorization
-- 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 cross account readiness authorization
module Amazonka.Route53RecoveryReadiness.DeleteCrossAccountAuthorization
  ( -- * Creating a Request
    DeleteCrossAccountAuthorization (..),
    newDeleteCrossAccountAuthorization,

    -- * Request Lenses
    deleteCrossAccountAuthorization_crossAccountAuthorization,

    -- * Destructuring the Response
    DeleteCrossAccountAuthorizationResponse (..),
    newDeleteCrossAccountAuthorizationResponse,

    -- * Response Lenses
    deleteCrossAccountAuthorizationResponse_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.Route53RecoveryReadiness.Types

-- | /See:/ 'newDeleteCrossAccountAuthorization' smart constructor.
data DeleteCrossAccountAuthorization = DeleteCrossAccountAuthorization'
  { -- | The cross account authorization
    DeleteCrossAccountAuthorization -> Text
crossAccountAuthorization :: Prelude.Text
  }
  deriving (DeleteCrossAccountAuthorization
-> DeleteCrossAccountAuthorization -> Bool
(DeleteCrossAccountAuthorization
 -> DeleteCrossAccountAuthorization -> Bool)
-> (DeleteCrossAccountAuthorization
    -> DeleteCrossAccountAuthorization -> Bool)
-> Eq DeleteCrossAccountAuthorization
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteCrossAccountAuthorization
-> DeleteCrossAccountAuthorization -> Bool
$c/= :: DeleteCrossAccountAuthorization
-> DeleteCrossAccountAuthorization -> Bool
== :: DeleteCrossAccountAuthorization
-> DeleteCrossAccountAuthorization -> Bool
$c== :: DeleteCrossAccountAuthorization
-> DeleteCrossAccountAuthorization -> Bool
Prelude.Eq, ReadPrec [DeleteCrossAccountAuthorization]
ReadPrec DeleteCrossAccountAuthorization
Int -> ReadS DeleteCrossAccountAuthorization
ReadS [DeleteCrossAccountAuthorization]
(Int -> ReadS DeleteCrossAccountAuthorization)
-> ReadS [DeleteCrossAccountAuthorization]
-> ReadPrec DeleteCrossAccountAuthorization
-> ReadPrec [DeleteCrossAccountAuthorization]
-> Read DeleteCrossAccountAuthorization
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteCrossAccountAuthorization]
$creadListPrec :: ReadPrec [DeleteCrossAccountAuthorization]
readPrec :: ReadPrec DeleteCrossAccountAuthorization
$creadPrec :: ReadPrec DeleteCrossAccountAuthorization
readList :: ReadS [DeleteCrossAccountAuthorization]
$creadList :: ReadS [DeleteCrossAccountAuthorization]
readsPrec :: Int -> ReadS DeleteCrossAccountAuthorization
$creadsPrec :: Int -> ReadS DeleteCrossAccountAuthorization
Prelude.Read, Int -> DeleteCrossAccountAuthorization -> ShowS
[DeleteCrossAccountAuthorization] -> ShowS
DeleteCrossAccountAuthorization -> String
(Int -> DeleteCrossAccountAuthorization -> ShowS)
-> (DeleteCrossAccountAuthorization -> String)
-> ([DeleteCrossAccountAuthorization] -> ShowS)
-> Show DeleteCrossAccountAuthorization
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteCrossAccountAuthorization] -> ShowS
$cshowList :: [DeleteCrossAccountAuthorization] -> ShowS
show :: DeleteCrossAccountAuthorization -> String
$cshow :: DeleteCrossAccountAuthorization -> String
showsPrec :: Int -> DeleteCrossAccountAuthorization -> ShowS
$cshowsPrec :: Int -> DeleteCrossAccountAuthorization -> ShowS
Prelude.Show, (forall x.
 DeleteCrossAccountAuthorization
 -> Rep DeleteCrossAccountAuthorization x)
-> (forall x.
    Rep DeleteCrossAccountAuthorization x
    -> DeleteCrossAccountAuthorization)
-> Generic DeleteCrossAccountAuthorization
forall x.
Rep DeleteCrossAccountAuthorization x
-> DeleteCrossAccountAuthorization
forall x.
DeleteCrossAccountAuthorization
-> Rep DeleteCrossAccountAuthorization x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteCrossAccountAuthorization x
-> DeleteCrossAccountAuthorization
$cfrom :: forall x.
DeleteCrossAccountAuthorization
-> Rep DeleteCrossAccountAuthorization x
Prelude.Generic)

-- |
-- Create a value of 'DeleteCrossAccountAuthorization' 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:
--
-- 'crossAccountAuthorization', 'deleteCrossAccountAuthorization_crossAccountAuthorization' - The cross account authorization
newDeleteCrossAccountAuthorization ::
  -- | 'crossAccountAuthorization'
  Prelude.Text ->
  DeleteCrossAccountAuthorization
newDeleteCrossAccountAuthorization :: Text -> DeleteCrossAccountAuthorization
newDeleteCrossAccountAuthorization
  Text
pCrossAccountAuthorization_ =
    DeleteCrossAccountAuthorization' :: Text -> DeleteCrossAccountAuthorization
DeleteCrossAccountAuthorization'
      { $sel:crossAccountAuthorization:DeleteCrossAccountAuthorization' :: Text
crossAccountAuthorization =
          Text
pCrossAccountAuthorization_
      }

-- | The cross account authorization
deleteCrossAccountAuthorization_crossAccountAuthorization :: Lens.Lens' DeleteCrossAccountAuthorization Prelude.Text
deleteCrossAccountAuthorization_crossAccountAuthorization :: (Text -> f Text)
-> DeleteCrossAccountAuthorization
-> f DeleteCrossAccountAuthorization
deleteCrossAccountAuthorization_crossAccountAuthorization = (DeleteCrossAccountAuthorization -> Text)
-> (DeleteCrossAccountAuthorization
    -> Text -> DeleteCrossAccountAuthorization)
-> Lens
     DeleteCrossAccountAuthorization
     DeleteCrossAccountAuthorization
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteCrossAccountAuthorization' {Text
crossAccountAuthorization :: Text
$sel:crossAccountAuthorization:DeleteCrossAccountAuthorization' :: DeleteCrossAccountAuthorization -> Text
crossAccountAuthorization} -> Text
crossAccountAuthorization) (\s :: DeleteCrossAccountAuthorization
s@DeleteCrossAccountAuthorization' {} Text
a -> DeleteCrossAccountAuthorization
s {$sel:crossAccountAuthorization:DeleteCrossAccountAuthorization' :: Text
crossAccountAuthorization = Text
a} :: DeleteCrossAccountAuthorization)

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

instance
  Prelude.NFData
    DeleteCrossAccountAuthorization

instance
  Core.ToHeaders
    DeleteCrossAccountAuthorization
  where
  toHeaders :: DeleteCrossAccountAuthorization -> ResponseHeaders
toHeaders =
    ResponseHeaders
-> DeleteCrossAccountAuthorization -> 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.ToPath DeleteCrossAccountAuthorization where
  toPath :: DeleteCrossAccountAuthorization -> ByteString
toPath DeleteCrossAccountAuthorization' {Text
crossAccountAuthorization :: Text
$sel:crossAccountAuthorization:DeleteCrossAccountAuthorization' :: DeleteCrossAccountAuthorization -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/crossaccountauthorizations/",
        Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
crossAccountAuthorization
      ]

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

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

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

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

instance
  Prelude.NFData
    DeleteCrossAccountAuthorizationResponse