{-# 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.WorkSpaces.ModifyClientProperties
-- 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)
--
-- Modifies the properties of the specified Amazon WorkSpaces clients.
module Amazonka.WorkSpaces.ModifyClientProperties
  ( -- * Creating a Request
    ModifyClientProperties (..),
    newModifyClientProperties,

    -- * Request Lenses
    modifyClientProperties_resourceId,
    modifyClientProperties_clientProperties,

    -- * Destructuring the Response
    ModifyClientPropertiesResponse (..),
    newModifyClientPropertiesResponse,

    -- * Response Lenses
    modifyClientPropertiesResponse_httpStatus,
  )
where

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
import Amazonka.WorkSpaces.Types

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

-- |
-- Create a value of 'ModifyClientProperties' 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', 'modifyClientProperties_resourceId' - The resource identifiers, in the form of directory IDs.
--
-- 'clientProperties', 'modifyClientProperties_clientProperties' - Information about the Amazon WorkSpaces client.
newModifyClientProperties ::
  -- | 'resourceId'
  Prelude.Text ->
  -- | 'clientProperties'
  ClientProperties ->
  ModifyClientProperties
newModifyClientProperties :: Text -> ClientProperties -> ModifyClientProperties
newModifyClientProperties
  Text
pResourceId_
  ClientProperties
pClientProperties_ =
    ModifyClientProperties' :: Text -> ClientProperties -> ModifyClientProperties
ModifyClientProperties'
      { $sel:resourceId:ModifyClientProperties' :: Text
resourceId = Text
pResourceId_,
        $sel:clientProperties:ModifyClientProperties' :: ClientProperties
clientProperties = ClientProperties
pClientProperties_
      }

-- | The resource identifiers, in the form of directory IDs.
modifyClientProperties_resourceId :: Lens.Lens' ModifyClientProperties Prelude.Text
modifyClientProperties_resourceId :: (Text -> f Text)
-> ModifyClientProperties -> f ModifyClientProperties
modifyClientProperties_resourceId = (ModifyClientProperties -> Text)
-> (ModifyClientProperties -> Text -> ModifyClientProperties)
-> Lens ModifyClientProperties ModifyClientProperties Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ModifyClientProperties' {Text
resourceId :: Text
$sel:resourceId:ModifyClientProperties' :: ModifyClientProperties -> Text
resourceId} -> Text
resourceId) (\s :: ModifyClientProperties
s@ModifyClientProperties' {} Text
a -> ModifyClientProperties
s {$sel:resourceId:ModifyClientProperties' :: Text
resourceId = Text
a} :: ModifyClientProperties)

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

instance Core.AWSRequest ModifyClientProperties where
  type
    AWSResponse ModifyClientProperties =
      ModifyClientPropertiesResponse
  request :: ModifyClientProperties -> Request ModifyClientProperties
request = Service -> ModifyClientProperties -> Request ModifyClientProperties
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy ModifyClientProperties
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ModifyClientProperties)))
response =
    (Int
 -> ResponseHeaders
 -> ()
 -> Either String (AWSResponse ModifyClientProperties))
-> Logger
-> Service
-> Proxy ModifyClientProperties
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse ModifyClientProperties)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> () -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveEmpty
      ( \Int
s ResponseHeaders
h ()
x ->
          Int -> ModifyClientPropertiesResponse
ModifyClientPropertiesResponse'
            (Int -> ModifyClientPropertiesResponse)
-> Either String Int
-> Either String ModifyClientPropertiesResponse
forall (f :: * -> *) a b. Functor 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 ModifyClientProperties

instance Prelude.NFData ModifyClientProperties

instance Core.ToHeaders ModifyClientProperties where
  toHeaders :: ModifyClientProperties -> ResponseHeaders
toHeaders =
    ResponseHeaders -> ModifyClientProperties -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"WorkspacesService.ModifyClientProperties" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON ModifyClientProperties where
  toJSON :: ModifyClientProperties -> Value
toJSON ModifyClientProperties' {Text
ClientProperties
clientProperties :: ClientProperties
resourceId :: Text
$sel:clientProperties:ModifyClientProperties' :: ModifyClientProperties -> ClientProperties
$sel:resourceId:ModifyClientProperties' :: ModifyClientProperties -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ResourceId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
resourceId),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"ClientProperties" Text -> ClientProperties -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= ClientProperties
clientProperties)
          ]
      )

instance Core.ToPath ModifyClientProperties where
  toPath :: ModifyClientProperties -> ByteString
