{-# 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.ListMeetingTags
-- 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)
--
-- Lists the tags applied to an Amazon Chime SDK meeting resource.
module Amazonka.Chime.ListMeetingTags
  ( -- * Creating a Request
    ListMeetingTags (..),
    newListMeetingTags,

    -- * Request Lenses
    listMeetingTags_meetingId,

    -- * Destructuring the Response
    ListMeetingTagsResponse (..),
    newListMeetingTagsResponse,

    -- * Response Lenses
    listMeetingTagsResponse_tags,
    listMeetingTagsResponse_httpStatus,
  )
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:/ 'newListMeetingTags' smart constructor.
data ListMeetingTags = ListMeetingTags'
  { -- | The Amazon Chime SDK meeting ID.
    ListMeetingTags -> Text
meetingId :: Prelude.Text
  }
  deriving (ListMeetingTags -> ListMeetingTags -> Bool
(ListMeetingTags -> ListMeetingTags -> Bool)
-> (ListMeetingTags -> ListMeetingTags -> Bool)
-> Eq ListMeetingTags
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListMeetingTags -> ListMeetingTags -> Bool
$c/= :: ListMeetingTags -> ListMeetingTags -> Bool
== :: ListMeetingTags -> ListMeetingTags -> Bool
$c== :: ListMeetingTags -> ListMeetingTags -> Bool
Prelude.Eq, ReadPrec [ListMeetingTags]
ReadPrec ListMeetingTags
Int -> ReadS ListMeetingTags
ReadS [ListMeetingTags]
(Int -> ReadS ListMeetingTags)
-> ReadS [ListMeetingTags]
-> ReadPrec ListMeetingTags
-> ReadPrec [ListMeetingTags]
-> Read ListMeetingTags
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListMeetingTags]
$creadListPrec :: ReadPrec [ListMeetingTags]
readPrec :: ReadPrec ListMeetingTags
$creadPrec :: ReadPrec ListMeetingTags
readList :: ReadS [ListMeetingTags]
$creadList :: ReadS [ListMeetingTags]
readsPrec :: Int -> ReadS ListMeetingTags
$creadsPrec :: Int -> ReadS ListMeetingTags
Prelude.Read, Int -> ListMeetingTags -> ShowS
[ListMeetingTags] -> ShowS
ListMeetingTags -> String
(Int -> ListMeetingTags -> ShowS)
-> (ListMeetingTags -> String)
-> ([ListMeetingTags] -> ShowS)
-> Show ListMeetingTags
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListMeetingTags] -> ShowS
$cshowList :: [ListMeetingTags] -> ShowS
show :: ListMeetingTags -> String
$cshow :: ListMeetingTags -> String
showsPrec :: Int -> ListMeetingTags -> ShowS
$cshowsPrec :: Int -> ListMeetingTags -> ShowS
Prelude.Show, (forall x. ListMeetingTags -> Rep ListMeetingTags x)
-> (forall x. Rep ListMeetingTags x -> ListMeetingTags)
-> Generic ListMeetingTags
forall x. Rep ListMeetingTags x -> ListMeetingTags
forall x. ListMeetingTags -> Rep ListMeetingTags x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListMeetingTags x -> ListMeetingTags
$cfrom :: forall x. ListMeetingTags -> Rep ListMeetingTags x
Prelude.Generic)

-- |
-- Create a value of 'ListMeetingTags' 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', 'listMeetingTags_meetingId' - The Amazon Chime SDK meeting ID.
newListMeetingTags ::
  -- | 'meetingId'
  Prelude.Text ->
  ListMeetingTags
newListMeetingTags :: Text -> ListMeetingTags
newListMeetingTags Text
pMeetingId_ =
  ListMeetingTags' :: Text -> ListMeetingTags
ListMeetingTags' {$sel:meetingId:ListMeetingTags' :: Text
meetingId = Text
pMeetingId_}

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

instance Core.AWSRequest ListMeetingTags where
  type
    AWSResponse ListMeetingTags =
      ListMeetingTagsResponse
  request :: ListMeetingTags -> Request ListMeetingTags
request = Service -> ListMeetingTags -> Request ListMeetingTags
forall a. ToRequest a => Service -> a -> Request a
Request.get Service
defaultService
  response :: Logger
-> Service
-> Proxy ListMeetingTags
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListMeetingTags)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse ListMeetingTags))
-> Logger
-> Service
-> Proxy ListMeetingTags
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListMeetingTags)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe (NonEmpty Tag) -> Int -> ListMeetingTagsResponse
ListMeetingTagsResponse'
            (Maybe (NonEmpty Tag) -> Int -> ListMeetingTagsResponse)
-> Either String (Maybe (NonEmpty Tag))
-> Either String (Int -> ListMeetingTagsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe (NonEmpty Tag))
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Tags")
            Either String (Int -> ListMeetingTagsResponse)
-> Either String Int -> Either String ListMeetingTagsResponse
forall (f :: * -> *) a b. Applicative f => 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 ListMeetingTags

