{-# 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.ChimeSDKIdentity.DescribeAppInstanceUser
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- Returns the full details of an @AppInstanceUser@.
module Amazonka.ChimeSDKIdentity.DescribeAppInstanceUser
  ( -- * Creating a Request
    DescribeAppInstanceUser (..),
    newDescribeAppInstanceUser,

    -- * Request Lenses
    describeAppInstanceUser_appInstanceUserArn,

    -- * Destructuring the Response
    DescribeAppInstanceUserResponse (..),
    newDescribeAppInstanceUserResponse,

    -- * Response Lenses
    describeAppInstanceUserResponse_appInstanceUser,
    describeAppInstanceUserResponse_httpStatus,
  )
where

import Amazonka.ChimeSDKIdentity.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:/ 'newDescribeAppInstanceUser' smart constructor.
data DescribeAppInstanceUser = DescribeAppInstanceUser'
  { -- | The ARN of the @AppInstanceUser@.
    DescribeAppInstanceUser -> Text
appInstanceUserArn :: Prelude.Text
  }
  deriving (DescribeAppInstanceUser -> DescribeAppInstanceUser -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAppInstanceUser -> DescribeAppInstanceUser -> Bool
$c/= :: DescribeAppInstanceUser -> DescribeAppInstanceUser -> Bool
== :: DescribeAppInstanceUser -> DescribeAppInstanceUser -> Bool
$c== :: DescribeAppInstanceUser -> DescribeAppInstanceUser -> Bool
Prelude.Eq, ReadPrec [DescribeAppInstanceUser]
ReadPrec DescribeAppInstanceUser
Int -> ReadS DescribeAppInstanceUser
ReadS [DescribeAppInstanceUser]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeAppInstanceUser]
$creadListPrec :: ReadPrec [DescribeAppInstanceUser]
readPrec :: ReadPrec DescribeAppInstanceUser
$creadPrec :: ReadPrec DescribeAppInstanceUser
readList :: ReadS [DescribeAppInstanceUser]
$creadList :: ReadS [DescribeAppInstanceUser]
readsPrec :: Int -> ReadS DescribeAppInstanceUser
$creadsPrec :: Int -> ReadS DescribeAppInstanceUser
Prelude.Read, Int -> DescribeAppInstanceUser -> ShowS
[DescribeAppInstanceUser] -> ShowS
DescribeAppInstanceUser -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAppInstanceUser] -> ShowS
$cshowList :: [DescribeAppInstanceUser] -> ShowS
show :: DescribeAppInstanceUser -> String
$cshow :: DescribeAppInstanceUser -> String
showsPrec :: Int -> DescribeAppInstanceUser -> ShowS
$cshowsPrec :: Int -> DescribeAppInstanceUser -> ShowS
Prelude.Show, forall x. Rep DescribeAppInstanceUser x -> DescribeAppInstanceUser
forall x. DescribeAppInstanceUser -> Rep DescribeAppInstanceUser x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DescribeAppInstanceUser x -> DescribeAppInstanceUser
$cfrom :: forall x. DescribeAppInstanceUser -> Rep DescribeAppInstanceUser x
Prelude.Generic)

-- |
-- Create a value of 'DescribeAppInstanceUser' 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:
--
-- 'appInstanceUserArn', 'describeAppInstanceUser_appInstanceUserArn' - The ARN of the @AppInstanceUser@.
newDescribeAppInstanceUser ::
  -- | 'appInstanceUserArn'
  Prelude.Text ->
  DescribeAppInstanceUser
newDescribeAppInstanceUser :: Text -> DescribeAppInstanceUser
newDescribeAppInstanceUser Text
pAppInstanceUserArn_ =
  DescribeAppInstanceUser'
    { $sel:appInstanceUserArn:DescribeAppInstanceUser' :: Text
appInstanceUserArn =
        Text
pAppInstanceUserArn_
    }

-- | The ARN of the @AppInstanceUser@.
describeAppInstanceUser_appInstanceUserArn :: Lens.Lens' DescribeAppInstanceUser Prelude.Text
describeAppInstanceUser_appInstanceUserArn :: Lens' DescribeAppInstanceUser Text
describeAppInstanceUser_appInstanceUserArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAppInstanceUser' {Text
appInstanceUserArn :: Text
$sel:appInstanceUserArn:DescribeAppInstanceUser' :: DescribeAppInstanceUser -> Text
appInstanceUserArn} -> Text
appInstanceUserArn) (\s :: DescribeAppInstanceUser
s@DescribeAppInstanceUser' {} Text
a -> DescribeAppInstanceUser
s {$sel:appInstanceUserArn:DescribeAppInstanceUser' :: Text
appInstanceUserArn = Text
a} :: DescribeAppInstanceUser)

instance Core.AWSRequest DescribeAppInstanceUser where
  type
    AWSResponse DescribeAppInstanceUser =
      DescribeAppInstanceUserResponse
  request :: (Service -> Service)
-> DescribeAppInstanceUser -> Request DescribeAppInstanceUser
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 DescribeAppInstanceUser
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeAppInstanceUser)))
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 AppInstanceUser -> Int -> DescribeAppInstanceUserResponse
DescribeAppInstanceUserResponse'
            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
"AppInstanceUser")
            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 DescribeAppInstanceUser where
  hashWithSalt :: Int -> DescribeAppInstanceUser -> Int
hashWithSalt Int
_salt DescribeAppInstanceUser' {Text
appInstanceUserArn :: Text
$sel:appInstanceUserArn:DescribeAppInstanceUser' :: DescribeAppInstanceUser -> Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
appInstanceUserArn

