{-# 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.IVS.DeleteRecordingConfiguration
-- 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 the recording configuration for the specified ARN.
--
-- If you try to delete a recording configuration that is associated with a
-- channel, you will get an error (409 ConflictException). To avoid this,
-- for all channels that reference the recording configuration, first use
-- UpdateChannel to set the @recordingConfigurationArn@ field to an empty
-- string, then use DeleteRecordingConfiguration.
module Amazonka.IVS.DeleteRecordingConfiguration
  ( -- * Creating a Request
    DeleteRecordingConfiguration (..),
    newDeleteRecordingConfiguration,

    -- * Request Lenses
    deleteRecordingConfiguration_arn,

    -- * Destructuring the Response
    DeleteRecordingConfigurationResponse (..),
    newDeleteRecordingConfigurationResponse,
  )
where

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

-- | /See:/ 'newDeleteRecordingConfiguration' smart constructor.
data DeleteRecordingConfiguration = DeleteRecordingConfiguration'
  { -- | ARN of the recording configuration to be deleted.
    DeleteRecordingConfiguration -> Text
arn :: Prelude.Text
  }
  deriving (DeleteRecordingConfiguration
-> DeleteRecordingConfiguration -> Bool
(DeleteRecordingConfiguration
 -> DeleteRecordingConfiguration -> Bool)
-> (DeleteRecordingConfiguration
    -> DeleteRecordingConfiguration -> Bool)
-> Eq DeleteRecordingConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteRecordingConfiguration
-> DeleteRecordingConfiguration -> Bool
$c/= :: DeleteRecordingConfiguration
-> DeleteRecordingConfiguration -> Bool
== :: DeleteRecordingConfiguration
-> DeleteRecordingConfiguration -> Bool
$c== :: DeleteRecordingConfiguration
-> DeleteRecordingConfiguration -> Bool
Prelude.Eq, ReadPrec [DeleteRecordingConfiguration]
ReadPrec DeleteRecordingConfiguration
Int -> ReadS DeleteRecordingConfiguration
ReadS [DeleteRecordingConfiguration]
(Int -> ReadS DeleteRecordingConfiguration)
-> ReadS [DeleteRecordingConfiguration]
-> ReadPrec DeleteRecordingConfiguration
-> ReadPrec [DeleteRecordingConfiguration]
-> Read DeleteRecordingConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteRecordingConfiguration]
$creadListPrec :: ReadPrec [DeleteRecordingConfiguration]
readPrec :: ReadPrec DeleteRecordingConfiguration
$creadPrec :: ReadPrec DeleteRecordingConfiguration
readList :: ReadS [DeleteRecordingConfiguration]
$creadList :: ReadS [DeleteRecordingConfiguration]
readsPrec :: Int -> ReadS DeleteRecordingConfiguration
$creadsPrec :: Int -> ReadS DeleteRecordingConfiguration
Prelude.Read, Int -> DeleteRecordingConfiguration -> ShowS
[DeleteRecordingConfiguration] -> ShowS
DeleteRecordingConfiguration -> String
(Int -> DeleteRecordingConfiguration -> ShowS)
-> (DeleteRecordingConfiguration -> String)
-> ([DeleteRecordingConfiguration] -> ShowS)
-> Show DeleteRecordingConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteRecordingConfiguration] -> ShowS
$cshowList :: [DeleteRecordingConfiguration] -> ShowS
show :: DeleteRecordingConfiguration -> String
$cshow :: DeleteRecordingConfiguration -> String
showsPrec :: Int -> DeleteRecordingConfiguration -> ShowS
$cshowsPrec :: Int -> DeleteRecordingConfiguration -> ShowS
Prelude.Show, (forall x.
 DeleteRecordingConfiguration -> Rep DeleteRecordingConfiguration x)
-> (forall x.
    Rep DeleteRecordingConfiguration x -> DeleteRecordingConfiguration)