instance Prelude.NFData ListMeetingTags

instance Core.ToHeaders ListMeetingTags where
  toHeaders :: ListMeetingTags -> ResponseHeaders
toHeaders = ResponseHeaders -> ListMeetingTags -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const ResponseHeaders
forall a. Monoid a => a
Prelude.mempty

instance Core.ToPath ListMeetingTags where
  toPath :: ListMeetingTags -> ByteString
toPath ListMeetingTags' {Text
meetingId :: Text
$sel:meetingId:ListMeetingTags' :: ListMeetingTags -> 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 ListMeetingTags where
  toQuery :: ListMeetingTags -> QueryString
toQuery = QueryString -> ListMeetingTags -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newListMeetingTagsResponse' smart constructor.
data ListMeetingTagsResponse = ListMeetingTagsResponse'
  { -- | A list of tag key-value pairs.
    ListMeetingTagsResponse -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
    -- | The response's http status code.
    ListMeetingTagsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ListMeetingTagsResponse -> ListMeetingTagsResponse -> Bool
(ListMeetingTagsResponse -> ListMeetingTagsResponse -> Bool)
-> (ListMeetingTagsResponse -> ListMeetingTagsResponse -> Bool)
-> Eq ListMeetingTagsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListMeetingTagsResponse -> ListMeetingTagsResponse -> Bool
$c/= :: ListMeetingTagsResponse -> ListMeetingTagsResponse -> Bool
== :: ListMeetingTagsResponse -> ListMeetingTagsResponse -> Bool
$c== :: ListMeetingTagsResponse -> ListMeetingTagsResponse -> Bool
Prelude.Eq, Int -> ListMeetingTagsResponse -> ShowS
[ListMeetingTagsResponse] -> ShowS
ListMeetingTagsResponse -> String
(Int -> ListMeetingTagsResponse -> ShowS)
-> (ListMeetingTagsResponse -> String)
-> ([ListMeetingTagsResponse] -> ShowS)
-> Show ListMeetingTagsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListMeetingTagsResponse] -> ShowS
$cshowList :: [ListMeetingTagsResponse] -> ShowS
show :: ListMeetingTagsResponse -> String
$cshow :: ListMeetingTagsResponse -> String
showsPrec :: Int -> ListMeetingTagsResponse -> ShowS
$cshowsPrec :: Int -> ListMeetingTagsResponse -> ShowS
Prelude.Show, (forall x.
 ListMeetingTagsResponse -> Rep ListMeetingTagsResponse x)
-> (forall x.
    Rep ListMeetingTagsResponse x -> ListMeetingTagsResponse)
-> Generic ListMeetingTagsResponse
forall x. Rep ListMeetingTagsResponse x -> ListMeetingTagsResponse
forall x. ListMeetingTagsResponse -> Rep ListMeetingTagsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListMeetingTagsResponse x -> ListMeetingTagsResponse
$cfrom :: forall x. ListMeetingTagsResponse -> Rep ListMeetingTagsResponse x
Prelude.Generic)

-- |
-- Create a value of 'ListMeetingTagsResponse' 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:
--
-- 'tags', 'listMeetingTagsResponse_tags' - A list of tag key-value pairs.
--
-- 'httpStatus', 'listMeetingTagsResponse_httpStatus' - The response's http status code.
newListMeetingTagsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ListMeetingTagsResponse
newListMeetingTagsResponse :: Int -> ListMeetingTagsResponse
newListMeetingTagsResponse Int
pHttpStatus_ =
  ListMeetingTagsResponse' :: Maybe (NonEmpty Tag) -> Int -> ListMeetingTagsResponse
ListMeetingTagsResponse'
    { $sel:tags:ListMeetingTagsResponse' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:ListMeetingTagsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | A list of tag key-value pairs.
listMeetingTagsResponse_tags :: Lens.Lens' ListMeetingTagsResponse (Prelude.Maybe (Prelude.NonEmpty Tag))
listMeetingTagsResponse_tags :: (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> ListMeetingTagsResponse -> f ListMeetingTagsResponse
listMeetingTagsResponse_tags = (ListMeetingTagsResponse -> Maybe (NonEmpty Tag))
-> (ListMeetingTagsResponse
    -> Maybe (NonEmpty Tag) -> ListMeetingTagsResponse)
-> Lens
     ListMeetingTagsResponse
     ListMeetingTagsResponse
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListMeetingTagsResponse' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:ListMeetingTagsResponse' :: ListMeetingTagsResponse -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: ListMeetingTagsResponse
s@ListMeetingTagsResponse' {} Maybe (NonEmpty Tag)
a -> ListMeetingTagsResponse
s {$sel:tags:ListMeetingTagsResponse' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: ListMeetingTagsResponse) ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
 -> ListMeetingTagsResponse -> f ListMeetingTagsResponse)
-> ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
    -> Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> ListMeetingTagsResponse
-> f ListMeetingTagsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
-> Iso
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListMeetingTagsResponse