{-# 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.ListAttendeeTags
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Lists the tags applied to an Amazon Chime SDK attendee resource.
module Amazonka.Chime.ListAttendeeTags
  ( -- * Creating a Request
    ListAttendeeTags (..),
    newListAttendeeTags,

    -- * Request Lenses
    listAttendeeTags_meetingId,
    listAttendeeTags_attendeeId,

    -- * Destructuring the Response
    ListAttendeeTagsResponse (..),
    newListAttendeeTagsResponse,

    -- * Response Lenses
    listAttendeeTagsResponse_tags,
    listAttendeeTagsResponse_httpStatus,
  )
where

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

-- | /See:/ 'newListAttendeeTags' smart constructor.
data ListAttendeeTags = ListAttendeeTags'
  { -- | The Amazon Chime SDK meeting ID.
    ListAttendeeTags -> Text
meetingId :: Prelude.Text,
    -- | The Amazon Chime SDK attendee ID.
    ListAttendeeTags -> Text
attendeeId :: Prelude.Text
  }
  deriving (ListAttendeeTags -> ListAttendeeTags -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ListAttendeeTags -> ListAttendeeTags -> Bool
$c/= :: ListAttendeeTags -> ListAttendeeTags -> Bool
== :: ListAttendeeTags -> ListAttendeeTags -> Bool
$c== :: ListAttendeeTags -> ListAttendeeTags -> Bool
Prelude.Eq, ReadPrec [ListAttendeeTags]
ReadPrec ListAttendeeTags
Int -> ReadS ListAttendeeTags
ReadS [ListAttendeeTags]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ListAttendeeTags]
$creadListPrec :: ReadPrec [ListAttendeeTags]
readPrec :: ReadPrec ListAttendeeTags
$creadPrec :: ReadPrec ListAttendeeTags
readList :: ReadS [ListAttendeeTags]
$creadList :: ReadS [ListAttendeeTags]
readsPrec :: Int -> ReadS ListAttendeeTags
$creadsPrec :: Int -> ReadS ListAttendeeTags
Prelude.Read, Int -> ListAttendeeTags -> ShowS
[ListAttendeeTags] -> ShowS
ListAttendeeTags -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ListAttendeeTags] -> ShowS
$cshowList :: [ListAttendeeTags] -> ShowS
show :: ListAttendeeTags -> String
$cshow :: ListAttendeeTags -> String
showsPrec :: Int -> ListAttendeeTags -> ShowS
$cshowsPrec :: Int -> ListAttendeeTags -> ShowS
Prelude.Show, forall x. Rep ListAttendeeTags x -> ListAttendeeTags
forall x. ListAttendeeTags -> Rep ListAttendeeTags x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ListAttendeeTags x -> ListAttendeeTags
$cfrom :: forall x. ListAttendeeTags -> Rep ListAttendeeTags x
Prelude.Generic)

-- |
-- Create a value of 'ListAttendeeTags' 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', 'listAttendeeTags_meetingId' - The Amazon Chime SDK meeting ID.
--
-- 'attendeeId', 'listAttendeeTags_attendeeId' - The Amazon Chime SDK attendee ID.
newListAttendeeTags ::
  -- | 'meetingId'
  Prelude.Text ->
  -- | 'attendeeId'
  Prelude.Text ->
  ListAttendeeTags
newListAttendeeTags :: Text -> Text -> ListAttendeeTags
newListAttendeeTags Text
pMeetingId_ Text
pAttendeeId_ =
  ListAttendeeTags'
    { $sel:meetingId:ListAttendeeTags' :: Text
meetingId = Text
pMeetingId_,
      $sel:attendeeId:ListAttendeeTags' :: Text
attendeeId = Text
pAttendeeId_
    }

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

-- | The Amazon Chime SDK attendee ID.
listAttendeeTags_attendeeId :: Lens.Lens' ListAttendeeTags Prelude.Text
listAttendeeTags_attendeeId :: Lens' ListAttendeeTags Text
listAttendeeTags_attendeeId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAttendeeTags' {Text
attendeeId :: Text
$sel:attendeeId:ListAttendeeTags' :: ListAttendeeTags -> Text
attendeeId} -> Text
attendeeId) (\s :: ListAttendeeTags
s@ListAttendeeTags' {} Text
a -> ListAttendeeTags
s {$sel:attendeeId:ListAttendeeTags' :: Text
attendeeId = Text
a} :: ListAttendeeTags)

instance Core.AWSRequest ListAttendeeTags where
  type
    AWSResponse ListAttendeeTags =
      ListAttendeeTagsResponse
  request :: (Service -> Service)
-> ListAttendeeTags -> Request ListAttendeeTags
request Service -> Service
overrides =
    forall a. ToRequest a => Service -> a -> Request a
Request.get (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy ListAttendeeTags
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse ListAttendeeTags)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe (NonEmpty Tag) -> Int -> ListAttendeeTagsResponse
ListAttendeeTagsResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Tags")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable ListAttendeeTags where
  hashWithSalt :: Int -> ListAttendeeTags -> Int
hashWithSalt Int
_salt ListAttendeeTags' {Text
attendeeId :: Text
meetingId :: Text
$sel:attendeeId:ListAttendeeTags' :: ListAttendeeTags -> Text
$sel:meetingId:ListAttendeeTags' :: ListAttendeeTags -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
meetingId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
attendeeId

instance Prelude.NFData ListAttendeeTags where
  rnf :: ListAttendeeTags -> ()
rnf ListAttendeeTags' {Text
attendeeId :: Text
meetingId :: Text
$sel:attendeeId:ListAttendeeTags' :: ListAttendeeTags -> Text
$sel:meetingId:ListAttendeeTags' :: ListAttendeeTags -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
meetingId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
attendeeId

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

instance Data.ToPath ListAttendeeTags where
  toPath :: ListAttendeeTags -> ByteString
toPath ListAttendeeTags' {Text
attendeeId :: Text
meetingId :: Text
$sel:attendeeId:ListAttendeeTags' :: ListAttendeeTags -> Text
$sel:meetingId:ListAttendeeTags' :: ListAttendeeTags -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/meetings/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
meetingId,
        ByteString
"/attendees/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
attendeeId,
        ByteString
"/tags"
      ]

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

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

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

-- | A list of tag key-value pairs.
listAttendeeTagsResponse_tags :: Lens.Lens' ListAttendeeTagsResponse (Prelude.Maybe (Prelude.NonEmpty Tag))
listAttendeeTagsResponse_tags :: Lens' ListAttendeeTagsResponse (Maybe (NonEmpty Tag))
listAttendeeTagsResponse_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ListAttendeeTagsResponse' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:ListAttendeeTagsResponse' :: ListAttendeeTagsResponse -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: ListAttendeeTagsResponse
s@ListAttendeeTagsResponse' {} Maybe (NonEmpty Tag)
a -> ListAttendeeTagsResponse
s {$sel:tags:ListAttendeeTagsResponse' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: ListAttendeeTagsResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

instance Prelude.NFData ListAttendeeTagsResponse where
  rnf :: ListAttendeeTagsResponse -> ()
rnf ListAttendeeTagsResponse' {Int
Maybe (NonEmpty Tag)
httpStatus :: Int
tags :: Maybe (NonEmpty Tag)
$sel:httpStatus:ListAttendeeTagsResponse' :: ListAttendeeTagsResponse -> Int
$sel:tags:ListAttendeeTagsResponse' :: ListAttendeeTagsResponse -> Maybe (NonEmpty Tag)
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Tag)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus