-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Google App State SDK.
--   
--   The Google App State API.
--   
--   <i>Warning:</i> 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 <tt>v1</tt> of the API.
@package gogol-appstate
@version 0.3.0


module Network.Google.AppState.Types

-- | Default request referring to version <tt>v1</tt> of the Google App
--   State API. This contains the host and root path used as a starting
--   point for constructing service requests.
appStateService :: ServiceConfig

-- | View and manage your data for this application
appStateScope :: Proxy '["https://www.googleapis.com/auth/appstate"]

-- | This is a JSON template for an app state write result.
--   
--   <i>See:</i> <a>writeResult</a> smart constructor.
data WriteResult

-- | Creates a value of <a>WriteResult</a> with the minimum fields required
--   to make a request.
--   
--   Use one of the following lenses to modify other fields as desired:
--   
--   <ul>
--   <li><a>wrCurrentStateVersion</a></li>
--   <li><a>wrKind</a></li>
--   <li><a>wrStateKey</a></li>
--   </ul>
writeResult :: WriteResult

-- | The version of the data for this key on the server.
wrCurrentStateVersion :: Lens' WriteResult (Maybe Text)

-- | Uniquely identifies the type of this resource. Value is always the
--   fixed string appstate#writeResult.
wrKind :: Lens' WriteResult Text

-- | The written key.
wrStateKey :: Lens' WriteResult (Maybe Int32)

-- | This is a JSON template to convert a list-response for app state.
--   
--   <i>See:</i> <a>listResponse</a> smart constructor.
data ListResponse

-- | Creates a value of <a>ListResponse</a> with the minimum fields
--   required to make a request.
--   
--   Use one of the following lenses to modify other fields as desired:
--   
--   <ul>
--   <li><a>lrMaximumKeyCount</a></li>
--   <li><a>lrKind</a></li>
--   <li><a>lrItems</a></li>
--   </ul>
listResponse :: ListResponse

-- | The maximum number of keys allowed for this user.
lrMaximumKeyCount :: Lens' ListResponse (Maybe Int32)

-- | Uniquely identifies the type of this resource. Value is always the
--   fixed string appstate#listResponse.
lrKind :: Lens' ListResponse Text

-- | The app state data.
lrItems :: Lens' ListResponse [GetResponse]

-- | This is a JSON template for an app state resource.
--   
--   <i>See:</i> <a>getResponse</a> smart constructor.
data GetResponse

-- | Creates a value of <a>GetResponse</a> with the minimum fields required
--   to make a request.
--   
--   Use one of the following lenses to modify other fields as desired:
--   
--   <ul>
--   <li><a>grCurrentStateVersion</a></li>
--   <li><a>grKind</a></li>
--   <li><a>grData</a></li>
--   <li><a>grStateKey</a></li>
--   </ul>
getResponse :: GetResponse

-- | The current app state version.
grCurrentStateVersion :: Lens' GetResponse (Maybe Text)

-- | Uniquely identifies the type of this resource. Value is always the
--   fixed string appstate#getResponse.
grKind :: Lens' GetResponse Text

-- | The requested data.
grData :: Lens' GetResponse (Maybe Text)

-- | The key for the data.
grStateKey :: Lens' GetResponse (Maybe Int32)

-- | This is a JSON template for a requests which update app state
--   
--   <i>See:</i> <a>updateRequest</a> smart constructor.
data UpdateRequest

-- | Creates a value of <a>UpdateRequest</a> with the minimum fields
--   required to make a request.
--   
--   Use one of the following lenses to modify other fields as desired:
--   
--   <ul>
--   <li><a>urKind</a></li>
--   <li><a>urData</a></li>
--   </ul>
updateRequest :: UpdateRequest

-- | Uniquely identifies the type of this resource. Value is always the
--   fixed string appstate#updateRequest.
urKind :: Lens' UpdateRequest Text

-- | The new app state data that your application is trying to update with.
urData :: Lens' UpdateRequest (Maybe Text)


-- | 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.
--   
--   <i>See:</i> <a>Google App State API Reference</a> for
--   <tt>appstate.states.clear</tt>.
module Network.Google.Resource.AppState.States.Clear

