{-# 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.Chime.UntagMeeting
-- 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)
--
-- Untags the specified tags from the specified Amazon Chime SDK meeting.
module Amazonka.Chime.UntagMeeting
  ( -- * Creating a Request
    UntagMeeting (..),
    newUntagMeeting,

    -- * Request Lenses
    untagMeeting_meetingId,
    untagMeeting_tagKeys,

    -- * Destructuring the Response
    UntagMeetingResponse (..),
    newUntagMeetingResponse,
  )
where

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

-- | /See:/ 'newUntagMeeting' smart constructor.
data UntagMeeting = UntagMeeting'
  { -- | The Amazon Chime SDK meeting ID.
    UntagMeeting -> Text
meetingId :: Prelude.Text,
    -- | The tag keys.
    UntagMeeting -> NonEmpty (Sensitive Text)
tagKeys :: Prelude.NonEmpty (Core.Sensitive Prelude.Text)
  }
  deriving (UntagMeeting -> UntagMeeting -> Bool
(UntagMeeting -> UntagMeeting -> Bool)
-> (UntagMeeting -> UntagMeeting -> Bool) -> Eq UntagMeeting
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UntagMeeting -> UntagMeeting -> Bool
$c/= :: UntagMeeting -> UntagMeeting -> Bool
== :: UntagMeeting -> UntagMeeting -> Bool
$c== :: UntagMeeting -> UntagMeeting -> Bool
Prelude.Eq, Int -> UntagMeeting -> ShowS
[UntagMeeting] -> ShowS
UntagMeeting -> String
(Int -> UntagMeeting -> ShowS)
-> (UntagMeeting -> String)
-> ([UntagMeeting] -> ShowS)
-> Show UntagMeeting
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UntagMeeting] -> ShowS
$cshowList :: [UntagMeeting] -> ShowS
show :: UntagMeeting -> String
$cshow :: UntagMeeting -> String
showsPrec :: Int -> UntagMeeting -> ShowS
$cshowsPrec :: Int -> UntagMeeting -> ShowS
Prelude.Show, (forall x. UntagMeeting -> Rep UntagMeeting x)
-> (forall x. Rep UntagMeeting x -> UntagMeeting)
-> Generic UntagMeeting
forall x. Rep UntagMeeting x -> UntagMeeting
forall x. UntagMeeting -> Rep UntagMeeting x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UntagMeeting x -> UntagMeeting
$cfrom :: forall x. UntagMeeting -> Rep UntagMeeting x
Prelude.Generic)

-- |
-- Create a value of 'UntagMeeting' 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:
--
-- 'meetingId', 'untagMeeting_meetingId' - The Amazon Chime SDK meeting ID.
--
-- 'tagKeys', 'untagMeeting_tagKeys' - The tag keys.
newUntagMeeting ::
  -- | 'meetingId'
  Prelude.Text ->
  -- | 'tagKeys'
  Prelude.NonEmpty Prelude.Text ->
  UntagMeeting
newUntagMeeting :: Text -> NonEmpty Text -> UntagMeeting
newUntagMeeting Text
pMeetingId_ NonEmpty Text
pTagKeys_ =
  UntagMeeting' :: Text -> NonEmpty (Sensitive Text) -> UntagMeeting
UntagMeeting'
    { $sel:meetingId:UntagMeeting' :: Text
meetingId = Text
pMeetingId_,
      $sel:tagKeys:UntagMeeting' :: NonEmpty (Sensitive Text)
tagKeys = Tagged (NonEmpty Text) (Identity (NonEmpty Text))
-> Tagged
     (NonEmpty (Sensitive Text)) (Identity (NonEmpty (Sensitive Text)))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced (Tagged (NonEmpty Text) (Identity (NonEmpty Text))
 -> Tagged
      (NonEmpty (Sensitive Text)) (Identity (NonEmpty (Sensitive Text))))
-> NonEmpty Text -> NonEmpty (Sensitive Text)
forall t b. AReview t b -> b -> t
Lens.# NonEmpty Text
pTagKeys_
    }

