{-# 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.OpsWorksCM.UpdateServer
-- 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)
--
-- Updates settings for a server.
--
-- This operation is synchronous.
module Amazonka.OpsWorksCM.UpdateServer
  ( -- * Creating a Request
    UpdateServer (..),
    newUpdateServer,

    -- * Request Lenses
    updateServer_disableAutomatedBackup,
    updateServer_preferredMaintenanceWindow,
    updateServer_preferredBackupWindow,
    updateServer_backupRetentionCount,
    updateServer_serverName,

    -- * Destructuring the Response
    UpdateServerResponse (..),
    newUpdateServerResponse,

    -- * Response Lenses
    updateServerResponse_server,
    updateServerResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.OpsWorksCM.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newUpdateServer' smart constructor.
data UpdateServer = UpdateServer'
  { -- | Setting DisableAutomatedBackup to @true@ disables automated or scheduled
    -- backups. Automated backups are enabled by default.
    UpdateServer -> Maybe Bool
disableAutomatedBackup :: Prelude.Maybe Prelude.Bool,
    UpdateServer -> Maybe Text
preferredMaintenanceWindow :: Prelude.Maybe Prelude.Text,
    UpdateServer -> Maybe Text
preferredBackupWindow :: Prelude.Maybe Prelude.Text,
    -- | Sets the number of automated backups that you want to keep.
    UpdateServer -> Maybe Int
backupRetentionCount :: Prelude.Maybe Prelude.Int,
    -- | The name of the server to update.
    UpdateServer -> Text
serverName :: Prelude.Text
  }
  deriving (UpdateServer -> UpdateServer -> Bool
(UpdateServer -> UpdateServer -> Bool)
-> (UpdateServer -> UpdateServer -> Bool) -> Eq UpdateServer
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateServer -> UpdateServer -> Bool
$c/= :: UpdateServer -> UpdateServer -> Bool
== :: UpdateServer -> UpdateServer -> Bool
$c== :: UpdateServer -> UpdateServer -> Bool
Prelude.Eq, ReadPrec [UpdateServer]
ReadPrec UpdateServer
Int -> ReadS UpdateServer
ReadS [UpdateServer]
(Int -> ReadS UpdateServer)
-> ReadS [UpdateServer]
-> ReadPrec UpdateServer
-> ReadPrec [UpdateServer]
-> Read UpdateServer
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [UpdateServer]
$creadListPrec :: ReadPrec [UpdateServer]
readPrec :: ReadPrec UpdateServer
$creadPrec :: ReadPrec UpdateServer
readList :: ReadS [UpdateServer]
$creadList :: ReadS [UpdateServer]
readsPrec :: Int -> ReadS UpdateServer
$creadsPrec :: Int -> ReadS UpdateServer
Prelude.Read, Int -> UpdateServer -> ShowS
[UpdateServer] -> ShowS
UpdateServer -> String
(Int -> UpdateServer -> ShowS)
-> (UpdateServer -> String)
-> ([UpdateServer] -> ShowS)
-> Show UpdateServer
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateServer] -> ShowS
$cshowList :: [UpdateServer] -> ShowS
show :: UpdateServer -> String
$cshow :: UpdateServer -> String
showsPrec :: Int -> UpdateServer -> ShowS
$cshowsPrec :: Int -> UpdateServer -> ShowS
Prelude.Show, (forall x. UpdateServer -> Rep UpdateServer x)
-> (forall x. Rep UpdateServer x -> UpdateServer)
-> Generic UpdateServer
forall x. Rep UpdateServer x -> UpdateServer
forall x. UpdateServer -> Rep UpdateServer x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateServer x -> UpdateServer
$cfrom :: forall x. UpdateServer -> Rep UpdateServer x
Prelude.Generic)

