{-# 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.WorkSpaces.Types.ClientPropertiesResult
-- 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)
module Amazonka.WorkSpaces.Types.ClientPropertiesResult where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.WorkSpaces.Types.ClientProperties

-- | Information about the Amazon WorkSpaces client.
--
-- /See:/ 'newClientPropertiesResult' smart constructor.
data ClientPropertiesResult = ClientPropertiesResult'
  { -- | The resource identifier, in the form of a directory ID.
    ClientPropertiesResult -> Maybe Text
resourceId :: Prelude.Maybe Prelude.Text,
    -- | Information about the Amazon WorkSpaces client.
    ClientPropertiesResult -> Maybe ClientProperties
clientProperties :: Prelude.Maybe ClientProperties
  }
  deriving (ClientPropertiesResult -> ClientPropertiesResult -> Bool
(ClientPropertiesResult -> ClientPropertiesResult -> Bool)
-> (ClientPropertiesResult -> ClientPropertiesResult -> Bool)
-> Eq ClientPropertiesResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ClientPropertiesResult -> ClientPropertiesResult -> Bool
$c/= :: ClientPropertiesResult -> ClientPropertiesResult -> Bool
== :: ClientPropertiesResult -> ClientPropertiesResult -> Bool
$c== :: ClientPropertiesResult -> ClientPropertiesResult -> Bool
Prelude.Eq, ReadPrec [ClientPropertiesResult]
ReadPrec ClientPropertiesResult
Int -> ReadS ClientPropertiesResult
ReadS [ClientPropertiesResult]
(Int -> ReadS ClientPropertiesResult)
-> ReadS [ClientPropertiesResult]
-> ReadPrec ClientPropertiesResult
-> ReadPrec [ClientPropertiesResult]
-> Read ClientPropertiesResult
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ClientPropertiesResult]
$creadListPrec :: ReadPrec [ClientPropertiesResult]
readPrec :: ReadPrec ClientPropertiesResult
$creadPrec :: ReadPrec ClientPropertiesResult
readList :: ReadS [ClientPropertiesResult]
$creadList :: ReadS [ClientPropertiesResult]
readsPrec :: Int -> ReadS ClientPropertiesResult
$creadsPrec :: Int -> ReadS ClientPropertiesResult
Prelude.Read, Int -> ClientPropertiesResult -> ShowS
[ClientPropertiesResult] -> ShowS
ClientPropertiesResult -> String
(Int -> ClientPropertiesResult -> ShowS)
-> (ClientPropertiesResult -> String)
-> ([ClientPropertiesResult] -> ShowS)
-> Show ClientPropertiesResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ClientPropertiesResult] -> ShowS
$cshowList :: [ClientPropertiesResult] -> ShowS
show :: ClientPropertiesResult -> String
$cshow :: ClientPropertiesResult -> String
showsPrec :: Int -> ClientPropertiesResult -> ShowS
$cshowsPrec :: Int -> ClientPropertiesResult -> ShowS
Prelude.Show, (forall x. ClientPropertiesResult -> Rep ClientPropertiesResult x)
-> (forall x.
    Rep ClientPropertiesResult x -> ClientPropertiesResult)
-> Generic ClientPropertiesResult
forall x. Rep ClientPropertiesResult x -> ClientPropertiesResult
forall x. ClientPropertiesResult -> Rep ClientPropertiesResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ClientPropertiesResult x -> ClientPropertiesResult
$cfrom :: forall x. ClientPropertiesResult -> Rep ClientPropertiesResult x
Prelude.Generic)

-- |
-- Create a value of 'ClientPropertiesResult' 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:
--
-- 'resourceId', 'clientPropertiesResult_resourceId' - The resource identifier, in the form of a directory ID.
--
-- 'clientProperties', 'clientPropertiesResult_clientProperties' - Information about the Amazon WorkSpaces client.
newClientPropertiesResult ::
  ClientPropertiesResult