toPath = ByteString -> ModifyClientProperties -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/"

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

-- | /See:/ 'newModifyClientPropertiesResponse' smart constructor.
data ModifyClientPropertiesResponse = ModifyClientPropertiesResponse'
  { -- | The response's http status code.
    ModifyClientPropertiesResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (ModifyClientPropertiesResponse
-> ModifyClientPropertiesResponse -> Bool
(ModifyClientPropertiesResponse
 -> ModifyClientPropertiesResponse -> Bool)
-> (ModifyClientPropertiesResponse
    -> ModifyClientPropertiesResponse -> Bool)
-> Eq ModifyClientPropertiesResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ModifyClientPropertiesResponse
-> ModifyClientPropertiesResponse -> Bool
$c/= :: ModifyClientPropertiesResponse
-> ModifyClientPropertiesResponse -> Bool
== :: ModifyClientPropertiesResponse
-> ModifyClientPropertiesResponse -> Bool
$c== :: ModifyClientPropertiesResponse
-> ModifyClientPropertiesResponse -> Bool
Prelude.Eq, ReadPrec [ModifyClientPropertiesResponse]
ReadPrec ModifyClientPropertiesResponse
Int -> ReadS ModifyClientPropertiesResponse
ReadS [ModifyClientPropertiesResponse]
(Int -> ReadS ModifyClientPropertiesResponse)
-> ReadS [ModifyClientPropertiesResponse]
-> ReadPrec ModifyClientPropertiesResponse
-> ReadPrec [ModifyClientPropertiesResponse]
-> Read ModifyClientPropertiesResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ModifyClientPropertiesResponse]
$creadListPrec :: ReadPrec [ModifyClientPropertiesResponse]
readPrec :: ReadPrec ModifyClientPropertiesResponse
$creadPrec :: ReadPrec ModifyClientPropertiesResponse
readList :: ReadS [ModifyClientPropertiesResponse]
$creadList :: ReadS [ModifyClientPropertiesResponse]
readsPrec :: Int -> ReadS ModifyClientPropertiesResponse
$creadsPrec :: Int -> ReadS ModifyClientPropertiesResponse
Prelude.Read, Int -> ModifyClientPropertiesResponse -> ShowS
[ModifyClientPropertiesResponse] -> ShowS
ModifyClientPropertiesResponse -> String
(Int -> ModifyClientPropertiesResponse -> ShowS)
-> (ModifyClientPropertiesResponse -> String)
-> ([ModifyClientPropertiesResponse] -> ShowS)
-> Show ModifyClientPropertiesResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ModifyClientPropertiesResponse] -> ShowS
$cshowList :: [ModifyClientPropertiesResponse] -> ShowS
show :: ModifyClientPropertiesResponse -> String
$cshow :: ModifyClientPropertiesResponse -> String
showsPrec :: Int -> ModifyClientPropertiesResponse -> ShowS
$cshowsPrec :: Int -> ModifyClientPropertiesResponse -> ShowS
Prelude.Show, (forall x.
 ModifyClientPropertiesResponse
 -> Rep ModifyClientPropertiesResponse x)
-> (forall x.
    Rep ModifyClientPropertiesResponse x
    -> ModifyClientPropertiesResponse)
-> Generic ModifyClientPropertiesResponse
forall x.
Rep ModifyClientPropertiesResponse x
-> ModifyClientPropertiesResponse
forall x.
ModifyClientPropertiesResponse
-> Rep ModifyClientPropertiesResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ModifyClientPropertiesResponse x
-> ModifyClientPropertiesResponse
$cfrom :: forall x.
ModifyClientPropertiesResponse
-> Rep ModifyClientPropertiesResponse x
Prelude.Generic)

-- |
-- Create a value of 'ModifyClientPropertiesResponse' 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:
--
-- 'httpStatus', 'modifyClientPropertiesResponse_httpStatus' - The response's http status code.
newModifyClientPropertiesResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  ModifyClientPropertiesResponse
newModifyClientPropertiesResponse :: Int -> ModifyClientPropertiesResponse
newModifyClientPropertiesResponse Int
pHttpStatus_ =
  ModifyClientPropertiesResponse' :: Int -> ModifyClientPropertiesResponse
ModifyClientPropertiesResponse'
    { $sel:httpStatus:ModifyClientPropertiesResponse' :: Int
httpStatus =
        Int
pHttpStatus_
    }

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

instance
  Prelude.NFData
    ModifyClientPropertiesResponse