{-# 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.MediaLive.DeleteTags
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Removes tags for a resource
module Amazonka.MediaLive.DeleteTags
  ( -- * Creating a Request
    DeleteTags (..),
    newDeleteTags,

    -- * Request Lenses
    deleteTags_tagKeys,
    deleteTags_resourceArn,

    -- * Destructuring the Response
    DeleteTagsResponse (..),
    newDeleteTagsResponse,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaLive.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | Placeholder documentation for DeleteTagsRequest
--
-- /See:/ 'newDeleteTags' smart constructor.
data DeleteTags = DeleteTags'
  { -- | An array of tag keys to delete
    DeleteTags -> [Text]
tagKeys :: [Prelude.Text],
    DeleteTags -> Text
resourceArn :: Prelude.Text
  }
  deriving (DeleteTags -> DeleteTags -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DeleteTags -> DeleteTags -> Bool
$c/= :: DeleteTags -> DeleteTags -> Bool
== :: DeleteTags -> DeleteTags -> Bool
$c== :: DeleteTags -> DeleteTags -> Bool
Prelude.Eq, ReadPrec [DeleteTags]
ReadPrec DeleteTags
Int -> ReadS DeleteTags
ReadS [DeleteTags]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DeleteTags]
$creadListPrec :: ReadPrec [DeleteTags]
readPrec :: ReadPrec DeleteTags
$creadPrec :: ReadPrec DeleteTags
readList :: ReadS [DeleteTags]
$creadList :: ReadS [DeleteTags]
readsPrec :: Int -> ReadS DeleteTags
$creadsPrec :: Int -> ReadS DeleteTags
Prelude.Read, Int -> DeleteTags -> ShowS
[DeleteTags] -> ShowS
DeleteTags -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DeleteTags] -> ShowS
$cshowList :: [DeleteTags] -> ShowS
show :: DeleteTags -> String
$cshow :: DeleteTags -> String
showsPrec :: Int -> DeleteTags -> ShowS
$cshowsPrec :: Int -> DeleteTags -> ShowS
Prelude.Show, forall x. Rep DeleteTags x -> DeleteTags
forall x. DeleteTags -> Rep DeleteTags x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DeleteTags x -> DeleteTags
$cfrom :: forall x. DeleteTags -> Rep DeleteTags x
Prelude.Generic)

-- |
-- Create a value of 'DeleteTags' 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:
--
-- 'tagKeys', 'deleteTags_tagKeys' - An array of tag keys to delete
--
-- 'resourceArn', 'deleteTags_resourceArn' - Undocumented member.
newDeleteTags ::
  -- | 'resourceArn'
  Prelude.Text ->
  DeleteTags
newDeleteTags :: Text -> DeleteTags
newDeleteTags Text
pResourceArn_ =
  DeleteTags'
    { $sel:tagKeys:DeleteTags' :: [Text]
tagKeys = forall a. Monoid a => a
Prelude.mempty,
      $sel:resourceArn:DeleteTags' :: Text
resourceArn = Text
pResourceArn_
    }

-- | An array of tag keys to delete
deleteTags_tagKeys :: Lens.Lens' DeleteTags [Prelude.Text]
deleteTags_tagKeys :: Lens' DeleteTags [Text]
deleteTags_tagKeys = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTags' {[Text]
tagKeys :: [Text]
$sel:tagKeys:DeleteTags' :: DeleteTags -> [Text]
tagKeys} -> [Text]
tagKeys) (\s :: DeleteTags
s@DeleteTags' {} [Text]
a -> DeleteTags
s {$sel:tagKeys:DeleteTags' :: [Text]
tagKeys = [Text]
a} :: DeleteTags) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Undocumented member.
deleteTags_resourceArn :: Lens.Lens' DeleteTags Prelude.Text
deleteTags_resourceArn :: Lens' DeleteTags Text
deleteTags_resourceArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DeleteTags' {Text
resourceArn :: Text
$sel:resourceArn:DeleteTags' :: DeleteTags -> Text
resourceArn} -> Text
resourceArn) (\s :: DeleteTags
s@DeleteTags' {} Text
a -> DeleteTags
s {$sel:resourceArn:DeleteTags' :: Text
resourceArn = Text
a} :: DeleteTags)

instance Core.AWSRequest DeleteTags where
  type AWSResponse DeleteTags = DeleteTagsResponse
  request :: (Service -> Service) -> DeleteTags -> Request DeleteTags
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.delete (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DeleteTags
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse DeleteTags)))
response = forall (m :: * -> *) a.
MonadResource m =>
AWSResponse a
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveNull DeleteTagsResponse
DeleteTagsResponse'

instance Prelude.Hashable DeleteTags where
  hashWithSalt :: Int -> DeleteTags -> Int
hashWithSalt Int
_salt DeleteTags' {[Text]
Text
resourceArn :: Text
tagKeys :: [Text]
$sel:resourceArn:DeleteTags' :: DeleteTags -> Text
$sel:tagKeys:DeleteTags' :: DeleteTags -> [Text]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [Text]
tagKeys
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
resourceArn

instance Prelude.NFData DeleteTags where
  rnf :: DeleteTags -> ()
rnf DeleteTags' {[Text]
Text
resourceArn :: Text
tagKeys :: [Text]
$sel:resourceArn:DeleteTags' :: DeleteTags -> Text
$sel:tagKeys:DeleteTags' :: DeleteTags -> [Text]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf [Text]
tagKeys
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
resourceArn

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

instance Data.ToPath DeleteTags where
  toPath :: DeleteTags -> ByteString
toPath DeleteTags' {[Text]
Text
resourceArn :: Text
tagKeys :: [Text]
$sel:resourceArn:DeleteTags' :: DeleteTags -> Text
$sel:tagKeys:DeleteTags' :: DeleteTags -> [Text]
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/prod/tags/", forall a. ToByteString a => a -> ByteString
Data.toBS Text
resourceArn]

instance Data.ToQuery DeleteTags where
  toQuery :: DeleteTags -> QueryString
toQuery DeleteTags' {[Text]
Text
resourceArn :: Text
tagKeys :: [Text]
$sel:resourceArn:DeleteTags' :: DeleteTags -> Text
$sel:tagKeys:DeleteTags' :: DeleteTags -> [Text]
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"tagKeys" forall a. ToQuery a => ByteString -> a -> QueryString
Data.=: forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Data.toQueryList ByteString
"member" [Text]
tagKeys]

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

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

instance Prelude.NFData DeleteTagsResponse where
  rnf :: DeleteTagsResponse -> ()
rnf DeleteTagsResponse
_ = ()