-- |
-- Create a value of 'UpdateServer' 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:
--
-- 'disableAutomatedBackup', 'updateServer_disableAutomatedBackup' - Setting DisableAutomatedBackup to @true@ disables automated or scheduled
-- backups. Automated backups are enabled by default.
--
-- 'preferredMaintenanceWindow', 'updateServer_preferredMaintenanceWindow' - Undocumented member.
--
-- 'preferredBackupWindow', 'updateServer_preferredBackupWindow' - Undocumented member.
--
-- 'backupRetentionCount', 'updateServer_backupRetentionCount' - Sets the number of automated backups that you want to keep.
--
-- 'serverName', 'updateServer_serverName' - The name of the server to update.
newUpdateServer ::
  -- | 'serverName'
  Prelude.Text ->
  UpdateServer
newUpdateServer :: Text -> UpdateServer
newUpdateServer Text
pServerName_ =
  UpdateServer' :: Maybe Bool
-> Maybe Text -> Maybe Text -> Maybe Int -> Text -> UpdateServer
UpdateServer'
    { $sel:disableAutomatedBackup:UpdateServer' :: Maybe Bool
disableAutomatedBackup =
        Maybe Bool
forall a. Maybe a
Prelude.Nothing,
      $sel:preferredMaintenanceWindow:UpdateServer' :: Maybe Text
preferredMaintenanceWindow = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:preferredBackupWindow:UpdateServer' :: Maybe Text
preferredBackupWindow = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:backupRetentionCount:UpdateServer' :: Maybe Int
backupRetentionCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:serverName:UpdateServer' :: Text
serverName = Text
pServerName_
    }

-- | Setting DisableAutomatedBackup to @true@ disables automated or scheduled
-- backups. Automated backups are enabled by default.
updateServer_disableAutomatedBackup :: Lens.Lens' UpdateServer (Prelude.Maybe Prelude.Bool)
updateServer_disableAutomatedBackup :: (Maybe Bool -> f (Maybe Bool)) -> UpdateServer -> f UpdateServer
updateServer_disableAutomatedBackup = (UpdateServer -> Maybe Bool)
-> (UpdateServer -> Maybe Bool -> UpdateServer)
-> Lens UpdateServer UpdateServer (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServer' {Maybe Bool
disableAutomatedBackup :: Maybe Bool
$sel:disableAutomatedBackup:UpdateServer' :: UpdateServer -> Maybe Bool
disableAutomatedBackup} -> Maybe Bool
disableAutomatedBackup) (\s :: UpdateServer
s@UpdateServer' {} Maybe Bool
a -> UpdateServer
s {$sel:disableAutomatedBackup:UpdateServer' :: Maybe Bool
disableAutomatedBackup = Maybe Bool
a} :: UpdateServer)

-- | Undocumented member.
updateServer_preferredMaintenanceWindow :: Lens.Lens' UpdateServer (Prelude.Maybe Prelude.Text)
updateServer_preferredMaintenanceWindow :: (Maybe Text -> f (Maybe Text)) -> UpdateServer -> f UpdateServer
updateServer_preferredMaintenanceWindow = (UpdateServer -> Maybe Text)
-> (UpdateServer -> Maybe Text -> UpdateServer)
-> Lens UpdateServer UpdateServer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServer' {Maybe Text
preferredMaintenanceWindow :: Maybe Text
$sel:preferredMaintenanceWindow:UpdateServer' :: UpdateServer -> Maybe Text
preferredMaintenanceWindow} -> Maybe Text
preferredMaintenanceWindow) (\s :: UpdateServer
s@UpdateServer' {} Maybe Text
a -> UpdateServer
s {$sel:preferredMaintenanceWindow:UpdateServer' :: Maybe Text
preferredMaintenanceWindow = Maybe Text
a} :: UpdateServer)

-- | Undocumented member.
updateServer_preferredBackupWindow :: Lens.Lens' UpdateServer (Prelude.Maybe Prelude.Text)
updateServer_preferredBackupWindow :: (Maybe Text -> f (Maybe Text)) -> UpdateServer -> f UpdateServer
updateServer_preferredBackupWindow = (UpdateServer -> Maybe Text)
-> (UpdateServer -> Maybe Text -> UpdateServer)
-> Lens UpdateServer UpdateServer (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServer' {Maybe Text
preferredBackupWindow :: Maybe Text
$sel:preferredBackupWindow:UpdateServer' :: UpdateServer -> Maybe Text
preferredBackupWindow} -> Maybe Text
preferredBackupWindow) (\s :: UpdateServer
s@UpdateServer' {} Maybe Text
a -> UpdateServer
s {$sel:preferredBackupWindow:UpdateServer' :: Maybe Text
preferredBackupWindow = Maybe Text
a} :: UpdateServer)

