mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
185 lines
10 KiB
TypeScript
185 lines
10 KiB
TypeScript
// Type definitions for non-npm package Google Google App State API v1 1.0
|
|
// Project: https://developers.google.com/games/services/web/api/states
|
|
// Definitions by: Bolisov Alexey <https://github.com/Bolisov>
|
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
|
// TypeScript Version: 2.3
|
|
|
|
// IMPORTANT
|
|
// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually.
|
|
// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator
|
|
// Generated from: https://www.googleapis.com/discovery/v1/apis/appstate/v1/rest
|
|
|
|
/// <reference types="gapi.client" />
|
|
|
|
declare namespace gapi.client {
|
|
/** Load Google App State API v1 */
|
|
function load(name: "appstate", version: "v1"): PromiseLike<void>;
|
|
function load(name: "appstate", version: "v1", callback: () => any): void;
|
|
|
|
const states: appstate.StatesResource;
|
|
|
|
namespace appstate {
|
|
interface GetResponse {
|
|
/** The current app state version. */
|
|
currentStateVersion?: string;
|
|
/** The requested data. */
|
|
data?: string;
|
|
/** Uniquely identifies the type of this resource. Value is always the fixed string appstate#getResponse. */
|
|
kind?: string;
|
|
/** The key for the data. */
|
|
stateKey?: number;
|
|
}
|
|
interface ListResponse {
|
|
/** The app state data. */
|
|
items?: GetResponse[];
|
|
/** Uniquely identifies the type of this resource. Value is always the fixed string appstate#listResponse. */
|
|
kind?: string;
|
|
/** The maximum number of keys allowed for this user. */
|
|
maximumKeyCount?: number;
|
|
}
|
|
interface UpdateRequest {
|
|
/** The new app state data that your application is trying to update with. */
|
|
data?: string;
|
|
/** Uniquely identifies the type of this resource. Value is always the fixed string appstate#updateRequest. */
|
|
kind?: string;
|
|
}
|
|
interface WriteResult {
|
|
/** The version of the data for this key on the server. */
|
|
currentStateVersion?: string;
|
|
/** Uniquely identifies the type of this resource. Value is always the fixed string appstate#writeResult. */
|
|
kind?: string;
|
|
/** The written key. */
|
|
stateKey?: number;
|
|
}
|
|
interface StatesResource {
|
|
/**
|
|
* 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.
|
|
*/
|
|
clear(request: {
|
|
/** Data format for the response. */
|
|
alt?: string;
|
|
/** The version of the data to be cleared. Version strings are returned by the server. */
|
|
currentDataVersion?: string;
|
|
/** Selector specifying which fields to include in a partial response. */
|
|
fields?: string;
|
|
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
key?: string;
|
|
/** OAuth 2.0 token for the current user. */
|
|
oauth_token?: string;
|
|
/** Returns response with indentations and line breaks. */
|
|
prettyPrint?: boolean;
|
|
/**
|
|
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
* Overrides userIp if both are provided.
|
|
*/
|
|
quotaUser?: string;
|
|
/** The key for the data to be retrieved. */
|
|
stateKey: number;
|
|
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
|
userIp?: string;
|
|
}): Request<WriteResult>;
|
|
/**
|
|
* 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.
|
|
*/
|
|
delete(request: {
|
|
/** Data format for the response. */
|
|
alt?: string;
|
|
/** Selector specifying which fields to include in a partial response. */
|
|
fields?: string;
|
|
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
key?: string;
|
|
/** OAuth 2.0 token for the current user. */
|
|
oauth_token?: string;
|
|
/** Returns response with indentations and line breaks. */
|
|
prettyPrint?: boolean;
|
|
/**
|
|
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
* Overrides userIp if both are provided.
|
|
*/
|
|
quotaUser?: string;
|
|
/** The key for the data to be retrieved. */
|
|
stateKey: number;
|
|
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
|
userIp?: string;
|
|
}): Request<void>;
|
|
/** Retrieves the data corresponding to the passed key. If the key does not exist on the server, an HTTP 404 will be returned. */
|
|
get(request: {
|
|
/** Data format for the response. */
|
|
alt?: string;
|
|
/** Selector specifying which fields to include in a partial response. */
|
|
fields?: string;
|
|
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
key?: string;
|
|
/** OAuth 2.0 token for the current user. */
|
|
oauth_token?: string;
|
|
/** Returns response with indentations and line breaks. */
|
|
prettyPrint?: boolean;
|
|
/**
|
|
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
* Overrides userIp if both are provided.
|
|
*/
|
|
quotaUser?: string;
|
|
/** The key for the data to be retrieved. */
|
|
stateKey: number;
|
|
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
|
userIp?: string;
|
|
}): Request<GetResponse>;
|
|
/** Lists all the states keys, and optionally the state data. */
|
|
list(request: {
|
|
/** Data format for the response. */
|
|
alt?: string;
|
|
/** Selector specifying which fields to include in a partial response. */
|
|
fields?: string;
|
|
/** Whether to include the full data in addition to the version number */
|
|
includeData?: boolean;
|
|
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
key?: string;
|
|
/** OAuth 2.0 token for the current user. */
|
|
oauth_token?: string;
|
|
/** Returns response with indentations and line breaks. */
|
|
prettyPrint?: boolean;
|
|
/**
|
|
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
* Overrides userIp if both are provided.
|
|
*/
|
|
quotaUser?: string;
|
|
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
|
userIp?: string;
|
|
}): Request<ListResponse>;
|
|
/**
|
|
* 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.
|
|
*/
|
|
update(request: {
|
|
/** Data format for the response. */
|
|
alt?: string;
|
|
/**
|
|
* 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?: string;
|
|
/** Selector specifying which fields to include in a partial response. */
|
|
fields?: string;
|
|
/** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
|
|
key?: string;
|
|
/** OAuth 2.0 token for the current user. */
|
|
oauth_token?: string;
|
|
/** Returns response with indentations and line breaks. */
|
|
prettyPrint?: boolean;
|
|
/**
|
|
* Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
|
* Overrides userIp if both are provided.
|
|
*/
|
|
quotaUser?: string;
|
|
/** The key for the data to be retrieved. */
|
|
stateKey: number;
|
|
/** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
|
|
userIp?: string;
|
|
}): Request<WriteResult>;
|
|
}
|
|
}
|
|
}
|