-- | The Amazon Chime SDK meeting ID.
untagMeeting_meetingId :: Lens.Lens' UntagMeeting Prelude.Text
untagMeeting_meetingId :: (Text -> f Text) -> UntagMeeting -> f UntagMeeting
untagMeeting_meetingId = (UntagMeeting -> Text)
-> (UntagMeeting -> Text -> UntagMeeting)
-> Lens UntagMeeting UntagMeeting Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UntagMeeting' {Text
meetingId :: Text
$sel:meetingId:UntagMeeting' :: UntagMeeting -> Text
meetingId} -> Text
meetingId) (\s :: UntagMeeting
s@UntagMeeting' {} Text
a -> UntagMeeting
s {$sel:meetingId:UntagMeeting' :: Text
meetingId = Text
a} :: UntagMeeting)

-- | The tag keys.
untagMeeting_tagKeys :: Lens.Lens' UntagMeeting (Prelude.NonEmpty Prelude.Text)
untagMeeting_tagKeys :: (NonEmpty Text -> f (NonEmpty Text))
-> UntagMeeting -> f UntagMeeting
untagMeeting_tagKeys = (UntagMeeting -> NonEmpty (Sensitive Text))
-> (UntagMeeting -> NonEmpty (Sensitive Text) -> UntagMeeting)
-> Lens
     UntagMeeting
     UntagMeeting
     (NonEmpty (Sensitive Text))
     (NonEmpty (Sensitive Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UntagMeeting' {NonEmpty (Sensitive Text)
tagKeys :: NonEmpty (Sensitive Text)
$sel:tagKeys:UntagMeeting' :: UntagMeeting -> NonEmpty (Sensitive Text)
tagKeys} -> NonEmpty (Sensitive Text)
tagKeys) (\s :: UntagMeeting
s@UntagMeeting' {} NonEmpty (Sensitive Text)
a -> UntagMeeting
s {$sel:tagKeys:UntagMeeting' :: NonEmpty (Sensitive Text)
tagKeys = NonEmpty (Sensitive Text)
a} :: UntagMeeting) ((NonEmpty (Sensitive Text) -> f (NonEmpty (Sensitive Text)))
 -> UntagMeeting -> f UntagMeeting)
-> ((NonEmpty Text -> f (NonEmpty Text))
    -> NonEmpty (Sensitive Text) -> f (NonEmpty (Sensitive Text)))
-> (NonEmpty Text -> f (NonEmpty Text))
-> UntagMeeting
-> f UntagMeeting
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (NonEmpty Text -> f (NonEmpty Text))
-> NonEmpty (Sensitive Text) -> f (NonEmpty (Sensitive Text))
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.Hashable UntagMeeting

instance Prelude.NFData UntagMeeting

instance Core.ToHeaders UntagMeeting where
  toHeaders :: UntagMeeting -> [Header]
toHeaders = [Header] -> UntagMeeting -> [Header]
forall a b. a -> b -> a
Prelude.const [Header]
forall a. Monoid a => a
Prelude.mempty

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

instance Core.ToPath UntagMeeting where
  toPath :: UntagMeeting -> ByteString
toPath UntagMeeting' {NonEmpty (Sensitive Text)
Text
tagKeys :: NonEmpty (Sensitive Text)
meetingId :: Text
$sel:tagKeys:UntagMeeting' :: UntagMeeting -> NonEmpty (Sensitive Text)
$sel:meetingId:UntagMeeting' :: UntagMeeting -> Text
..} =
    [ByteString] -> ByteString
forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ByteString
"/meetings/", Text -> ByteString
forall a. ToByteString a => a -> ByteString
Core.toBS Text
meetingId, ByteString
"/tags"]

instance Core.ToQuery UntagMeeting where
  toQuery :: UntagMeeting -> QueryString
toQuery =
    QueryString -> UntagMeeting -> QueryString
forall a b. a -> b -> a
Prelude.const
      ([QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat [QueryString
"operation=delete"])

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

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

instance Prelude.NFData UntagMeetingResponse