-- | Sets the number of automated backups that you want to keep.
updateServer_backupRetentionCount :: Lens.Lens' UpdateServer (Prelude.Maybe Prelude.Int)
updateServer_backupRetentionCount :: (Maybe Int -> f (Maybe Int)) -> UpdateServer -> f UpdateServer
updateServer_backupRetentionCount = (UpdateServer -> Maybe Int)
-> (UpdateServer -> Maybe Int -> UpdateServer)
-> Lens UpdateServer UpdateServer (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServer' {Maybe Int
backupRetentionCount :: Maybe Int
$sel:backupRetentionCount:UpdateServer' :: UpdateServer -> Maybe Int
backupRetentionCount} -> Maybe Int
backupRetentionCount) (\s :: UpdateServer
s@UpdateServer' {} Maybe Int
a -> UpdateServer
s {$sel:backupRetentionCount:UpdateServer' :: Maybe Int
backupRetentionCount = Maybe Int
a} :: UpdateServer)

-- | The name of the server to update.
updateServer_serverName :: Lens.Lens' UpdateServer Prelude.Text
updateServer_serverName :: (Text -> f Text) -> UpdateServer -> f UpdateServer
updateServer_serverName = (UpdateServer -> Text)
-> (UpdateServer -> Text -> UpdateServer)
-> Lens UpdateServer UpdateServer Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServer' {Text
serverName :: Text
$sel:serverName:UpdateServer' :: UpdateServer -> Text
serverName} -> Text
serverName) (\s :: UpdateServer
s@UpdateServer' {} Text
a -> UpdateServer
s {$sel:serverName:UpdateServer' :: Text
serverName = Text
a} :: UpdateServer)

instance Core.AWSRequest UpdateServer where
  type AWSResponse UpdateServer = UpdateServerResponse
  request :: UpdateServer -> Request UpdateServer
request = Service -> UpdateServer -> Request UpdateServer
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy UpdateServer
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateServer)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse UpdateServer))
-> Logger
-> Service
-> Proxy UpdateServer
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse UpdateServer)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Server -> Int -> UpdateServerResponse
UpdateServerResponse'
            (Maybe Server -> Int -> UpdateServerResponse)
-> Either String (Maybe Server)
-> Either String (Int -> UpdateServerResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Server)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"Server")
            Either String (Int -> UpdateServerResponse)
-> Either String Int -> Either String UpdateServerResponse
forall (f :: * -> *) a b. Applicative f => 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 UpdateServer

instance Prelude.NFData UpdateServer

instance Core.ToHeaders UpdateServer where
  toHeaders :: UpdateServer -> ResponseHeaders
toHeaders =
    ResponseHeaders -> UpdateServer -> 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
"OpsWorksCM_V2016_11_01.UpdateServer" ::
                          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 UpdateServer where
  toJSON :: UpdateServer -> Value
toJSON UpdateServer' {Maybe Bool
Maybe Int
Maybe Text
Text
serverName :: Text
backupRetentionCount :: Maybe Int
preferredBackupWindow :: Maybe Text
preferredMaintenanceWindow :: Maybe Text
disableAutomatedBackup :: Maybe Bool
$sel:serverName:UpdateServer' :: UpdateServer -> Text
$sel:backupRetentionCount:UpdateServer' :: UpdateServer -> Maybe Int
$sel:preferredBackupWindow:UpdateServer' :: UpdateServer -> Maybe Text
$sel:preferredMaintenanceWindow:UpdateServer' :: UpdateServer -> Maybe Text
$sel:disableAutomatedBackup:UpdateServer' :: UpdateServer -> Maybe Bool
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"DisableAutomatedBackup" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Bool -> Pair) -> Maybe Bool -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Bool
disableAutomatedBackup,
            (Text
"PreferredMaintenanceWindow" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
preferredMaintenanceWindow,
            (Text
"PreferredBackupWindow" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
preferredBackupWindow,
            (Text
"BackupRetentionCount" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Int -> Pair) -> Maybe Int -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
backupRetentionCount,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ServerName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
serverName)
          ]
      )

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

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