-- | A resource alias for <tt>appstate.states.clear</tt> method which the
--   <a>StatesClear</a> request conforms to.
type StatesClearResource = "appstate" :> ("v1" :> ("states" :> (Capture "stateKey" (Textual Int32) :> ("clear" :> (QueryParam "currentDataVersion" Text :> (QueryParam "alt" AltJSON :> Post '[JSON] WriteResult))))))

-- | Creates a value of <a>StatesClear</a> with the minimum fields required
--   to make a request.
--   
--   Use one of the following lenses to modify other fields as desired:
--   
--   <ul>
--   <li><a>scStateKey</a></li>
--   <li><a>scCurrentDataVersion</a></li>
--   </ul>
statesClear :: Int32 -> StatesClear

-- | 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.
--   
--   <i>See:</i> <a>statesClear</a> smart constructor.
data StatesClear

-- | The key for the data to be retrieved.
scStateKey :: Lens' StatesClear Int32

-- | The version of the data to be cleared. Version strings are returned by
--   the server.
scCurrentDataVersion :: Lens' StatesClear (Maybe Text)
instance GHC.Generics.Generic Network.Google.Resource.AppState.States.Clear.StatesClear
instance Data.Data.Data Network.Google.Resource.AppState.States.Clear.StatesClear
instance GHC.Show.Show Network.Google.Resource.AppState.States.Clear.StatesClear
instance GHC.Classes.Eq Network.Google.Resource.AppState.States.Clear.StatesClear
instance Network.Google.Types.GoogleRequest Network.Google.Resource.AppState.States.Clear.StatesClear


-- | 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.
--   
--   <i>See:</i> <a>Google App State API Reference</a> for
--   <tt>appstate.states.delete</tt>.
module Network.Google.Resource.AppState.States.Delete

-- | A resource alias for <tt>appstate.states.delete</tt> method which the
--   <a>StatesDelete</a> request conforms to.
type StatesDeleteResource = "appstate" :> ("v1" :> ("states" :> (Capture "stateKey" (Textual Int32) :> (QueryParam "alt" AltJSON :> Delete '[JSON] ()))))

-- | Creates a value of <a>StatesDelete</a> with the minimum fields
--   required to make a request.
--   
--   Use one of the following lenses to modify other fields as desired:
--   
--   <ul>
--   <li><a>sdStateKey</a></li>
--   </ul>
statesDelete :: Int32 -> StatesDelete

-- | 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.
--   
--   <i>See:</i> <a>statesDelete</a> smart constructor.
data StatesDelete

-- | The key for the data to be retrieved.
sdStateKey :: Lens' StatesDelete Int32
instance GHC.Generics.Generic Network.Google.Resource.AppState.States.Delete.StatesDelete
instance Data.Data.Data Network.Google.Resource.AppState.States.Delete.StatesDelete
instance GHC.Show.Show Network.Google.Resource.AppState.States.Delete.StatesDelete
instance GHC.Classes.Eq Network.Google.Resource.AppState.States.Delete.StatesDelete
instance Network.Google.Types.GoogleRequest Network.Google.Resource.AppState.States.Delete.StatesDelete


-- | Retrieves the data corresponding to the passed key. If the key does
--   not exist on the server, an HTTP 404 will be returned.
--   
--   <i>See:</i> <a>Google App State API Reference</a> for
--   <tt>appstate.states.get</tt>.
module Network.Google.Resource.AppState.States.Get

-- | A resource alias for <tt>appstate.states.get</tt> method which the
--   <a>StatesGet</a> request conforms to.
type StatesGetResource = "appstate" :> ("v1" :> ("states" :> (Capture "stateKey" (Textual Int32) :> (QueryParam "alt" AltJSON :> Get '[JSON] GetResponse))))

-- | Creates a value of <a>StatesGet</a> with the minimum fields required
--   to make a request.
--   
--   Use one of the following lenses to modify other fields as desired:
--   
--   <ul>
--   <li><a>sgStateKey</a></li>
--   </ul>
statesGet :: Int32 -> StatesGet

-- | Retrieves the data corresponding to the passed key. If the key does
--   not exist on the server, an HTTP 404 will be returned.
--   
--   <i>See:</i> <a>statesGet</a> smart constructor.
data StatesGet

-- | The key for the data to be retrieved.
sgStateKey :: Lens' StatesGet Int32
instance GHC.Generics.Generic Network.Google.Resource.AppState.States.Get.StatesGet
instance Data.Data.Data Network.Google.Resource.AppState.States.Get.StatesGet
instance GHC.Show.Show Network.Google.Resource.AppState.States.Get.StatesGet
instance GHC.Classes.Eq Network.Google.Resource.AppState.States.Get.StatesGet
instance Network.Google.Types.GoogleRequest Network.Google.Resource.AppState.States.Get.StatesGet


-- | Lists all the states keys, and optionally the state data.
--   
--   <i>See:</i> <a>Google App State API Reference</a> for
--   <tt>appstate.states.list</tt>.
module Network.Google.Resource.AppState.States.List

-- | A resource alias for <tt>appstate.states.list</tt> method which the
--   <a>StatesList</a> request conforms to.
type StatesListResource = "appstate" :> ("v1" :> ("states" :> (QueryParam "includeData" Bool :> (QueryParam "alt" AltJSON :> Get '[JSON] ListResponse))))

-- | Creates a value of <a>StatesList</a> with the minimum fields required
--   to make a request.
--   
--   Use one of the following lenses to modify other fields as desired:
--   
--   <ul>
--   <li><a>slIncludeData</a></li>
--   </ul>
statesList :: StatesList

-- | Lists all the states keys, and optionally the state data.
--   
--   <i>See:</i> <a>statesList</a> smart constructor.
data StatesList

-- | Whether to include the full data in addition to the version number
slIncludeData :: Lens' StatesList Bool
instance GHC.Generics.Generic Network.Google.Resource.AppState.States.List.StatesList
instance Data.Data.Data Network.Google.Resource.AppState.States.List.StatesList
instance GHC.Show.Show Network.Google.Resource.AppState.States.List.StatesList
instance GHC.Classes.Eq Network.Google.Resource.AppState.States.List.StatesList
instance Network.Google.Types.GoogleRequest Network.Google.Resource.AppState.States.List.StatesList


-- | 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.
--   
--   <i>See:</i> <a>Google App State API Reference</a> for
--   <tt>appstate.states.update</tt>.
module Network.Google.Resource.AppState.States.Update

-- | A resource alias for <tt>appstate.states.update</tt> method which the
--   <a>StatesUpdate</a> request conforms to.
type StatesUpdateResource = "appstate" :> ("v1" :> ("states" :> (Capture "stateKey" (Textual Int32) :> (QueryParam "currentStateVersion" Text :> (QueryParam "alt" AltJSON :> (ReqBody '[JSON] UpdateRequest :> Put '[JSON] WriteResult))))))

-- | Creates a value of <a>StatesUpdate</a> with the minimum fields
--   required to make a request.
--   
--   Use one of the following lenses to modify other fields as desired:
--   
--   <ul>
--   <li><a>suCurrentStateVersion</a></li>
--   <li><a>suStateKey</a></li>
--   <li><a>suPayload</a></li>
--   </ul>
statesUpdate :: Int32 -> UpdateRequest -> StatesUpdate

-- | 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.
--   
--   <i>See:</i> <a>statesUpdate</a> smart constructor.
data StatesUpdate

-- | 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)

-- | The key for the data to be retrieved.
suStateKey :: Lens' StatesUpdate Int32

-- | Multipart request metadata.
suPayload :: Lens' StatesUpdate UpdateRequest
instance GHC.Generics.Generic Network.Google.Resource.AppState.States.Update.StatesUpdate
instance Data.Data.Data Network.Google.Resource.AppState.States.Update.StatesUpdate
instance GHC.Show.Show Network.Google.Resource.AppState.States.Update.StatesUpdate
instance GHC.Classes.Eq Network.Google.Resource.AppState.States.Update.StatesUpdate
instance Network.Google.Types.GoogleRequest Network.Google.Resource.AppState.States.Update.StatesUpdate


-- | The Google App State API.
--   
--   <i>See:</i> <a>Google App State API Reference</a>
module Network.Google.AppState

-- | Default request referring to version <tt>v1</tt> of the Google App
--   State API. This contains the host and root path used as a starting
--   point for constructing service requests.
appStateService :: ServiceConfig

-- | View and manage your data for this application
appStateScope :: Proxy '["https://www.googleapis.com/auth/appstate"]

-- | Represents the entirety of the methods and resources available for the
--   Google App State API service.
type AppStateAPI = StatesListResource :<|> (StatesGetResource :<|> (StatesClearResource :<|> (StatesDeleteResource :<|> StatesUpdateResource)))

-- | This is a JSON template for an app state write result.
--   
--   <i>See:</i> <a>writeResult</a> smart constructor.
data WriteResult

-- | Creates a value of <a>WriteResult</a> with the minimum fields required
--   to make a request.
--   
--   Use one of the following lenses to modify other fields as desired:
--   
--   <ul>
--   <li><a>wrCurrentStateVersion</a></li>
--   <li><a>wrKind</a></li>
--   <li><a>wrStateKey</a></li>
--   </ul>
writeResult :: WriteResult

-- | The version of the data for this key on the server.
wrCurrentStateVersion :: Lens' WriteResult (Maybe Text)

-- | Uniquely identifies the type of this resource. Value is always the
--   fixed string appstate#writeResult.
wrKind :: Lens' WriteResult Text

-- | The written key.
wrStateKey :: Lens' WriteResult (Maybe Int32)

-- | This is a JSON template to convert a list-response for app state.
--   
--   <i>See:</i> <a>listResponse</a> smart constructor.
data ListResponse

-- | Creates a value of <a>ListResponse</a> with the minimum fields
--   required to make a request.
--   
--   Use one of the following lenses to modify other fields as desired:
--   
--   <ul>
--   <li><a>lrMaximumKeyCount</a></li>
--   <li><a>lrKind</a></li>
--   <li><a>lrItems</a></li>
--   </ul>
listResponse :: ListResponse

-- | The maximum number of keys allowed for this user.
lrMaximumKeyCount :: Lens' ListResponse (Maybe Int32)

-- | Uniquely identifies the type of this resource. Value is always the
--   fixed string appstate#listResponse.
lrKind :: Lens' ListResponse Text

-- | The app state data.
lrItems :: Lens' ListResponse [GetResponse]

-- | This is a JSON template for an app state resource.
--   
--   <i>See:</i> <a>getResponse</a> smart constructor.
data GetResponse

-- | Creates a value of <a>GetResponse</a> with the minimum fields required
--   to make a request.
--   
--   Use one of the following lenses to modify other fields as desired:
--   
--   <ul>
--   <li><a>grCurrentStateVersion</a></li>
--   <li><a>grKind</a></li>
--   <li><a>grData</a></li>
--   <li><a>grStateKey</a></li>
--   </ul>
getResponse :: GetResponse

-- | The current app state version.
grCurrentStateVersion :: Lens' GetResponse (Maybe Text)

-- | Uniquely identifies the type of this resource. Value is always the
--   fixed string appstate#getResponse.
grKind :: Lens' GetResponse Text

-- | The requested data.
grData :: Lens' GetResponse (Maybe Text)

-- | The key for the data.
grStateKey :: Lens' GetResponse (Maybe Int32)

-- | This is a JSON template for a requests which update app state
--   
--   <i>See:</i> <a>updateRequest</a> smart constructor.
data UpdateRequest

-- | Creates a value of <a>UpdateRequest</a> with the minimum fields
--   required to make a request.
--   
--   Use one of the following lenses to modify other fields as desired:
--   
--   <ul>
--   <li><a>urKind</a></li>
--   <li><a>urData</a></li>
--   </ul>
updateRequest :: UpdateRequest

-- | Uniquely identifies the type of this resource. Value is always the
--   fixed string appstate#updateRequest.
urKind :: Lens' UpdateRequest Text

-- | The new app state data that your application is trying to update with.
urData :: Lens' UpdateRequest (Maybe Text)