-> Generic DeleteRecordingConfiguration
forall x.
Rep DeleteRecordingConfiguration x -> DeleteRecordingConfiguration
forall x.
DeleteRecordingConfiguration -> Rep DeleteRecordingConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DeleteRecordingConfiguration x -> DeleteRecordingConfiguration
$cfrom :: forall x.
DeleteRecordingConfiguration -> Rep DeleteRecordingConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'DeleteRecordingConfiguration' 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:
--
-- 'arn', 'deleteRecordingConfiguration_arn' - ARN of the recording configuration to be deleted.
newDeleteRecordingConfiguration ::
  -- | 'arn'
  Prelude.Text ->
  DeleteRecordingConfiguration
newDeleteRecordingConfiguration :: Text -> DeleteRecordingConfiguration
newDeleteRecordingConfiguration Text
pArn_ =
  DeleteRecordingConfiguration' :: Text -> DeleteRecordingConfiguration
DeleteRecordingConfiguration' {$sel:arn:DeleteRecordingConfiguration' :: Text
arn = Text
pArn_}

-- | ARN of the recording configuration to be deleted.
deleteRecordingConfiguration_arn :: Lens.Lens' DeleteRecordingConfiguration Prelude.Text
deleteRecordingConfiguration_arn :: (Text -> f Text)
-> DeleteRecordingConfiguration -> f DeleteRecordingConfiguration
deleteRecordingConfiguration_arn = (DeleteRecordingConfiguration -> Text)
-> (DeleteRecordingConfiguration
    -> Text -> DeleteRecordingConfiguration)
-> Lens
     DeleteRecordingConfiguration DeleteRecordingConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteRecordingConfiguration' {Text
arn :: Text
$sel:arn:DeleteRecordingConfiguration' :: DeleteRecordingConfiguration -> Text
arn} -> Text
arn) (\s :: DeleteRecordingConfiguration
s@DeleteRecordingConfiguration' {} Text
a -> DeleteRecordingConfiguration
s {$sel:arn:DeleteRecordingConfiguration' :: Text
arn = Text
a} :: DeleteRecordingConfiguration)

instance Core.AWSRequest DeleteRecordingConfiguration where
  type
    AWSResponse DeleteRecordingConfiguration =
      DeleteRecordingConfigurationResponse
  request :: DeleteRecordingConfiguration
-> Request DeleteRecordingConfiguration
request = Service
-> DeleteRecordingConfiguration
-> Request DeleteRecordingConfiguration
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy DeleteRecordingConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteRecordingConfiguration)))
response =
    AWSResponse DeleteRecordingConfiguration
-> Logger
-> Service
-> Proxy DeleteRecordingConfiguration
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DeleteRecordingConfiguration)))
forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull
      AWSResponse DeleteRecordingConfiguration
DeleteRecordingConfigurationResponse
DeleteRecordingConfigurationResponse'

instance
  Prelude.Hashable
    DeleteRecordingConfiguration

instance Prelude.NFData DeleteRecordingConfiguration

instance Core.ToHeaders DeleteRecordingConfiguration where
  toHeaders :: DeleteRecordingConfiguration -> [Header]
toHeaders =
    [Header] -> DeleteRecordingConfiguration -> [Header]
forall a b. a -> b -> a
Prelude.const
      ( [[Header]] -> [Header]
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> [Header]
forall a. ToHeader a => HeaderName -> a -> [Header]
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON DeleteRecordingConfiguration where
  toJSON :: DeleteRecordingConfiguration -> Value
toJSON DeleteRecordingConfiguration' {Text
arn :: Text
$sel:arn:DeleteRecordingConfiguration' :: DeleteRecordingConfiguration -> 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
"arn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
arn)]
      )

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

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

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

-- |
-- Create a value of 'DeleteRecordingConfigurationResponse' 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.
newDeleteRecordingConfigurationResponse ::
  DeleteRecordingConfigurationResponse
newDeleteRecordingConfigurationResponse :: DeleteRecordingConfigurationResponse
newDeleteRecordingConfigurationResponse =
  DeleteRecordingConfigurationResponse
DeleteRecordingConfigurationResponse'

instance
  Prelude.NFData
    DeleteRecordingConfigurationResponse