newClientPropertiesResult :: ClientPropertiesResult
newClientPropertiesResult =
  ClientPropertiesResult' :: Maybe Text -> Maybe ClientProperties -> ClientPropertiesResult
ClientPropertiesResult'
    { $sel:resourceId:ClientPropertiesResult' :: Maybe Text
resourceId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:clientProperties:ClientPropertiesResult' :: Maybe ClientProperties
clientProperties = Maybe ClientProperties
forall a. Maybe a
Prelude.Nothing
    }

-- | The resource identifier, in the form of a directory ID.
clientPropertiesResult_resourceId :: Lens.Lens' ClientPropertiesResult (Prelude.Maybe Prelude.Text)
clientPropertiesResult_resourceId :: (Maybe Text -> f (Maybe Text))
-> ClientPropertiesResult -> f ClientPropertiesResult
clientPropertiesResult_resourceId = (ClientPropertiesResult -> Maybe Text)
-> (ClientPropertiesResult -> Maybe Text -> ClientPropertiesResult)
-> Lens
     ClientPropertiesResult
     ClientPropertiesResult
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClientPropertiesResult' {Maybe Text
resourceId :: Maybe Text
$sel:resourceId:ClientPropertiesResult' :: ClientPropertiesResult -> Maybe Text
resourceId} -> Maybe Text
resourceId) (\s :: ClientPropertiesResult
s@ClientPropertiesResult' {} Maybe Text
a -> ClientPropertiesResult
s {$sel:resourceId:ClientPropertiesResult' :: Maybe Text
resourceId = Maybe Text
a} :: ClientPropertiesResult)

-- | Information about the Amazon WorkSpaces client.
clientPropertiesResult_clientProperties :: Lens.Lens' ClientPropertiesResult (Prelude.Maybe ClientProperties)
clientPropertiesResult_clientProperties :: (Maybe ClientProperties -> f (Maybe ClientProperties))
-> ClientPropertiesResult -> f ClientPropertiesResult
clientPropertiesResult_clientProperties = (ClientPropertiesResult -> Maybe ClientProperties)
-> (ClientPropertiesResult
    -> Maybe ClientProperties -> ClientPropertiesResult)
-> Lens
     ClientPropertiesResult
     ClientPropertiesResult
     (Maybe ClientProperties)
     (Maybe ClientProperties)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ClientPropertiesResult' {Maybe ClientProperties
clientProperties :: Maybe ClientProperties
$sel:clientProperties:ClientPropertiesResult' :: ClientPropertiesResult -> Maybe ClientProperties
clientProperties} -> Maybe ClientProperties
clientProperties) (\s :: ClientPropertiesResult
s@ClientPropertiesResult' {} Maybe ClientProperties
a -> ClientPropertiesResult
s {$sel:clientProperties:ClientPropertiesResult' :: Maybe ClientProperties
clientProperties = Maybe ClientProperties
a} :: ClientPropertiesResult)

instance Core.FromJSON ClientPropertiesResult where
  parseJSON :: Value -> Parser ClientPropertiesResult
parseJSON =
    String
-> (Object -> Parser ClientPropertiesResult)
-> Value
-> Parser ClientPropertiesResult
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ClientPropertiesResult"
      ( \Object
x ->
          Maybe Text -> Maybe ClientProperties -> ClientPropertiesResult
ClientPropertiesResult'
            (Maybe Text -> Maybe ClientProperties -> ClientPropertiesResult)
-> Parser (Maybe Text)
-> Parser (Maybe ClientProperties -> ClientPropertiesResult)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ResourceId")
            Parser (Maybe ClientProperties -> ClientPropertiesResult)
-> Parser (Maybe ClientProperties) -> Parser ClientPropertiesResult
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ClientProperties)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ClientProperties")
      )

instance Prelude.Hashable ClientPropertiesResult

instance Prelude.NFData ClientPropertiesResult