instance Prelude.NFData DescribeAppInstanceUser where
  rnf :: DescribeAppInstanceUser -> ()
rnf DescribeAppInstanceUser' {Text
appInstanceUserArn :: Text
$sel:appInstanceUserArn:DescribeAppInstanceUser' :: DescribeAppInstanceUser -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
appInstanceUserArn

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

instance Data.ToPath DescribeAppInstanceUser where
  toPath :: DescribeAppInstanceUser -> ByteString
toPath DescribeAppInstanceUser' {Text
appInstanceUserArn :: Text
$sel:appInstanceUserArn:DescribeAppInstanceUser' :: DescribeAppInstanceUser -> Text
..} =
    forall a. Monoid a => [a] -> a
Prelude.mconcat
      [ ByteString
"/app-instance-users/",
        forall a. ToByteString a => a -> ByteString
Data.toBS Text
appInstanceUserArn
      ]

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

-- | /See:/ 'newDescribeAppInstanceUserResponse' smart constructor.
data DescribeAppInstanceUserResponse = DescribeAppInstanceUserResponse'
  { -- | The name of the @AppInstanceUser@.
    DescribeAppInstanceUserResponse -> Maybe AppInstanceUser
appInstanceUser :: Prelude.Maybe AppInstanceUser,
    -- | The response's http status code.
    DescribeAppInstanceUserResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (DescribeAppInstanceUserResponse
-> DescribeAppInstanceUserResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeAppInstanceUserResponse
-> DescribeAppInstanceUserResponse -> Bool
$c/= :: DescribeAppInstanceUserResponse
-> DescribeAppInstanceUserResponse -> Bool
== :: DescribeAppInstanceUserResponse
-> DescribeAppInstanceUserResponse -> Bool
$c== :: DescribeAppInstanceUserResponse
-> DescribeAppInstanceUserResponse -> Bool
Prelude.Eq, Int -> DescribeAppInstanceUserResponse -> ShowS
[DescribeAppInstanceUserResponse] -> ShowS
DescribeAppInstanceUserResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeAppInstanceUserResponse] -> ShowS
$cshowList :: [DescribeAppInstanceUserResponse] -> ShowS
show :: DescribeAppInstanceUserResponse -> String
$cshow :: DescribeAppInstanceUserResponse -> String
showsPrec :: Int -> DescribeAppInstanceUserResponse -> ShowS
$cshowsPrec :: Int -> DescribeAppInstanceUserResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeAppInstanceUserResponse x
-> DescribeAppInstanceUserResponse
forall x.
DescribeAppInstanceUserResponse
-> Rep DescribeAppInstanceUserResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeAppInstanceUserResponse x
-> DescribeAppInstanceUserResponse
$cfrom :: forall x.
DescribeAppInstanceUserResponse
-> Rep DescribeAppInstanceUserResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeAppInstanceUserResponse' 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:
--
-- 'appInstanceUser', 'describeAppInstanceUserResponse_appInstanceUser' - The name of the @AppInstanceUser@.
--
-- 'httpStatus', 'describeAppInstanceUserResponse_httpStatus' - The response's http status code.
newDescribeAppInstanceUserResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  DescribeAppInstanceUserResponse
newDescribeAppInstanceUserResponse :: Int -> DescribeAppInstanceUserResponse
newDescribeAppInstanceUserResponse Int
pHttpStatus_ =
  DescribeAppInstanceUserResponse'
    { $sel:appInstanceUser:DescribeAppInstanceUserResponse' :: Maybe AppInstanceUser
appInstanceUser =
        forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:DescribeAppInstanceUserResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | The name of the @AppInstanceUser@.
describeAppInstanceUserResponse_appInstanceUser :: Lens.Lens' DescribeAppInstanceUserResponse (Prelude.Maybe AppInstanceUser)
describeAppInstanceUserResponse_appInstanceUser :: Lens' DescribeAppInstanceUserResponse (Maybe AppInstanceUser)
describeAppInstanceUserResponse_appInstanceUser = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeAppInstanceUserResponse' {Maybe AppInstanceUser
appInstanceUser :: Maybe AppInstanceUser
$sel:appInstanceUser:DescribeAppInstanceUserResponse' :: DescribeAppInstanceUserResponse -> Maybe AppInstanceUser
appInstanceUser} -> Maybe AppInstanceUser
appInstanceUser) (\s :: DescribeAppInstanceUserResponse
s@DescribeAppInstanceUserResponse' {} Maybe AppInstanceUser
a -> DescribeAppInstanceUserResponse
s {$sel:appInstanceUser:DescribeAppInstanceUserResponse' :: Maybe AppInstanceUser
appInstanceUser = Maybe AppInstanceUser
a} :: DescribeAppInstanceUserResponse)

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

instance
  Prelude.NFData
    DescribeAppInstanceUserResponse
  where
  rnf :: DescribeAppInstanceUserResponse -> ()
rnf DescribeAppInstanceUserResponse' {Int
Maybe AppInstanceUser
httpStatus :: Int
appInstanceUser :: Maybe AppInstanceUser
$sel:httpStatus:DescribeAppInstanceUserResponse' :: DescribeAppInstanceUserResponse -> Int
$sel:appInstanceUser:DescribeAppInstanceUserResponse' :: DescribeAppInstanceUserResponse -> Maybe AppInstanceUser
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe AppInstanceUser
appInstanceUser
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Int
httpStatus