gogol-appstate 0.5.0 → 1.0.0
raw patch · 21 files changed
+888/−994 lines, 21 filesdep −basedep ~gogol-coresetup-changed
Dependencies removed: base
Dependency ranges changed: gogol-core
Files
- README.md +1/−1
- Setup.hs +2/−1
- gen/Gogol/AppState.hs +89/−0
- gen/Gogol/AppState/Internal/Product.hs +220/−0
- gen/Gogol/AppState/Internal/Sum.hs +31/−0
- gen/Gogol/AppState/States/Clear.hs +90/−0
- gen/Gogol/AppState/States/Delete.hs +79/−0
- gen/Gogol/AppState/States/Get.hs +79/−0
- gen/Gogol/AppState/States/List.hs +80/−0
- gen/Gogol/AppState/States/Update.hs +96/−0
- gen/Gogol/AppState/Types.hs +66/−0
- gen/Network/Google/AppState.hs +0/−95
- gen/Network/Google/AppState/Types.hs +0/−66
- gen/Network/Google/AppState/Types/Product.hs +0/−274
- gen/Network/Google/AppState/Types/Sum.hs +0/−19
- gen/Network/Google/Resource/AppState/States/Clear.hs +0/−106
- gen/Network/Google/Resource/AppState/States/Delete.hs +0/−94
- gen/Network/Google/Resource/AppState/States/Get.hs +0/−88
- gen/Network/Google/Resource/AppState/States/List.hs +0/−86
- gen/Network/Google/Resource/AppState/States/Update.hs +0/−124
- gogol-appstate.cabal +55/−40
README.md view
@@ -8,7 +8,7 @@ ## Version -`0.5.0`+`1.0.0` ## Description
Setup.hs view
@@ -1,2 +1,3 @@-import Distribution.Simple+import Distribution.Simple+ main = defaultMain
+ gen/Gogol/AppState.hs view
@@ -0,0 +1,89 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DerivingStrategies #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE ImportQualifiedPost #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-name-shadowing #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- |+-- Module : Gogol.AppState+-- Copyright : (c) 2015-2025 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay+gogol@gmail.com>+-- Toni Cebrián <toni@tonicebrian.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- The Google App State API.+--+-- /See:/ <https://developers.google.com/games/services/web/api/states Google App State API Reference>+module Gogol.AppState+ ( -- * Configuration+ appStateService,++ -- * OAuth Scopes+ Appstate'FullControl,++ -- * Resources++ -- ** appstate.states.clear+ AppStateStatesClearResource,+ AppStateStatesClear (..),+ newAppStateStatesClear,++ -- ** appstate.states.delete+ AppStateStatesDeleteResource,+ AppStateStatesDelete (..),+ newAppStateStatesDelete,++ -- ** appstate.states.get+ AppStateStatesGetResource,+ AppStateStatesGet (..),+ newAppStateStatesGet,++ -- ** appstate.states.list+ AppStateStatesListResource,+ AppStateStatesList (..),+ newAppStateStatesList,++ -- ** appstate.states.update+ AppStateStatesUpdateResource,+ AppStateStatesUpdate (..),+ newAppStateStatesUpdate,++ -- * Types++ -- ** GetResponse+ GetResponse (..),+ newGetResponse,++ -- ** ListResponse+ ListResponse (..),+ newListResponse,++ -- ** UpdateRequest+ UpdateRequest (..),+ newUpdateRequest,++ -- ** WriteResult+ WriteResult (..),+ newWriteResult,+ )+where++import Gogol.AppState.States.Clear+import Gogol.AppState.States.Delete+import Gogol.AppState.States.Get+import Gogol.AppState.States.List+import Gogol.AppState.States.Update+import Gogol.AppState.Types
+ gen/Gogol/AppState/Internal/Product.hs view
@@ -0,0 +1,220 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DerivingStrategies #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE ImportQualifiedPost #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-name-shadowing #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- |+-- Module : Gogol.AppState.Internal.Product+-- Copyright : (c) 2015-2025 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay+gogol@gmail.com>+-- Toni Cebrián <toni@tonicebrian.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Gogol.AppState.Internal.Product+ ( -- * GetResponse+ GetResponse (..),+ newGetResponse,++ -- * ListResponse+ ListResponse (..),+ newListResponse,++ -- * UpdateRequest+ UpdateRequest (..),+ newUpdateRequest,++ -- * WriteResult+ WriteResult (..),+ newWriteResult,+ )+where++import Gogol.AppState.Internal.Sum+import Gogol.Prelude qualified as Core++-- | This is a JSON template for an app state resource.+--+-- /See:/ 'newGetResponse' smart constructor.+data GetResponse = GetResponse+ { -- | The current app state version.+ currentStateVersion :: (Core.Maybe Core.Text),+ -- | The requested data.+ data' :: (Core.Maybe Core.Text),+ -- | Uniquely identifies the type of this resource. Value is always the fixed string appstate#getResponse.+ kind :: Core.Text,+ -- | The key for the data.+ stateKey :: (Core.Maybe Core.Int32)+ }+ deriving (Core.Eq, Core.Show, Core.Generic)++-- | Creates a value of 'GetResponse' with the minimum fields required to make a request.+newGetResponse ::+ GetResponse+newGetResponse =+ GetResponse+ { currentStateVersion = Core.Nothing,+ data' = Core.Nothing,+ kind = "appstate#getResponse",+ stateKey = Core.Nothing+ }++instance Core.FromJSON GetResponse where+ parseJSON =+ Core.withObject+ "GetResponse"+ ( \o ->+ GetResponse+ Core.<$> (o Core..:? "currentStateVersion")+ Core.<*> (o Core..:? "data")+ Core.<*> (o Core..:? "kind" Core..!= "appstate#getResponse")+ Core.<*> (o Core..:? "stateKey")+ )++instance Core.ToJSON GetResponse where+ toJSON GetResponse {..} =+ Core.object+ ( Core.catMaybes+ [ ("currentStateVersion" Core..=) Core.<$> currentStateVersion,+ ("data" Core..=) Core.<$> data',+ Core.Just ("kind" Core..= kind),+ ("stateKey" Core..=) Core.<$> stateKey+ ]+ )++-- | This is a JSON template to convert a list-response for app state.+--+-- /See:/ 'newListResponse' smart constructor.+data ListResponse = ListResponse+ { -- | The app state data.+ items :: (Core.Maybe [GetResponse]),+ -- | Uniquely identifies the type of this resource. Value is always the fixed string appstate#listResponse.+ kind :: Core.Text,+ -- | The maximum number of keys allowed for this user.+ maximumKeyCount :: (Core.Maybe Core.Int32)+ }+ deriving (Core.Eq, Core.Show, Core.Generic)++-- | Creates a value of 'ListResponse' with the minimum fields required to make a request.+newListResponse ::+ ListResponse+newListResponse =+ ListResponse+ { items = Core.Nothing,+ kind = "appstate#listResponse",+ maximumKeyCount = Core.Nothing+ }++instance Core.FromJSON ListResponse where+ parseJSON =+ Core.withObject+ "ListResponse"+ ( \o ->+ ListResponse+ Core.<$> (o Core..:? "items")+ Core.<*> (o Core..:? "kind" Core..!= "appstate#listResponse")+ Core.<*> (o Core..:? "maximumKeyCount")+ )++instance Core.ToJSON ListResponse where+ toJSON ListResponse {..} =+ Core.object+ ( Core.catMaybes+ [ ("items" Core..=) Core.<$> items,+ Core.Just ("kind" Core..= kind),+ ("maximumKeyCount" Core..=) Core.<$> maximumKeyCount+ ]+ )++-- | This is a JSON template for a requests which update app state+--+-- /See:/ 'newUpdateRequest' smart constructor.+data UpdateRequest = UpdateRequest+ { -- | The new app state data that your application is trying to update with.+ data' :: (Core.Maybe Core.Text),+ -- | Uniquely identifies the type of this resource. Value is always the fixed string appstate#updateRequest.+ kind :: Core.Text+ }+ deriving (Core.Eq, Core.Show, Core.Generic)++-- | Creates a value of 'UpdateRequest' with the minimum fields required to make a request.+newUpdateRequest ::+ UpdateRequest+newUpdateRequest =+ UpdateRequest+ { data' = Core.Nothing,+ kind = "appstate#updateRequest"+ }++instance Core.FromJSON UpdateRequest where+ parseJSON =+ Core.withObject+ "UpdateRequest"+ ( \o ->+ UpdateRequest+ Core.<$> (o Core..:? "data")+ Core.<*> (o Core..:? "kind" Core..!= "appstate#updateRequest")+ )++instance Core.ToJSON UpdateRequest where+ toJSON UpdateRequest {..} =+ Core.object+ ( Core.catMaybes+ [("data" Core..=) Core.<$> data', Core.Just ("kind" Core..= kind)]+ )++-- | This is a JSON template for an app state write result.+--+-- /See:/ 'newWriteResult' smart constructor.+data WriteResult = WriteResult+ { -- | The version of the data for this key on the server.+ currentStateVersion :: (Core.Maybe Core.Text),+ -- | Uniquely identifies the type of this resource. Value is always the fixed string appstate#writeResult.+ kind :: Core.Text,+ -- | The written key.+ stateKey :: (Core.Maybe Core.Int32)+ }+ deriving (Core.Eq, Core.Show, Core.Generic)++-- | Creates a value of 'WriteResult' with the minimum fields required to make a request.+newWriteResult ::+ WriteResult+newWriteResult =+ WriteResult+ { currentStateVersion = Core.Nothing,+ kind = "appstate#writeResult",+ stateKey = Core.Nothing+ }++instance Core.FromJSON WriteResult where+ parseJSON =+ Core.withObject+ "WriteResult"+ ( \o ->+ WriteResult+ Core.<$> (o Core..:? "currentStateVersion")+ Core.<*> (o Core..:? "kind" Core..!= "appstate#writeResult")+ Core.<*> (o Core..:? "stateKey")+ )++instance Core.ToJSON WriteResult where+ toJSON WriteResult {..} =+ Core.object+ ( Core.catMaybes+ [ ("currentStateVersion" Core..=) Core.<$> currentStateVersion,+ Core.Just ("kind" Core..= kind),+ ("stateKey" Core..=) Core.<$> stateKey+ ]+ )
+ gen/Gogol/AppState/Internal/Sum.hs view
@@ -0,0 +1,31 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DerivingStrategies #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE ImportQualifiedPost #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-name-shadowing #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- |+-- Module : Gogol.AppState.Internal.Sum+-- Copyright : (c) 2015-2025 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay+gogol@gmail.com>+-- Toni Cebrián <toni@tonicebrian.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Gogol.AppState.Internal.Sum+ (+ )+where++import Gogol.Prelude qualified as Core
+ gen/Gogol/AppState/States/Clear.hs view
@@ -0,0 +1,90 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DerivingStrategies #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE ImportQualifiedPost #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-name-shadowing #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- |+-- Module : Gogol.AppState.States.Clear+-- Copyright : (c) 2015-2025 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay+gogol@gmail.com>+-- Toni Cebrián <toni@tonicebrian.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Clears (sets to empty) the data for the passed key if and only if the passed version matches the currently stored version. This method results in a conflict error on version mismatch.+--+-- /See:/ <https://developers.google.com/games/services/web/api/states Google App State API Reference> for @appstate.states.clear@.+module Gogol.AppState.States.Clear+ ( -- * Resource+ AppStateStatesClearResource,++ -- ** Constructing a Request+ AppStateStatesClear (..),+ newAppStateStatesClear,+ )+where++import Gogol.AppState.Types+import Gogol.Prelude qualified as Core++-- | A resource alias for @appstate.states.clear@ method which the+-- 'AppStateStatesClear' request conforms to.+type AppStateStatesClearResource =+ "appstate"+ Core.:> "v1"+ Core.:> "states"+ Core.:> Core.Capture "stateKey" Core.Int32+ Core.:> "clear"+ Core.:> Core.QueryParam "currentDataVersion" Core.Text+ Core.:> Core.QueryParam "alt" Core.AltJSON+ Core.:> Core.Post '[Core.JSON] WriteResult++-- | Clears (sets to empty) the data for the passed key if and only if the passed version matches the currently stored version. This method results in a conflict error on version mismatch.+--+-- /See:/ 'newAppStateStatesClear' smart constructor.+data AppStateStatesClear = AppStateStatesClear+ { -- | The version of the data to be cleared. Version strings are returned by the server.+ currentDataVersion :: (Core.Maybe Core.Text),+ -- | The key for the data to be retrieved.+ stateKey :: Core.Int32+ }+ deriving (Core.Eq, Core.Show, Core.Generic)++-- | Creates a value of 'AppStateStatesClear' with the minimum fields required to make a request.+newAppStateStatesClear ::+ -- | The key for the data to be retrieved. See 'stateKey'.+ Core.Int32 ->+ AppStateStatesClear+newAppStateStatesClear stateKey =+ AppStateStatesClear+ { currentDataVersion = Core.Nothing,+ stateKey = stateKey+ }++instance Core.GoogleRequest AppStateStatesClear where+ type Rs AppStateStatesClear = WriteResult+ type Scopes AppStateStatesClear = '[Appstate'FullControl]+ requestClient AppStateStatesClear {..} =+ go+ stateKey+ currentDataVersion+ (Core.Just Core.AltJSON)+ appStateService+ where+ go =+ Core.buildClient+ (Core.Proxy :: Core.Proxy AppStateStatesClearResource)+ Core.mempty
+ gen/Gogol/AppState/States/Delete.hs view
@@ -0,0 +1,79 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DerivingStrategies #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE ImportQualifiedPost #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-name-shadowing #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- |+-- Module : Gogol.AppState.States.Delete+-- Copyright : (c) 2015-2025 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay+gogol@gmail.com>+-- Toni Cebrián <toni@tonicebrian.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Deletes a key and the data associated with it. The key is removed and no longer counts against the key quota. Note that since this method is not safe in the face of concurrent modifications, it should only be used for development and testing purposes. Invoking this method in shipping code can result in data loss and data corruption.+--+-- /See:/ <https://developers.google.com/games/services/web/api/states Google App State API Reference> for @appstate.states.delete@.+module Gogol.AppState.States.Delete+ ( -- * Resource+ AppStateStatesDeleteResource,++ -- ** Constructing a Request+ AppStateStatesDelete (..),+ newAppStateStatesDelete,+ )+where++import Gogol.AppState.Types+import Gogol.Prelude qualified as Core++-- | A resource alias for @appstate.states.delete@ method which the+-- 'AppStateStatesDelete' request conforms to.+type AppStateStatesDeleteResource =+ "appstate"+ Core.:> "v1"+ Core.:> "states"+ Core.:> Core.Capture "stateKey" Core.Int32+ Core.:> Core.QueryParam "alt" Core.AltJSON+ Core.:> Core.Delete '[Core.JSON] ()++-- | Deletes a key and the data associated with it. The key is removed and no longer counts against the key quota. Note that since this method is not safe in the face of concurrent modifications, it should only be used for development and testing purposes. Invoking this method in shipping code can result in data loss and data corruption.+--+-- /See:/ 'newAppStateStatesDelete' smart constructor.+newtype AppStateStatesDelete = AppStateStatesDelete+ { -- | The key for the data to be retrieved.+ stateKey :: Core.Int32+ }+ deriving (Core.Eq, Core.Show, Core.Generic)++-- | Creates a value of 'AppStateStatesDelete' with the minimum fields required to make a request.+newAppStateStatesDelete ::+ -- | The key for the data to be retrieved. See 'stateKey'.+ Core.Int32 ->+ AppStateStatesDelete+newAppStateStatesDelete stateKey =+ AppStateStatesDelete {stateKey = stateKey}++instance Core.GoogleRequest AppStateStatesDelete where+ type Rs AppStateStatesDelete = ()+ type Scopes AppStateStatesDelete = '[Appstate'FullControl]+ requestClient AppStateStatesDelete {..} =+ go stateKey (Core.Just Core.AltJSON) appStateService+ where+ go =+ Core.buildClient+ (Core.Proxy :: Core.Proxy AppStateStatesDeleteResource)+ Core.mempty
+ gen/Gogol/AppState/States/Get.hs view
@@ -0,0 +1,79 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DerivingStrategies #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE ImportQualifiedPost #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-name-shadowing #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- |+-- Module : Gogol.AppState.States.Get+-- Copyright : (c) 2015-2025 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay+gogol@gmail.com>+-- Toni Cebrián <toni@tonicebrian.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Retrieves the data corresponding to the passed key. If the key does not exist on the server, an HTTP 404 will be returned.+--+-- /See:/ <https://developers.google.com/games/services/web/api/states Google App State API Reference> for @appstate.states.get@.+module Gogol.AppState.States.Get+ ( -- * Resource+ AppStateStatesGetResource,++ -- ** Constructing a Request+ AppStateStatesGet (..),+ newAppStateStatesGet,+ )+where++import Gogol.AppState.Types+import Gogol.Prelude qualified as Core++-- | A resource alias for @appstate.states.get@ method which the+-- 'AppStateStatesGet' request conforms to.+type AppStateStatesGetResource =+ "appstate"+ Core.:> "v1"+ Core.:> "states"+ Core.:> Core.Capture "stateKey" Core.Int32+ Core.:> Core.QueryParam "alt" Core.AltJSON+ Core.:> Core.Get '[Core.JSON] GetResponse++-- | Retrieves the data corresponding to the passed key. If the key does not exist on the server, an HTTP 404 will be returned.+--+-- /See:/ 'newAppStateStatesGet' smart constructor.+newtype AppStateStatesGet = AppStateStatesGet+ { -- | The key for the data to be retrieved.+ stateKey :: Core.Int32+ }+ deriving (Core.Eq, Core.Show, Core.Generic)++-- | Creates a value of 'AppStateStatesGet' with the minimum fields required to make a request.+newAppStateStatesGet ::+ -- | The key for the data to be retrieved. See 'stateKey'.+ Core.Int32 ->+ AppStateStatesGet+newAppStateStatesGet stateKey =+ AppStateStatesGet {stateKey = stateKey}++instance Core.GoogleRequest AppStateStatesGet where+ type Rs AppStateStatesGet = GetResponse+ type Scopes AppStateStatesGet = '[Appstate'FullControl]+ requestClient AppStateStatesGet {..} =+ go stateKey (Core.Just Core.AltJSON) appStateService+ where+ go =+ Core.buildClient+ (Core.Proxy :: Core.Proxy AppStateStatesGetResource)+ Core.mempty
+ gen/Gogol/AppState/States/List.hs view
@@ -0,0 +1,80 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DerivingStrategies #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE ImportQualifiedPost #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-name-shadowing #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- |+-- Module : Gogol.AppState.States.List+-- Copyright : (c) 2015-2025 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay+gogol@gmail.com>+-- Toni Cebrián <toni@tonicebrian.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Lists all the states keys, and optionally the state data.+--+-- /See:/ <https://developers.google.com/games/services/web/api/states Google App State API Reference> for @appstate.states.list@.+module Gogol.AppState.States.List+ ( -- * Resource+ AppStateStatesListResource,++ -- ** Constructing a Request+ AppStateStatesList (..),+ newAppStateStatesList,+ )+where++import Gogol.AppState.Types+import Gogol.Prelude qualified as Core++-- | A resource alias for @appstate.states.list@ method which the+-- 'AppStateStatesList' request conforms to.+type AppStateStatesListResource =+ "appstate"+ Core.:> "v1"+ Core.:> "states"+ Core.:> Core.QueryParam "includeData" Core.Bool+ Core.:> Core.QueryParam "alt" Core.AltJSON+ Core.:> Core.Get '[Core.JSON] ListResponse++-- | Lists all the states keys, and optionally the state data.+--+-- /See:/ 'newAppStateStatesList' smart constructor.+newtype AppStateStatesList = AppStateStatesList+ { -- | Whether to include the full data in addition to the version number+ includeData :: Core.Bool+ }+ deriving (Core.Eq, Core.Show, Core.Generic)++-- | Creates a value of 'AppStateStatesList' with the minimum fields required to make a request.+newAppStateStatesList ::+ AppStateStatesList+newAppStateStatesList =+ AppStateStatesList {includeData = Core.False}++instance Core.GoogleRequest AppStateStatesList where+ type Rs AppStateStatesList = ListResponse+ type Scopes AppStateStatesList = '[Appstate'FullControl]+ requestClient AppStateStatesList {..} =+ go+ (Core.Just includeData)+ (Core.Just Core.AltJSON)+ appStateService+ where+ go =+ Core.buildClient+ (Core.Proxy :: Core.Proxy AppStateStatesListResource)+ Core.mempty
+ gen/Gogol/AppState/States/Update.hs view
@@ -0,0 +1,96 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DerivingStrategies #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE ImportQualifiedPost #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-name-shadowing #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- |+-- Module : Gogol.AppState.States.Update+-- Copyright : (c) 2015-2025 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay+gogol@gmail.com>+-- Toni Cebrián <toni@tonicebrian.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+--+-- Update the data associated with the input key if and only if the passed version matches the currently stored version. This method is safe in the face of concurrent writes. Maximum per-key size is 128KB.+--+-- /See:/ <https://developers.google.com/games/services/web/api/states Google App State API Reference> for @appstate.states.update@.+module Gogol.AppState.States.Update+ ( -- * Resource+ AppStateStatesUpdateResource,++ -- ** Constructing a Request+ AppStateStatesUpdate (..),+ newAppStateStatesUpdate,+ )+where++import Gogol.AppState.Types+import Gogol.Prelude qualified as Core++-- | A resource alias for @appstate.states.update@ method which the+-- 'AppStateStatesUpdate' request conforms to.+type AppStateStatesUpdateResource =+ "appstate"+ Core.:> "v1"+ Core.:> "states"+ Core.:> Core.Capture "stateKey" Core.Int32+ Core.:> Core.QueryParam "currentStateVersion" Core.Text+ Core.:> Core.QueryParam "alt" Core.AltJSON+ Core.:> Core.ReqBody '[Core.JSON] UpdateRequest+ Core.:> Core.Put '[Core.JSON] WriteResult++-- | Update the data associated with the input key if and only if the passed version matches the currently stored version. This method is safe in the face of concurrent writes. Maximum per-key size is 128KB.+--+-- /See:/ 'newAppStateStatesUpdate' smart constructor.+data AppStateStatesUpdate = AppStateStatesUpdate+ { -- | The version of the app state your application is attempting to update. If this does not match the current version, this method will return a conflict error. If there is no data stored on the server for this key, the update will succeed irrespective of the value of this parameter.+ currentStateVersion :: (Core.Maybe Core.Text),+ -- | Multipart request metadata.+ payload :: UpdateRequest,+ -- | The key for the data to be retrieved.+ stateKey :: Core.Int32+ }+ deriving (Core.Eq, Core.Show, Core.Generic)++-- | Creates a value of 'AppStateStatesUpdate' with the minimum fields required to make a request.+newAppStateStatesUpdate ::+ -- | Multipart request metadata. See 'payload'.+ UpdateRequest ->+ -- | The key for the data to be retrieved. See 'stateKey'.+ Core.Int32 ->+ AppStateStatesUpdate+newAppStateStatesUpdate payload stateKey =+ AppStateStatesUpdate+ { currentStateVersion = Core.Nothing,+ payload = payload,+ stateKey = stateKey+ }++instance Core.GoogleRequest AppStateStatesUpdate where+ type Rs AppStateStatesUpdate = WriteResult+ type Scopes AppStateStatesUpdate = '[Appstate'FullControl]+ requestClient AppStateStatesUpdate {..} =+ go+ stateKey+ currentStateVersion+ (Core.Just Core.AltJSON)+ payload+ appStateService+ where+ go =+ Core.buildClient+ (Core.Proxy :: Core.Proxy AppStateStatesUpdateResource)+ Core.mempty
+ gen/Gogol/AppState/Types.hs view
@@ -0,0 +1,66 @@+{-# LANGUAGE DataKinds #-}+{-# LANGUAGE DerivingStrategies #-}+{-# LANGUAGE DuplicateRecordFields #-}+{-# LANGUAGE ImportQualifiedPost #-}+{-# LANGUAGE LambdaCase #-}+{-# LANGUAGE OverloadedStrings #-}+{-# LANGUAGE PatternSynonyms #-}+{-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE StrictData #-}+{-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}+{-# OPTIONS_GHC -fno-warn-name-shadowing #-}+{-# OPTIONS_GHC -fno-warn-unused-binds #-}+{-# OPTIONS_GHC -fno-warn-unused-imports #-}+{-# OPTIONS_GHC -fno-warn-unused-matches #-}++-- |+-- Module : Gogol.AppState.Types+-- Copyright : (c) 2015-2025 Brendan Hay+-- License : Mozilla Public License, v. 2.0.+-- Maintainer : Brendan Hay <brendan.g.hay+gogol@gmail.com>+-- Toni Cebrián <toni@tonicebrian.com>+-- Stability : auto-generated+-- Portability : non-portable (GHC extensions)+module Gogol.AppState.Types+ ( -- * Configuration+ appStateService,++ -- * OAuth Scopes+ Appstate'FullControl,++ -- * Types++ -- ** GetResponse+ GetResponse (..),+ newGetResponse,++ -- ** ListResponse+ ListResponse (..),+ newListResponse,++ -- ** UpdateRequest+ UpdateRequest (..),+ newUpdateRequest,++ -- ** WriteResult+ WriteResult (..),+ newWriteResult,+ )+where++import Gogol.AppState.Internal.Product+import Gogol.AppState.Internal.Sum+import Gogol.Prelude qualified as Core++-- | Default request referring to version @v1@ of the Google App State API. This contains the host and root path used as a starting point for constructing service requests.+appStateService :: Core.ServiceConfig+appStateService =+ Core.defaultService+ (Core.ServiceId "appstate:v1")+ "www.googleapis.com"++-- | View and manage your data for this application+type Appstate'FullControl =+ "https://www.googleapis.com/auth/appstate"
− gen/Network/Google/AppState.hs
@@ -1,95 +0,0 @@-{-# LANGUAGE DataKinds #-}-{-# LANGUAGE NoImplicitPrelude #-}-{-# LANGUAGE TypeOperators #-}--{-# OPTIONS_GHC -fno-warn-unused-imports #-}-{-# OPTIONS_GHC -fno-warn-duplicate-exports #-}---- |--- Module : Network.Google.AppState--- Copyright : (c) 2015-2016 Brendan Hay--- License : Mozilla Public License, v. 2.0.--- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>--- Stability : auto-generated--- Portability : non-portable (GHC extensions)------ The Google App State API.------ /See:/ <https://developers.google.com/games/services/web/api/states Google App State API Reference>-module Network.Google.AppState- (- -- * Service Configuration- appStateService-- -- * OAuth Scopes- , appStateScope-- -- * API Declaration- , AppStateAPI-- -- * Resources-- -- ** appstate.states.clear- , module Network.Google.Resource.AppState.States.Clear-- -- ** appstate.states.delete- , module Network.Google.Resource.AppState.States.Delete-- -- ** appstate.states.get- , module Network.Google.Resource.AppState.States.Get-- -- ** appstate.states.list- , module Network.Google.Resource.AppState.States.List-- -- ** appstate.states.update- , module Network.Google.Resource.AppState.States.Update-- -- * Types-- -- ** WriteResult- , WriteResult- , writeResult- , wrCurrentStateVersion- , wrKind- , wrStateKey-- -- ** ListResponse- , ListResponse- , listResponse- , lrMaximumKeyCount- , lrKind- , lrItems-- -- ** GetResponse- , GetResponse- , getResponse- , grCurrentStateVersion- , grKind- , grData- , grStateKey-- -- ** UpdateRequest- , UpdateRequest- , updateRequest- , urKind- , urData- ) where--import Network.Google.AppState.Types-import Network.Google.Prelude-import Network.Google.Resource.AppState.States.Clear-import Network.Google.Resource.AppState.States.Delete-import Network.Google.Resource.AppState.States.Get-import Network.Google.Resource.AppState.States.List-import Network.Google.Resource.AppState.States.Update--{- $resources-TODO--}---- | Represents the entirety of the methods and resources available for the Google App State API service.-type AppStateAPI =- StatesListResource :<|> StatesGetResource :<|>- StatesClearResource- :<|> StatesDeleteResource- :<|> StatesUpdateResource
− gen/Network/Google/AppState/Types.hs
@@ -1,66 +0,0 @@-{-# LANGUAGE DataKinds #-}-{-# LANGUAGE DeriveDataTypeable #-}-{-# LANGUAGE DeriveGeneric #-}-{-# LANGUAGE NoImplicitPrelude #-}-{-# LANGUAGE OverloadedStrings #-}--{-# OPTIONS_GHC -fno-warn-unused-imports #-}---- |--- Module : Network.Google.AppState.Types--- Copyright : (c) 2015-2016 Brendan Hay--- License : Mozilla Public License, v. 2.0.--- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>--- Stability : auto-generated--- Portability : non-portable (GHC extensions)----module Network.Google.AppState.Types- (- -- * Service Configuration- appStateService-- -- * OAuth Scopes- , appStateScope-- -- * WriteResult- , WriteResult- , writeResult- , wrCurrentStateVersion- , wrKind- , wrStateKey-- -- * ListResponse- , ListResponse- , listResponse- , lrMaximumKeyCount- , lrKind- , lrItems-- -- * GetResponse- , GetResponse- , getResponse- , grCurrentStateVersion- , grKind- , grData- , grStateKey-- -- * UpdateRequest- , UpdateRequest- , updateRequest- , urKind- , urData- ) where--import Network.Google.AppState.Types.Product-import Network.Google.AppState.Types.Sum-import Network.Google.Prelude---- | Default request referring to version 'v1' of the Google App State API. This contains the host and root path used as a starting point for constructing service requests.-appStateService :: ServiceConfig-appStateService- = defaultService (ServiceId "appstate:v1")- "www.googleapis.com"---- | View and manage your data for this application-appStateScope :: Proxy '["https://www.googleapis.com/auth/appstate"]-appStateScope = Proxy
− gen/Network/Google/AppState/Types/Product.hs
@@ -1,274 +0,0 @@-{-# LANGUAGE DeriveDataTypeable #-}-{-# LANGUAGE DeriveGeneric #-}-{-# LANGUAGE NoImplicitPrelude #-}-{-# LANGUAGE OverloadedStrings #-}-{-# LANGUAGE RecordWildCards #-}--{-# OPTIONS_GHC -fno-warn-unused-binds #-}-{-# OPTIONS_GHC -fno-warn-unused-imports #-}---- |--- Module : Network.Google.AppState.Types.Product--- Copyright : (c) 2015-2016 Brendan Hay--- License : Mozilla Public License, v. 2.0.--- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>--- Stability : auto-generated--- Portability : non-portable (GHC extensions)----module Network.Google.AppState.Types.Product where--import Network.Google.AppState.Types.Sum-import Network.Google.Prelude---- | This is a JSON template for an app state write result.------ /See:/ 'writeResult' smart constructor.-data WriteResult =- WriteResult'- { _wrCurrentStateVersion :: !(Maybe Text)- , _wrKind :: !Text- , _wrStateKey :: !(Maybe (Textual Int32))- }- deriving (Eq, Show, Data, Typeable, Generic)----- | Creates a value of 'WriteResult' with the minimum fields required to make a request.------ Use one of the following lenses to modify other fields as desired:------ * 'wrCurrentStateVersion'------ * 'wrKind'------ * 'wrStateKey'-writeResult- :: WriteResult-writeResult =- WriteResult'- { _wrCurrentStateVersion = Nothing- , _wrKind = "appstate#writeResult"- , _wrStateKey = Nothing- }----- | The version of the data for this key on the server.-wrCurrentStateVersion :: Lens' WriteResult (Maybe Text)-wrCurrentStateVersion- = lens _wrCurrentStateVersion- (\ s a -> s{_wrCurrentStateVersion = a})---- | Uniquely identifies the type of this resource. Value is always the fixed--- string appstate#writeResult.-wrKind :: Lens' WriteResult Text-wrKind = lens _wrKind (\ s a -> s{_wrKind = a})---- | The written key.-wrStateKey :: Lens' WriteResult (Maybe Int32)-wrStateKey- = lens _wrStateKey (\ s a -> s{_wrStateKey = a}) .- mapping _Coerce--instance FromJSON WriteResult where- parseJSON- = withObject "WriteResult"- (\ o ->- WriteResult' <$>- (o .:? "currentStateVersion") <*>- (o .:? "kind" .!= "appstate#writeResult")- <*> (o .:? "stateKey"))--instance ToJSON WriteResult where- toJSON WriteResult'{..}- = object- (catMaybes- [("currentStateVersion" .=) <$>- _wrCurrentStateVersion,- Just ("kind" .= _wrKind),- ("stateKey" .=) <$> _wrStateKey])---- | This is a JSON template to convert a list-response for app state.------ /See:/ 'listResponse' smart constructor.-data ListResponse =- ListResponse'- { _lrMaximumKeyCount :: !(Maybe (Textual Int32))- , _lrKind :: !Text- , _lrItems :: !(Maybe [GetResponse])- }- deriving (Eq, Show, Data, Typeable, Generic)----- | Creates a value of 'ListResponse' with the minimum fields required to make a request.------ Use one of the following lenses to modify other fields as desired:------ * 'lrMaximumKeyCount'------ * 'lrKind'------ * 'lrItems'-listResponse- :: ListResponse-listResponse =- ListResponse'- { _lrMaximumKeyCount = Nothing- , _lrKind = "appstate#listResponse"- , _lrItems = Nothing- }----- | The maximum number of keys allowed for this user.-lrMaximumKeyCount :: Lens' ListResponse (Maybe Int32)-lrMaximumKeyCount- = lens _lrMaximumKeyCount- (\ s a -> s{_lrMaximumKeyCount = a})- . mapping _Coerce---- | Uniquely identifies the type of this resource. Value is always the fixed--- string appstate#listResponse.-lrKind :: Lens' ListResponse Text-lrKind = lens _lrKind (\ s a -> s{_lrKind = a})---- | The app state data.-lrItems :: Lens' ListResponse [GetResponse]-lrItems- = lens _lrItems (\ s a -> s{_lrItems = a}) . _Default- . _Coerce--instance FromJSON ListResponse where- parseJSON- = withObject "ListResponse"- (\ o ->- ListResponse' <$>- (o .:? "maximumKeyCount") <*>- (o .:? "kind" .!= "appstate#listResponse")- <*> (o .:? "items" .!= mempty))--instance ToJSON ListResponse where- toJSON ListResponse'{..}- = object- (catMaybes- [("maximumKeyCount" .=) <$> _lrMaximumKeyCount,- Just ("kind" .= _lrKind), ("items" .=) <$> _lrItems])---- | This is a JSON template for an app state resource.------ /See:/ 'getResponse' smart constructor.-data GetResponse =- GetResponse'- { _grCurrentStateVersion :: !(Maybe Text)- , _grKind :: !Text- , _grData :: !(Maybe Text)- , _grStateKey :: !(Maybe (Textual Int32))- }- deriving (Eq, Show, Data, Typeable, Generic)----- | Creates a value of 'GetResponse' with the minimum fields required to make a request.------ Use one of the following lenses to modify other fields as desired:------ * 'grCurrentStateVersion'------ * 'grKind'------ * 'grData'------ * 'grStateKey'-getResponse- :: GetResponse-getResponse =- GetResponse'- { _grCurrentStateVersion = Nothing- , _grKind = "appstate#getResponse"- , _grData = Nothing- , _grStateKey = Nothing- }----- | The current app state version.-grCurrentStateVersion :: Lens' GetResponse (Maybe Text)-grCurrentStateVersion- = lens _grCurrentStateVersion- (\ s a -> s{_grCurrentStateVersion = a})---- | Uniquely identifies the type of this resource. Value is always the fixed--- string appstate#getResponse.-grKind :: Lens' GetResponse Text-grKind = lens _grKind (\ s a -> s{_grKind = a})---- | The requested data.-grData :: Lens' GetResponse (Maybe Text)-grData = lens _grData (\ s a -> s{_grData = a})---- | The key for the data.-grStateKey :: Lens' GetResponse (Maybe Int32)-grStateKey- = lens _grStateKey (\ s a -> s{_grStateKey = a}) .- mapping _Coerce--instance FromJSON GetResponse where- parseJSON- = withObject "GetResponse"- (\ o ->- GetResponse' <$>- (o .:? "currentStateVersion") <*>- (o .:? "kind" .!= "appstate#getResponse")- <*> (o .:? "data")- <*> (o .:? "stateKey"))--instance ToJSON GetResponse where- toJSON GetResponse'{..}- = object- (catMaybes- [("currentStateVersion" .=) <$>- _grCurrentStateVersion,- Just ("kind" .= _grKind), ("data" .=) <$> _grData,- ("stateKey" .=) <$> _grStateKey])---- | This is a JSON template for a requests which update app state------ /See:/ 'updateRequest' smart constructor.-data UpdateRequest =- UpdateRequest'- { _urKind :: !Text- , _urData :: !(Maybe Text)- }- deriving (Eq, Show, Data, Typeable, Generic)----- | Creates a value of 'UpdateRequest' with the minimum fields required to make a request.------ Use one of the following lenses to modify other fields as desired:------ * 'urKind'------ * 'urData'-updateRequest- :: UpdateRequest-updateRequest =- UpdateRequest' {_urKind = "appstate#updateRequest", _urData = Nothing}----- | Uniquely identifies the type of this resource. Value is always the fixed--- string appstate#updateRequest.-urKind :: Lens' UpdateRequest Text-urKind = lens _urKind (\ s a -> s{_urKind = a})---- | The new app state data that your application is trying to update with.-urData :: Lens' UpdateRequest (Maybe Text)-urData = lens _urData (\ s a -> s{_urData = a})--instance FromJSON UpdateRequest where- parseJSON- = withObject "UpdateRequest"- (\ o ->- UpdateRequest' <$>- (o .:? "kind" .!= "appstate#updateRequest") <*>- (o .:? "data"))--instance ToJSON UpdateRequest where- toJSON UpdateRequest'{..}- = object- (catMaybes- [Just ("kind" .= _urKind), ("data" .=) <$> _urData])
− gen/Network/Google/AppState/Types/Sum.hs
@@ -1,19 +0,0 @@-{-# LANGUAGE DeriveDataTypeable #-}-{-# LANGUAGE DeriveGeneric #-}-{-# LANGUAGE LambdaCase #-}-{-# LANGUAGE NoImplicitPrelude #-}-{-# LANGUAGE OverloadedStrings #-}--{-# OPTIONS_GHC -fno-warn-unused-imports #-}---- |--- Module : Network.Google.AppState.Types.Sum--- Copyright : (c) 2015-2016 Brendan Hay--- License : Mozilla Public License, v. 2.0.--- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>--- Stability : auto-generated--- Portability : non-portable (GHC extensions)----module Network.Google.AppState.Types.Sum where--import Network.Google.Prelude hiding (Bytes)
− gen/Network/Google/Resource/AppState/States/Clear.hs
@@ -1,106 +0,0 @@-{-# 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.Clear--- Copyright : (c) 2015-2016 Brendan Hay--- License : Mozilla Public License, v. 2.0.--- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>--- Stability : auto-generated--- Portability : non-portable (GHC extensions)------ Clears (sets to empty) the data for the passed key if and only if the--- passed version matches the currently stored version. This method results--- in a conflict error on version mismatch.------ /See:/ <https://developers.google.com/games/services/web/api/states Google App State API Reference> for @appstate.states.clear@.-module Network.Google.Resource.AppState.States.Clear- (- -- * REST Resource- StatesClearResource-- -- * Creating a Request- , statesClear- , StatesClear-- -- * Request Lenses- , scStateKey- , scCurrentDataVersion- ) where--import Network.Google.AppState.Types-import Network.Google.Prelude---- | A resource alias for @appstate.states.clear@ method which the--- 'StatesClear' request conforms to.-type StatesClearResource =- "appstate" :>- "v1" :>- "states" :>- Capture "stateKey" (Textual Int32) :>- "clear" :>- QueryParam "currentDataVersion" Text :>- QueryParam "alt" AltJSON :> Post '[JSON] WriteResult---- | Clears (sets to empty) the data for the passed key if and only if the--- passed version matches the currently stored version. This method results--- in a conflict error on version mismatch.------ /See:/ 'statesClear' smart constructor.-data StatesClear =- StatesClear'- { _scStateKey :: !(Textual Int32)- , _scCurrentDataVersion :: !(Maybe Text)- }- deriving (Eq, Show, Data, Typeable, Generic)----- | Creates a value of 'StatesClear' with the minimum fields required to make a request.------ Use one of the following lenses to modify other fields as desired:------ * 'scStateKey'------ * 'scCurrentDataVersion'-statesClear- :: Int32 -- ^ 'scStateKey'- -> StatesClear-statesClear pScStateKey_ =- StatesClear'- {_scStateKey = _Coerce # pScStateKey_, _scCurrentDataVersion = Nothing}----- | The key for the data to be retrieved.-scStateKey :: Lens' StatesClear Int32-scStateKey- = lens _scStateKey (\ s a -> s{_scStateKey = a}) .- _Coerce---- | The version of the data to be cleared. Version strings are returned by--- the server.-scCurrentDataVersion :: Lens' StatesClear (Maybe Text)-scCurrentDataVersion- = lens _scCurrentDataVersion- (\ s a -> s{_scCurrentDataVersion = a})--instance GoogleRequest StatesClear where- type Rs StatesClear = WriteResult- type Scopes StatesClear =- '["https://www.googleapis.com/auth/appstate"]- requestClient StatesClear'{..}- = go _scStateKey _scCurrentDataVersion (Just AltJSON)- appStateService- where go- = buildClient (Proxy :: Proxy StatesClearResource)- mempty
− gen/Network/Google/Resource/AppState/States/Delete.hs
@@ -1,94 +0,0 @@-{-# 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.Delete--- Copyright : (c) 2015-2016 Brendan Hay--- License : Mozilla Public License, v. 2.0.--- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>--- Stability : auto-generated--- Portability : non-portable (GHC extensions)------ Deletes a key and the data associated with it. The key is removed and no--- longer counts against the key quota. Note that since this method is not--- safe in the face of concurrent modifications, it should only be used for--- development and testing purposes. Invoking this method in shipping code--- can result in data loss and data corruption.------ /See:/ <https://developers.google.com/games/services/web/api/states Google App State API Reference> for @appstate.states.delete@.-module Network.Google.Resource.AppState.States.Delete- (- -- * REST Resource- StatesDeleteResource-- -- * Creating a Request- , statesDelete- , StatesDelete-- -- * Request Lenses- , sdStateKey- ) where--import Network.Google.AppState.Types-import Network.Google.Prelude---- | A resource alias for @appstate.states.delete@ method which the--- 'StatesDelete' request conforms to.-type StatesDeleteResource =- "appstate" :>- "v1" :>- "states" :>- Capture "stateKey" (Textual Int32) :>- QueryParam "alt" AltJSON :> Delete '[JSON] ()---- | Deletes a key and the data associated with it. The key is removed and no--- longer counts against the key quota. Note that since this method is not--- safe in the face of concurrent modifications, it should only be used for--- development and testing purposes. Invoking this method in shipping code--- can result in data loss and data corruption.------ /See:/ 'statesDelete' smart constructor.-newtype StatesDelete =- StatesDelete'- { _sdStateKey :: Textual Int32- }- deriving (Eq, Show, Data, Typeable, Generic)----- | Creates a value of 'StatesDelete' with the minimum fields required to make a request.------ Use one of the following lenses to modify other fields as desired:------ * 'sdStateKey'-statesDelete- :: Int32 -- ^ 'sdStateKey'- -> StatesDelete-statesDelete pSdStateKey_ = StatesDelete' {_sdStateKey = _Coerce # pSdStateKey_}----- | The key for the data to be retrieved.-sdStateKey :: Lens' StatesDelete Int32-sdStateKey- = lens _sdStateKey (\ s a -> s{_sdStateKey = a}) .- _Coerce--instance GoogleRequest StatesDelete where- type Rs StatesDelete = ()- type Scopes StatesDelete =- '["https://www.googleapis.com/auth/appstate"]- requestClient StatesDelete'{..}- = go _sdStateKey (Just AltJSON) appStateService- where go- = buildClient (Proxy :: Proxy StatesDeleteResource)- mempty
− gen/Network/Google/Resource/AppState/States/Get.hs
@@ -1,88 +0,0 @@-{-# 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.Get--- Copyright : (c) 2015-2016 Brendan Hay--- License : Mozilla Public License, v. 2.0.--- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>--- Stability : auto-generated--- Portability : non-portable (GHC extensions)------ Retrieves the data corresponding to the passed key. If the key does not--- exist on the server, an HTTP 404 will be returned.------ /See:/ <https://developers.google.com/games/services/web/api/states Google App State API Reference> for @appstate.states.get@.-module Network.Google.Resource.AppState.States.Get- (- -- * REST Resource- StatesGetResource-- -- * Creating a Request- , statesGet- , StatesGet-- -- * Request Lenses- , sgStateKey- ) where--import Network.Google.AppState.Types-import Network.Google.Prelude---- | A resource alias for @appstate.states.get@ method which the--- 'StatesGet' request conforms to.-type StatesGetResource =- "appstate" :>- "v1" :>- "states" :>- Capture "stateKey" (Textual Int32) :>- QueryParam "alt" AltJSON :> Get '[JSON] GetResponse---- | Retrieves the data corresponding to the passed key. If the key does not--- exist on the server, an HTTP 404 will be returned.------ /See:/ 'statesGet' smart constructor.-newtype StatesGet =- StatesGet'- { _sgStateKey :: Textual Int32- }- deriving (Eq, Show, Data, Typeable, Generic)----- | Creates a value of 'StatesGet' with the minimum fields required to make a request.------ Use one of the following lenses to modify other fields as desired:------ * 'sgStateKey'-statesGet- :: Int32 -- ^ 'sgStateKey'- -> StatesGet-statesGet pSgStateKey_ = StatesGet' {_sgStateKey = _Coerce # pSgStateKey_}----- | The key for the data to be retrieved.-sgStateKey :: Lens' StatesGet Int32-sgStateKey- = lens _sgStateKey (\ s a -> s{_sgStateKey = a}) .- _Coerce--instance GoogleRequest StatesGet where- type Rs StatesGet = GetResponse- type Scopes StatesGet =- '["https://www.googleapis.com/auth/appstate"]- requestClient StatesGet'{..}- = go _sgStateKey (Just AltJSON) appStateService- where go- = buildClient (Proxy :: Proxy StatesGetResource)- mempty
− gen/Network/Google/Resource/AppState/States/List.hs
@@ -1,86 +0,0 @@-{-# 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.List--- Copyright : (c) 2015-2016 Brendan Hay--- License : Mozilla Public License, v. 2.0.--- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>--- Stability : auto-generated--- Portability : non-portable (GHC extensions)------ Lists all the states keys, and optionally the state data.------ /See:/ <https://developers.google.com/games/services/web/api/states Google App State API Reference> for @appstate.states.list@.-module Network.Google.Resource.AppState.States.List- (- -- * REST Resource- StatesListResource-- -- * Creating a Request- , statesList- , StatesList-- -- * Request Lenses- , slIncludeData- ) where--import Network.Google.AppState.Types-import Network.Google.Prelude---- | A resource alias for @appstate.states.list@ method which the--- 'StatesList' request conforms to.-type StatesListResource =- "appstate" :>- "v1" :>- "states" :>- QueryParam "includeData" Bool :>- QueryParam "alt" AltJSON :> Get '[JSON] ListResponse---- | Lists all the states keys, and optionally the state data.------ /See:/ 'statesList' smart constructor.-newtype StatesList =- StatesList'- { _slIncludeData :: Bool- }- deriving (Eq, Show, Data, Typeable, Generic)----- | Creates a value of 'StatesList' with the minimum fields required to make a request.------ Use one of the following lenses to modify other fields as desired:------ * 'slIncludeData'-statesList- :: StatesList-statesList = StatesList' {_slIncludeData = False}----- | Whether to include the full data in addition to the version number-slIncludeData :: Lens' StatesList Bool-slIncludeData- = lens _slIncludeData- (\ s a -> s{_slIncludeData = a})--instance GoogleRequest StatesList where- type Rs StatesList = ListResponse- type Scopes StatesList =- '["https://www.googleapis.com/auth/appstate"]- requestClient StatesList'{..}- = go (Just _slIncludeData) (Just AltJSON)- appStateService- where go- = buildClient (Proxy :: Proxy StatesListResource)- mempty
− gen/Network/Google/Resource/AppState/States/Update.hs
@@ -1,124 +0,0 @@-{-# 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--- Copyright : (c) 2015-2016 Brendan Hay--- License : Mozilla Public License, v. 2.0.--- Maintainer : Brendan Hay <brendan.g.hay@gmail.com>--- Stability : auto-generated--- Portability : non-portable (GHC extensions)------ Update the data associated with the input key if and only if the passed--- version matches the currently stored version. This method is safe in the--- face of concurrent writes. Maximum per-key size is 128KB.------ /See:/ <https://developers.google.com/games/services/web/api/states Google App State API Reference> for @appstate.states.update@.-module Network.Google.Resource.AppState.States.Update- (- -- * REST Resource- StatesUpdateResource-- -- * Creating a Request- , statesUpdate- , StatesUpdate-- -- * Request Lenses- , suCurrentStateVersion- , suStateKey- , suPayload- ) where--import Network.Google.AppState.Types-import Network.Google.Prelude---- | A resource alias for @appstate.states.update@ method which the--- 'StatesUpdate' request conforms to.-type StatesUpdateResource =- "appstate" :>- "v1" :>- "states" :>- Capture "stateKey" (Textual Int32) :>- QueryParam "currentStateVersion" Text :>- QueryParam "alt" AltJSON :>- ReqBody '[JSON] UpdateRequest :>- Put '[JSON] WriteResult---- | Update the data associated with the input key if and only if the passed--- version matches the currently stored version. This method is safe in the--- face of concurrent writes. Maximum per-key size is 128KB.------ /See:/ 'statesUpdate' smart constructor.-data StatesUpdate =- StatesUpdate'- { _suCurrentStateVersion :: !(Maybe Text)- , _suStateKey :: !(Textual Int32)- , _suPayload :: !UpdateRequest- }- deriving (Eq, Show, Data, Typeable, Generic)----- | Creates a value of 'StatesUpdate' with the minimum fields required to make a request.------ Use one of the following lenses to modify other fields as desired:------ * 'suCurrentStateVersion'------ * 'suStateKey'------ * 'suPayload'-statesUpdate- :: Int32 -- ^ 'suStateKey'- -> UpdateRequest -- ^ 'suPayload'- -> StatesUpdate-statesUpdate pSuStateKey_ pSuPayload_ =- StatesUpdate'- { _suCurrentStateVersion = Nothing- , _suStateKey = _Coerce # pSuStateKey_- , _suPayload = pSuPayload_- }----- | The version of the app state your application is attempting to update.--- If this does not match the current version, this method will return a--- conflict error. If there is no data stored on the server for this key,--- the update will succeed irrespective of the value of this parameter.-suCurrentStateVersion :: Lens' StatesUpdate (Maybe Text)-suCurrentStateVersion- = lens _suCurrentStateVersion- (\ s a -> s{_suCurrentStateVersion = a})---- | The key for the data to be retrieved.-suStateKey :: Lens' StatesUpdate Int32-suStateKey- = lens _suStateKey (\ s a -> s{_suStateKey = a}) .- _Coerce---- | Multipart request metadata.-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
gogol-appstate.cabal view
@@ -1,50 +1,65 @@-name: gogol-appstate-version: 0.5.0-synopsis: Google App State SDK.-homepage: https://github.com/brendanhay/gogol-bug-reports: https://github.com/brendanhay/gogol/issues-license: OtherLicense-license-file: LICENSE-author: Brendan Hay-maintainer: Brendan Hay <brendan.g.hay@gmail.com>-copyright: Copyright (c) 2015-2016 Brendan Hay-category: Network, Google, Cloud-build-type: Simple-cabal-version: >= 1.10-extra-source-files: README.md src/.gitkeep+cabal-version: 2.2+name: gogol-appstate+version: 1.0.0+synopsis: Google App State SDK.+homepage: https://github.com/brendanhay/gogol+bug-reports: https://github.com/brendanhay/gogol/issues+license: MPL-2.0+license-file: LICENSE+author: Brendan Hay+maintainer:+ Brendan Hay <brendan.g.hay+gogol@gmail.com>, Toni Cebrián <toni@tonicebrian.com> +copyright: Copyright (c) 2015-2025 Brendan Hay+category: Google+build-type: Simple+extra-source-files:+ README.md+ src/.gitkeep+ description:- The Google App State API.- .- /Warning:/ This is an experimental prototype/preview release which is still- under exploratory development and not intended for public use, caveat emptor!- .- This library is compatible with version @v1@- of the API.+ The Google App State API.+ .+ /Warning:/ This is an experimental prototype/preview release which is still+ under exploratory development and not intended for public use, caveat emptor!+ .+ This library is compatible with version @v1@+ of the API. source-repository head- type: git- location: git://github.com/brendanhay/gogol.git+ type: git+ location: git://github.com/brendanhay/gogol.git+ subdir: gogol-appstate +flag field-selectors+ description:+ If record field selectors should be enabled. Disabling this requires GHC >=9.2 and the NoFieldSelectors extension.++ default: False+ manual: True+ library- default-language: Haskell2010- hs-source-dirs: src gen+ default-language: GHC2021+ hs-source-dirs: src gen+ ghc-options:+ -Wall -fwarn-incomplete-uni-patterns+ -fwarn-incomplete-record-updates -funbox-strict-fields+ -fwarn-unused-packages - ghc-options: -Wall+ if (!flag(field-selectors) && impl(ghc >=9.2))+ default-extensions: NoFieldSelectors - exposed-modules:- Network.Google.AppState- , Network.Google.AppState.Types- , Network.Google.Resource.AppState.States.Clear- , Network.Google.Resource.AppState.States.Delete- , Network.Google.Resource.AppState.States.Get- , Network.Google.Resource.AppState.States.List- , Network.Google.Resource.AppState.States.Update+ exposed-modules:+ Gogol.AppState+ Gogol.AppState.States.Clear+ Gogol.AppState.States.Delete+ Gogol.AppState.States.Get+ Gogol.AppState.States.List+ Gogol.AppState.States.Update+ Gogol.AppState.Types - other-modules:- Network.Google.AppState.Types.Product- , Network.Google.AppState.Types.Sum+ other-modules:+ Gogol.AppState.Internal.Product+ Gogol.AppState.Internal.Sum - build-depends:- gogol-core == 0.5.0.*- , base >= 4.7 && < 5+ build-depends: gogol-core ^>=1.0.0