1<html><body> 2<style> 3 4body, h1, h2, h3, div, span, p, pre, a { 5 margin: 0; 6 padding: 0; 7 border: 0; 8 font-weight: inherit; 9 font-style: inherit; 10 font-size: 100%; 11 font-family: inherit; 12 vertical-align: baseline; 13} 14 15body { 16 font-size: 13px; 17 padding: 1em; 18} 19 20h1 { 21 font-size: 26px; 22 margin-bottom: 1em; 23} 24 25h2 { 26 font-size: 24px; 27 margin-bottom: 1em; 28} 29 30h3 { 31 font-size: 20px; 32 margin-bottom: 1em; 33 margin-top: 1em; 34} 35 36pre, code { 37 line-height: 1.5; 38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; 39} 40 41pre { 42 margin-top: 0.5em; 43} 44 45h1, h2, h3, p { 46 font-family: Arial, sans serif; 47} 48 49h1, h2, h3 { 50 border-bottom: solid #CCC 1px; 51} 52 53.toc_element { 54 margin-top: 0.5em; 55} 56 57.firstline { 58 margin-left: 2 em; 59} 60 61.method { 62 margin-top: 1em; 63 border: solid 1px #CCC; 64 padding: 1em; 65 background: #EEE; 66} 67 68.details { 69 font-weight: bold; 70 font-size: 14px; 71} 72 73</style> 74 75<h1><a href="appstate_v1.html">Google App State API</a> . <a href="appstate_v1.states.html">states</a></h1> 76<h2>Instance Methods</h2> 77<p class="toc_element"> 78 <code><a href="#clear">clear(stateKey, currentDataVersion=None)</a></code></p> 79<p class="firstline">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.</p> 80<p class="toc_element"> 81 <code><a href="#delete">delete(stateKey)</a></code></p> 82<p class="firstline">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.</p> 83<p class="toc_element"> 84 <code><a href="#get">get(stateKey)</a></code></p> 85<p class="firstline">Retrieves the data corresponding to the passed key. If the key does not exist on the server, an HTTP 404 will be returned.</p> 86<p class="toc_element"> 87 <code><a href="#list">list(includeData=None)</a></code></p> 88<p class="firstline">Lists all the states keys, and optionally the state data.</p> 89<p class="toc_element"> 90 <code><a href="#update">update(stateKey, body, currentStateVersion=None)</a></code></p> 91<p class="firstline">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.</p> 92<h3>Method Details</h3> 93<div class="method"> 94 <code class="details" id="clear">clear(stateKey, currentDataVersion=None)</code> 95 <pre>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. 96 97Args: 98 stateKey: integer, The key for the data to be retrieved. (required) 99 currentDataVersion: string, The version of the data to be cleared. Version strings are returned by the server. 100 101Returns: 102 An object of the form: 103 104 { # This is a JSON template for an app state write result. 105 "kind": "appstate#writeResult", # Uniquely identifies the type of this resource. Value is always the fixed string appstate#writeResult. 106 "stateKey": 42, # The written key. 107 "currentStateVersion": "A String", # The version of the data for this key on the server. 108 }</pre> 109</div> 110 111<div class="method"> 112 <code class="details" id="delete">delete(stateKey)</code> 113 <pre>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. 114 115Args: 116 stateKey: integer, The key for the data to be retrieved. (required) 117</pre> 118</div> 119 120<div class="method"> 121 <code class="details" id="get">get(stateKey)</code> 122 <pre>Retrieves the data corresponding to the passed key. If the key does not exist on the server, an HTTP 404 will be returned. 123 124Args: 125 stateKey: integer, The key for the data to be retrieved. (required) 126 127Returns: 128 An object of the form: 129 130 { # This is a JSON template for an app state resource. 131 "stateKey": 42, # The key for the data. 132 "kind": "appstate#getResponse", # Uniquely identifies the type of this resource. Value is always the fixed string appstate#getResponse. 133 "data": "A String", # The requested data. 134 "currentStateVersion": "A String", # The current app state version. 135 }</pre> 136</div> 137 138<div class="method"> 139 <code class="details" id="list">list(includeData=None)</code> 140 <pre>Lists all the states keys, and optionally the state data. 141 142Args: 143 includeData: boolean, Whether to include the full data in addition to the version number 144 145Returns: 146 An object of the form: 147 148 { # This is a JSON template to convert a list-response for app state. 149 "items": [ # The app state data. 150 { # This is a JSON template for an app state resource. 151 "stateKey": 42, # The key for the data. 152 "kind": "appstate#getResponse", # Uniquely identifies the type of this resource. Value is always the fixed string appstate#getResponse. 153 "data": "A String", # The requested data. 154 "currentStateVersion": "A String", # The current app state version. 155 }, 156 ], 157 "kind": "appstate#listResponse", # Uniquely identifies the type of this resource. Value is always the fixed string appstate#listResponse. 158 "maximumKeyCount": 42, # The maximum number of keys allowed for this user. 159 }</pre> 160</div> 161 162<div class="method"> 163 <code class="details" id="update">update(stateKey, body, currentStateVersion=None)</code> 164 <pre>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. 165 166Args: 167 stateKey: integer, The key for the data to be retrieved. (required) 168 body: object, The request body. (required) 169 The object takes the form of: 170 171{ # This is a JSON template for a requests which update app state 172 "kind": "appstate#updateRequest", # Uniquely identifies the type of this resource. Value is always the fixed string appstate#updateRequest. 173 "data": "A String", # The new app state data that your application is trying to update with. 174 } 175 176 currentStateVersion: 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. 177 178Returns: 179 An object of the form: 180 181 { # This is a JSON template for an app state write result. 182 "kind": "appstate#writeResult", # Uniquely identifies the type of this resource. Value is always the fixed string appstate#writeResult. 183 "stateKey": 42, # The written key. 184 "currentStateVersion": "A String", # The version of the data for this key on the server. 185 }</pre> 186</div> 187 188</body></html>