appstate

package
v0.0.0-...-c37129a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 16, 2016 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package appstate provides access to the Google App State API.

See https://developers.google.com/games/services/web/api/states

Usage example:

import "google.golang.org/api/appstate/v1"
...
appstateService, err := appstate.New(oauthHttpClient)

Index

Constants

View Source
const (
	// View and manage your data for this application
	AppstateScope = "https://www.googleapis.com/auth/appstate"
)

OAuth2 scopes used by this API.

Variables

This section is empty.

Functions

This section is empty.

Types

type GetResponse

type GetResponse struct {
	// CurrentStateVersion: The current app state version.
	CurrentStateVersion string `json:"currentStateVersion,omitempty"`

	// Data: The requested data.
	Data string `json:"data,omitempty"`

	// Kind: Uniquely identifies the type of this resource. Value is always
	// the fixed string appstate#getResponse.
	Kind string `json:"kind,omitempty"`

	// StateKey: The key for the data.
	StateKey int64 `json:"stateKey,omitempty"`
}

type ListResponse

type ListResponse struct {
	// Items: The app state data.
	Items []*GetResponse `json:"items,omitempty"`

	// Kind: Uniquely identifies the type of this resource. Value is always
	// the fixed string appstate#listResponse.
	Kind string `json:"kind,omitempty"`

	// MaximumKeyCount: The maximum number of keys allowed for this user.
	MaximumKeyCount int64 `json:"maximumKeyCount,omitempty"`
}

type Service

type Service struct {
	BasePath string // API endpoint base URL

	States *StatesService
	// contains filtered or unexported fields
}

func New

func New(client *http.Client) (*Service, error)

type StatesClearCall

type StatesClearCall struct {
	// contains filtered or unexported fields
}

func (*StatesClearCall) CurrentDataVersion

func (c *StatesClearCall) CurrentDataVersion(currentDataVersion string) *StatesClearCall

CurrentDataVersion sets the optional parameter "currentDataVersion": The version of the data to be cleared. Version strings are returned by the server.

func (*StatesClearCall) Do

func (c *StatesClearCall) Do() (*WriteResult, error)

func (*StatesClearCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

type StatesDeleteCall

type StatesDeleteCall struct {
	// contains filtered or unexported fields
}

func (*StatesDeleteCall) Do

func (c *StatesDeleteCall) Do() error

func (*StatesDeleteCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

type StatesGetCall

type StatesGetCall struct {
	// contains filtered or unexported fields
}

func (*StatesGetCall) Do

func (c *StatesGetCall) Do() (*GetResponse, error)

func (*StatesGetCall) Fields

func (c *StatesGetCall) Fields(s ...googleapi.Field) *StatesGetCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

type StatesListCall

type StatesListCall struct {
	// contains filtered or unexported fields
}

func (*StatesListCall) Do

func (c *StatesListCall) Do() (*ListResponse, error)

func (*StatesListCall) Fields

func (c *StatesListCall) Fields(s ...googleapi.Field) *StatesListCall

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

func (*StatesListCall) IncludeData

func (c *StatesListCall) IncludeData(includeData bool) *StatesListCall

IncludeData sets the optional parameter "includeData": Whether to include the full data in addition to the version number

type StatesService

type StatesService struct {
	// contains filtered or unexported fields
}

func NewStatesService

func NewStatesService(s *Service) *StatesService

func (*StatesService) Clear

func (r *StatesService) Clear(stateKey int64) *StatesClearCall

Clear: 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.

func (*StatesService) Delete

func (r *StatesService) Delete(stateKey int64) *StatesDeleteCall

Delete: 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.

func (*StatesService) Get

func (r *StatesService) Get(stateKey int64) *StatesGetCall

Get: Retrieves the data corresponding to the passed key. If the key does not exist on the server, an HTTP 404 will be returned.

func (*StatesService) List

func (r *StatesService) List() *StatesListCall

List: Lists all the states keys, and optionally the state data.

func (*StatesService) Update

func (r *StatesService) Update(stateKey int64, updaterequest *UpdateRequest) *StatesUpdateCall

Update: 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.

type StatesUpdateCall

type StatesUpdateCall struct {
	// contains filtered or unexported fields
}

func (*StatesUpdateCall) CurrentStateVersion

func (c *StatesUpdateCall) CurrentStateVersion(currentStateVersion string) *StatesUpdateCall

CurrentStateVersion sets the optional parameter "currentStateVersion": 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.

func (*StatesUpdateCall) Do

func (c *StatesUpdateCall) Do() (*WriteResult, error)

func (*StatesUpdateCall) Fields

Fields allows partial responses to be retrieved. See https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more information.

type UpdateRequest

type UpdateRequest struct {
	// Data: The new app state data that your application is trying to
	// update with.
	Data string `json:"data,omitempty"`

	// Kind: Uniquely identifies the type of this resource. Value is always
	// the fixed string appstate#updateRequest.
	Kind string `json:"kind,omitempty"`
}

type WriteResult

type WriteResult struct {
	// CurrentStateVersion: The version of the data for this key on the
	// server.
	CurrentStateVersion string `json:"currentStateVersion,omitempty"`

	// Kind: Uniquely identifies the type of this resource. Value is always
	// the fixed string appstate#writeResult.
	Kind string `json:"kind,omitempty"`

	// StateKey: The written key.
	StateKey int64 `json:"stateKey,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL