{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
{-# OPTIONS_GHC -fno-warn-unused-matches #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.RolesAnywhere.Types.ProfileDetailResponse
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.RolesAnywhere.Types.ProfileDetailResponse where

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 Amazonka.RolesAnywhere.Types.ProfileDetail

-- | /See:/ 'newProfileDetailResponse' smart constructor.
data ProfileDetailResponse = ProfileDetailResponse'
  { -- | The state of the profile after a read or write operation.
    ProfileDetailResponse -> Maybe ProfileDetail
profile :: Prelude.Maybe ProfileDetail
  }
  deriving (ProfileDetailResponse -> ProfileDetailResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProfileDetailResponse -> ProfileDetailResponse -> Bool
$c/= :: ProfileDetailResponse -> ProfileDetailResponse -> Bool
== :: ProfileDetailResponse -> ProfileDetailResponse -> Bool
$c== :: ProfileDetailResponse -> ProfileDetailResponse -> Bool
Prelude.Eq, ReadPrec [ProfileDetailResponse]
ReadPrec ProfileDetailResponse
Int -> ReadS ProfileDetailResponse
ReadS [ProfileDetailResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProfileDetailResponse]
$creadListPrec :: ReadPrec [ProfileDetailResponse]
readPrec :: ReadPrec ProfileDetailResponse
$creadPrec :: ReadPrec ProfileDetailResponse
readList :: ReadS [ProfileDetailResponse]
$creadList :: ReadS [ProfileDetailResponse]
readsPrec :: Int -> ReadS ProfileDetailResponse
$creadsPrec :: Int -> ReadS ProfileDetailResponse
Prelude.Read, Int -> ProfileDetailResponse -> ShowS
[ProfileDetailResponse] -> ShowS
ProfileDetailResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProfileDetailResponse] -> ShowS
$cshowList :: [ProfileDetailResponse] -> ShowS
show :: ProfileDetailResponse -> String
$cshow :: ProfileDetailResponse -> String
showsPrec :: Int -> ProfileDetailResponse -> ShowS
$cshowsPrec :: Int -> ProfileDetailResponse -> ShowS
Prelude.Show, forall x. Rep ProfileDetailResponse x -> ProfileDetailResponse
forall x. ProfileDetailResponse -> Rep ProfileDetailResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ProfileDetailResponse x -> ProfileDetailResponse
$cfrom :: forall x. ProfileDetailResponse -> Rep ProfileDetailResponse x
Prelude.Generic)

-- |
-- Create a value of 'ProfileDetailResponse' 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:
--
-- 'profile', 'profileDetailResponse_profile' - The state of the profile after a read or write operation.
newProfileDetailResponse ::
  ProfileDetailResponse
newProfileDetailResponse :: ProfileDetailResponse
newProfileDetailResponse =
  ProfileDetailResponse' {$sel:profile:ProfileDetailResponse' :: Maybe ProfileDetail
profile = forall a. Maybe a
Prelude.Nothing}

-- | The state of the profile after a read or write operation.
profileDetailResponse_profile :: Lens.Lens' ProfileDetailResponse (Prelude.Maybe ProfileDetail)
profileDetailResponse_profile :: Lens' ProfileDetailResponse (Maybe ProfileDetail)
profileDetailResponse_profile = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProfileDetailResponse' {Maybe ProfileDetail
profile :: Maybe ProfileDetail
$sel:profile:ProfileDetailResponse' :: ProfileDetailResponse -> Maybe ProfileDetail
profile} -> Maybe ProfileDetail
profile) (\s :: ProfileDetailResponse
s@ProfileDetailResponse' {} Maybe ProfileDetail
a -> ProfileDetailResponse
s {$sel:profile:ProfileDetailResponse' :: Maybe ProfileDetail
profile = Maybe ProfileDetail
a} :: ProfileDetailResponse)

instance Data.FromJSON ProfileDetailResponse where
  parseJSON :: Value -> Parser ProfileDetailResponse
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ProfileDetailResponse"
      ( \Object
x ->
          Maybe ProfileDetail -> ProfileDetailResponse
ProfileDetailResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"profile")
      )

instance Prelude.Hashable ProfileDetailResponse where
  hashWithSalt :: Int -> ProfileDetailResponse -> Int
hashWithSalt Int
_salt ProfileDetailResponse' {Maybe ProfileDetail
profile :: Maybe ProfileDetail
$sel:profile:ProfileDetailResponse' :: ProfileDetailResponse -> Maybe ProfileDetail
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ProfileDetail
profile

instance Prelude.NFData ProfileDetailResponse where
  rnf :: ProfileDetailResponse -> ()
rnf ProfileDetailResponse' {Maybe ProfileDetail
profile :: Maybe ProfileDetail
$sel:profile:ProfileDetailResponse' :: ProfileDetailResponse -> Maybe ProfileDetail
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe ProfileDetail
profile