-- | /See:/ 'newUpdateServerResponse' smart constructor.
data UpdateServerResponse = UpdateServerResponse'
  { -- | Contains the response to a @UpdateServer@ request.
    UpdateServerResponse -> Maybe Server
server :: Prelude.Maybe Server,
    -- | The response's http status code.
    UpdateServerResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (UpdateServerResponse -> UpdateServerResponse -> Bool
(UpdateServerResponse -> UpdateServerResponse -> Bool)
-> (UpdateServerResponse -> UpdateServerResponse -> Bool)
-> Eq UpdateServerResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateServerResponse -> UpdateServerResponse -> Bool
$c/= :: UpdateServerResponse -> UpdateServerResponse -> Bool
== :: UpdateServerResponse -> UpdateServerResponse -> Bool
$c== :: UpdateServerResponse -> UpdateServerResponse -> Bool
Prelude.Eq, Int -> UpdateServerResponse -> ShowS
[UpdateServerResponse] -> ShowS
UpdateServerResponse -> String
(Int -> UpdateServerResponse -> ShowS)
-> (UpdateServerResponse -> String)
-> ([UpdateServerResponse] -> ShowS)
-> Show UpdateServerResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateServerResponse] -> ShowS
$cshowList :: [UpdateServerResponse] -> ShowS
show :: UpdateServerResponse -> String
$cshow :: UpdateServerResponse -> String
showsPrec :: Int -> UpdateServerResponse -> ShowS
$cshowsPrec :: Int -> UpdateServerResponse -> ShowS
Prelude.Show, (forall x. UpdateServerResponse -> Rep UpdateServerResponse x)
-> (forall x. Rep UpdateServerResponse x -> UpdateServerResponse)
-> Generic UpdateServerResponse
forall x. Rep UpdateServerResponse x -> UpdateServerResponse
forall x. UpdateServerResponse -> Rep UpdateServerResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UpdateServerResponse x -> UpdateServerResponse
$cfrom :: forall x. UpdateServerResponse -> Rep UpdateServerResponse x
Prelude.Generic)

-- |
-- Create a value of 'UpdateServerResponse' 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:
--
-- 'server', 'updateServerResponse_server' - Contains the response to a @UpdateServer@ request.
--
-- 'httpStatus', 'updateServerResponse_httpStatus' - The response's http status code.
newUpdateServerResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  UpdateServerResponse
newUpdateServerResponse :: Int -> UpdateServerResponse
newUpdateServerResponse Int
pHttpStatus_ =
  UpdateServerResponse' :: Maybe Server -> Int -> UpdateServerResponse
UpdateServerResponse'
    { $sel:server:UpdateServerResponse' :: Maybe Server
server = Maybe Server
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:UpdateServerResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

-- | Contains the response to a @UpdateServer@ request.
updateServerResponse_server :: Lens.Lens' UpdateServerResponse (Prelude.Maybe Server)
updateServerResponse_server :: (Maybe Server -> f (Maybe Server))
-> UpdateServerResponse -> f UpdateServerResponse
updateServerResponse_server = (UpdateServerResponse -> Maybe Server)
-> (UpdateServerResponse -> Maybe Server -> UpdateServerResponse)
-> Lens
     UpdateServerResponse
     UpdateServerResponse
     (Maybe Server)
     (Maybe Server)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\UpdateServerResponse' {Maybe Server
server :: Maybe Server
$sel:server:UpdateServerResponse' :: UpdateServerResponse -> Maybe Server
server} -> Maybe Server
server) (\s :: UpdateServerResponse
s@UpdateServerResponse' {} Maybe Server
a -> UpdateServerResponse
s {$sel:server:UpdateServerResponse' :: Maybe Server
server = Maybe Server
a} :: UpdateServerResponse)

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

instance Prelude.NFData UpdateServerResponse