{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# OPTIONS_GHC -fno-warn-unused-imports #-}
module Network.Google.Resource.AppState.States.Update
(
StatesUpdateResource
, statesUpdate
, StatesUpdate
, suCurrentStateVersion
, suStateKey
, suPayload
) where
import Network.Google.AppState.Types
import Network.Google.Prelude
type StatesUpdateResource =
"appstate" :>
"v1" :>
"states" :>
Capture "stateKey" (Textual Int32) :>
QueryParam "currentStateVersion" Text :>
QueryParam "alt" AltJSON :>
ReqBody '[JSON] UpdateRequest :>
Put '[JSON] WriteResult
data StatesUpdate = StatesUpdate'
{ _suCurrentStateVersion :: !(Maybe Text)
, _suStateKey :: !(Textual Int32)
, _suPayload :: !UpdateRequest
} deriving (Eq,Show,Data,Typeable,Generic)
statesUpdate
:: Int32
-> UpdateRequest
-> StatesUpdate
statesUpdate pSuStateKey_ pSuPayload_ =
StatesUpdate'
{ _suCurrentStateVersion = Nothing
, _suStateKey = _Coerce # pSuStateKey_
, _suPayload = pSuPayload_
}
suCurrentStateVersion :: Lens' StatesUpdate (Maybe Text)
suCurrentStateVersion
= lens _suCurrentStateVersion
(\ s a -> s{_suCurrentStateVersion = a})
suStateKey :: Lens' StatesUpdate Int32
suStateKey
= lens _suStateKey (\ s a -> s{_suStateKey = a}) .
_Coerce
suPayload :: Lens' StatesUpdate UpdateRequest
suPayload
= lens _suPayload (\ s a -> s{_suPayload = a})
instance GoogleRequest StatesUpdate where
type Rs StatesUpdate = WriteResult
type Scopes StatesUpdate =
'["https://www.googleapis.com/auth/appstate"]
requestClient StatesUpdate'{..}
= go _suStateKey _suCurrentStateVersion
(Just AltJSON)
_suPayload
appStateService
where go
= buildClient (Proxy :: Proxy StatesUpdateResource)
mempty