Remove OAuth 1.0 support.
Reviewed in http://codereview.appspot.com/6063052/
This commit is contained in:
2
Makefile
2
Makefile
@@ -19,7 +19,7 @@ coverage:
|
||||
docs:
|
||||
cd docs; ./build.sh
|
||||
python describe.py
|
||||
python samples-index.py ../google-api-python-client.wiki/SampleApps.wiki
|
||||
python samples-index.py > ../google-api-python-client.wiki/SampleApps.wiki
|
||||
|
||||
.PHONY: wiki
|
||||
wiki:
|
||||
|
||||
@@ -1,135 +0,0 @@
|
||||
# Copyright (C) 2010 Google Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
"""Utilities for Google App Engine
|
||||
|
||||
Utilities for making it easier to use the
|
||||
Google API Client for Python on Google App Engine.
|
||||
"""
|
||||
|
||||
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
|
||||
|
||||
import pickle
|
||||
|
||||
from google.appengine.ext import db
|
||||
from apiclient.oauth import OAuthCredentials
|
||||
from apiclient.oauth import FlowThreeLegged
|
||||
|
||||
|
||||
class FlowThreeLeggedProperty(db.Property):
|
||||
"""Utility property that allows easy
|
||||
storage and retreival of an
|
||||
apiclient.oauth.FlowThreeLegged"""
|
||||
|
||||
# Tell what the user type is.
|
||||
data_type = FlowThreeLegged
|
||||
|
||||
# For writing to datastore.
|
||||
def get_value_for_datastore(self, model_instance):
|
||||
flow = super(FlowThreeLeggedProperty,
|
||||
self).get_value_for_datastore(model_instance)
|
||||
return db.Blob(pickle.dumps(flow))
|
||||
|
||||
# For reading from datastore.
|
||||
def make_value_from_datastore(self, value):
|
||||
if value is None:
|
||||
return None
|
||||
return pickle.loads(value)
|
||||
|
||||
def validate(self, value):
|
||||
if value is not None and not isinstance(value, FlowThreeLegged):
|
||||
raise BadValueError('Property %s must be convertible '
|
||||
'to a FlowThreeLegged instance (%s)' %
|
||||
(self.name, value))
|
||||
return super(FlowThreeLeggedProperty, self).validate(value)
|
||||
|
||||
def empty(self, value):
|
||||
return not value
|
||||
|
||||
|
||||
class OAuthCredentialsProperty(db.Property):
|
||||
"""Utility property that allows easy
|
||||
storage and retrieval of
|
||||
apiclient.oath.OAuthCredentials
|
||||
"""
|
||||
|
||||
# Tell what the user type is.
|
||||
data_type = OAuthCredentials
|
||||
|
||||
# For writing to datastore.
|
||||
def get_value_for_datastore(self, model_instance):
|
||||
cred = super(OAuthCredentialsProperty,
|
||||
self).get_value_for_datastore(model_instance)
|
||||
return db.Blob(pickle.dumps(cred))
|
||||
|
||||
# For reading from datastore.
|
||||
def make_value_from_datastore(self, value):
|
||||
if value is None:
|
||||
return None
|
||||
return pickle.loads(value)
|
||||
|
||||
def validate(self, value):
|
||||
if value is not None and not isinstance(value, OAuthCredentials):
|
||||
raise BadValueError('Property %s must be convertible '
|
||||
'to an OAuthCredentials instance (%s)' %
|
||||
(self.name, value))
|
||||
return super(OAuthCredentialsProperty, self).validate(value)
|
||||
|
||||
def empty(self, value):
|
||||
return not value
|
||||
|
||||
|
||||
class StorageByKeyName(object):
|
||||
"""Store and retrieve a single credential to and from
|
||||
the App Engine datastore.
|
||||
|
||||
This Storage helper presumes the Credentials
|
||||
have been stored as a CredenialsProperty
|
||||
on a datastore model class, and that entities
|
||||
are stored by key_name.
|
||||
"""
|
||||
|
||||
def __init__(self, model, key_name, property_name):
|
||||
"""Constructor for Storage.
|
||||
|
||||
Args:
|
||||
model: db.Model, model class
|
||||
key_name: string, key name for the entity that has the credentials
|
||||
property_name: string, name of the property that is a CredentialsProperty
|
||||
"""
|
||||
self.model = model
|
||||
self.key_name = key_name
|
||||
self.property_name = property_name
|
||||
|
||||
def get(self):
|
||||
"""Retrieve Credential from datastore.
|
||||
|
||||
Returns:
|
||||
Credentials
|
||||
"""
|
||||
entity = self.model.get_or_insert(self.key_name)
|
||||
credential = getattr(entity, self.property_name)
|
||||
if credential and hasattr(credential, 'set_store'):
|
||||
credential.set_store(self.put)
|
||||
return credential
|
||||
|
||||
def put(self, credentials):
|
||||
"""Write a Credentials to the datastore.
|
||||
|
||||
Args:
|
||||
credentials: Credentials, the credentials to store.
|
||||
"""
|
||||
entity = self.model.get_or_insert(self.key_name)
|
||||
setattr(entity, self.property_name, credentials)
|
||||
entity.put()
|
||||
@@ -1,159 +0,0 @@
|
||||
# Copyright (C) 2010 Google Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
"""Command-line tools for authenticating via OAuth 1.0
|
||||
|
||||
Do the OAuth 1.0 Three Legged Dance for
|
||||
a command line application. Stores the generated
|
||||
credentials in a common file that is used by
|
||||
other example apps in the same directory.
|
||||
"""
|
||||
|
||||
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
|
||||
__all__ = ["run"]
|
||||
|
||||
import BaseHTTPServer
|
||||
import gflags
|
||||
import logging
|
||||
import socket
|
||||
import sys
|
||||
|
||||
from optparse import OptionParser
|
||||
from apiclient.oauth import RequestError
|
||||
|
||||
try:
|
||||
from urlparse import parse_qsl
|
||||
except ImportError:
|
||||
from cgi import parse_qsl
|
||||
|
||||
|
||||
FLAGS = gflags.FLAGS
|
||||
|
||||
gflags.DEFINE_boolean('auth_local_webserver', True,
|
||||
('Run a local web server to handle redirects during '
|
||||
'OAuth authorization.'))
|
||||
|
||||
gflags.DEFINE_string('auth_host_name', 'localhost',
|
||||
('Host name to use when running a local web server to '
|
||||
'handle redirects during OAuth authorization.'))
|
||||
|
||||
gflags.DEFINE_multi_int('auth_host_port', [8080, 8090],
|
||||
('Port to use when running a local web server to '
|
||||
'handle redirects during OAuth authorization.'))
|
||||
|
||||
|
||||
class ClientRedirectServer(BaseHTTPServer.HTTPServer):
|
||||
"""A server to handle OAuth 1.0 redirects back to localhost.
|
||||
|
||||
Waits for a single request and parses the query parameters
|
||||
into query_params and then stops serving.
|
||||
"""
|
||||
query_params = {}
|
||||
|
||||
|
||||
class ClientRedirectHandler(BaseHTTPServer.BaseHTTPRequestHandler):
|
||||
"""A handler for OAuth 1.0 redirects back to localhost.
|
||||
|
||||
Waits for a single request and parses the query parameters
|
||||
into the servers query_params and then stops serving.
|
||||
"""
|
||||
|
||||
def do_GET(s):
|
||||
"""Handle a GET request
|
||||
|
||||
Parses the query parameters and prints a message
|
||||
if the flow has completed. Note that we can't detect
|
||||
if an error occurred.
|
||||
"""
|
||||
s.send_response(200)
|
||||
s.send_header("Content-type", "text/html")
|
||||
s.end_headers()
|
||||
query = s.path.split('?', 1)[-1]
|
||||
query = dict(parse_qsl(query))
|
||||
s.server.query_params = query
|
||||
s.wfile.write("<html><head><title>Authentication Status</title></head>")
|
||||
s.wfile.write("<body><p>The authentication flow has completed.</p>")
|
||||
s.wfile.write("</body></html>")
|
||||
|
||||
def log_message(self, format, *args):
|
||||
"""Do not log messages to stdout while running as command line program."""
|
||||
pass
|
||||
|
||||
|
||||
def run(flow, storage):
|
||||
"""Core code for a command-line application.
|
||||
|
||||
Args:
|
||||
flow: Flow, an OAuth 1.0 Flow to step through.
|
||||
storage: Storage, a Storage to store the credential in.
|
||||
|
||||
Returns:
|
||||
Credentials, the obtained credential.
|
||||
|
||||
Exceptions:
|
||||
RequestError: if step2 of the flow fails.
|
||||
Args:
|
||||
"""
|
||||
|
||||
if FLAGS.auth_local_webserver:
|
||||
success = False
|
||||
port_number = 0
|
||||
for port in FLAGS.auth_host_port:
|
||||
port_number = port
|
||||
try:
|
||||
httpd = BaseHTTPServer.HTTPServer((FLAGS.auth_host_name, port),
|
||||
ClientRedirectHandler)
|
||||
except socket.error, e:
|
||||
pass
|
||||
else:
|
||||
success = True
|
||||
break
|
||||
FLAGS.auth_local_webserver = success
|
||||
|
||||
if FLAGS.auth_local_webserver:
|
||||
oauth_callback = 'http://%s:%s/' % (FLAGS.auth_host_name, port_number)
|
||||
else:
|
||||
oauth_callback = 'oob'
|
||||
authorize_url = flow.step1_get_authorize_url(oauth_callback)
|
||||
|
||||
print 'Go to the following link in your browser:'
|
||||
print authorize_url
|
||||
print
|
||||
if FLAGS.auth_local_webserver:
|
||||
print 'If your browser is on a different machine then exit and re-run this'
|
||||
print 'application with the command-line parameter --noauth_local_webserver.'
|
||||
print
|
||||
|
||||
if FLAGS.auth_local_webserver:
|
||||
httpd.handle_request()
|
||||
if 'error' in httpd.query_params:
|
||||
sys.exit('Authentication request was rejected.')
|
||||
if 'oauth_verifier' in httpd.query_params:
|
||||
code = httpd.query_params['oauth_verifier']
|
||||
else:
|
||||
accepted = 'n'
|
||||
while accepted.lower() == 'n':
|
||||
accepted = raw_input('Have you authorized me? (y/n) ')
|
||||
code = raw_input('What is the verification code? ').strip()
|
||||
|
||||
try:
|
||||
credentials = flow.step2_exchange(code)
|
||||
except RequestError:
|
||||
sys.exit('The authentication has failed.')
|
||||
|
||||
storage.put(credentials)
|
||||
credentials.set_store(storage.put)
|
||||
print "You have successfully authenticated."
|
||||
|
||||
return credentials
|
||||
@@ -1,56 +0,0 @@
|
||||
# Copyright (C) 2010 Google Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import apiclient
|
||||
import base64
|
||||
import pickle
|
||||
|
||||
from django.db import models
|
||||
|
||||
|
||||
class OAuthCredentialsField(models.Field):
|
||||
|
||||
__metaclass__ = models.SubfieldBase
|
||||
|
||||
def db_type(self):
|
||||
return 'VARCHAR'
|
||||
|
||||
def to_python(self, value):
|
||||
if value is None:
|
||||
return None
|
||||
if isinstance(value, apiclient.oauth.Credentials):
|
||||
return value
|
||||
return pickle.loads(base64.b64decode(value))
|
||||
|
||||
def get_db_prep_value(self, value):
|
||||
return base64.b64encode(pickle.dumps(value))
|
||||
|
||||
|
||||
class FlowThreeLeggedField(models.Field):
|
||||
|
||||
__metaclass__ = models.SubfieldBase
|
||||
|
||||
def db_type(self):
|
||||
return 'VARCHAR'
|
||||
|
||||
def to_python(self, value):
|
||||
print "In to_python", value
|
||||
if value is None:
|
||||
return None
|
||||
if isinstance(value, apiclient.oauth.FlowThreeLegged):
|
||||
return value
|
||||
return pickle.loads(base64.b64decode(value))
|
||||
|
||||
def get_db_prep_value(self, value):
|
||||
return base64.b64encode(pickle.dumps(value))
|
||||
@@ -1,63 +0,0 @@
|
||||
# Copyright (C) 2010 Google Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
"""Utilities for OAuth.
|
||||
|
||||
Utilities for making it easier to work with OAuth 1.0 credentials.
|
||||
"""
|
||||
|
||||
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
|
||||
|
||||
import pickle
|
||||
import threading
|
||||
|
||||
from apiclient.oauth import Storage as BaseStorage
|
||||
|
||||
|
||||
class Storage(BaseStorage):
|
||||
"""Store and retrieve a single credential to and from a file."""
|
||||
|
||||
def __init__(self, filename):
|
||||
self._filename = filename
|
||||
self._lock = threading.Lock()
|
||||
|
||||
def get(self):
|
||||
"""Retrieve Credential from file.
|
||||
|
||||
Returns:
|
||||
apiclient.oauth.Credentials
|
||||
"""
|
||||
self._lock.acquire()
|
||||
try:
|
||||
f = open(self._filename, 'r')
|
||||
credentials = pickle.loads(f.read())
|
||||
f.close()
|
||||
credentials.set_store(self.put)
|
||||
except:
|
||||
credentials = None
|
||||
self._lock.release()
|
||||
|
||||
return credentials
|
||||
|
||||
def put(self, credentials):
|
||||
"""Write a pickled Credentials to file.
|
||||
|
||||
Args:
|
||||
credentials: Credentials, the credentials to store.
|
||||
"""
|
||||
self._lock.acquire()
|
||||
f = open(self._filename, 'w')
|
||||
f.write(pickle.dumps(credentials))
|
||||
f.close()
|
||||
self._lock.release()
|
||||
@@ -1,443 +0,0 @@
|
||||
# Copyright (C) 2010 Google Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
"""Utilities for OAuth.
|
||||
|
||||
Utilities for making it easier to work with OAuth.
|
||||
"""
|
||||
|
||||
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
|
||||
|
||||
|
||||
import copy
|
||||
import httplib2
|
||||
import logging
|
||||
import oauth2 as oauth
|
||||
import urllib
|
||||
import urlparse
|
||||
|
||||
from oauth2client.anyjson import simplejson
|
||||
from oauth2client.client import Credentials
|
||||
from oauth2client.client import Flow
|
||||
from oauth2client.client import Storage
|
||||
|
||||
try:
|
||||
from urlparse import parse_qsl
|
||||
except ImportError:
|
||||
from cgi import parse_qsl
|
||||
|
||||
|
||||
class Error(Exception):
|
||||
"""Base error for this module."""
|
||||
pass
|
||||
|
||||
|
||||
class RequestError(Error):
|
||||
"""Error occurred during request."""
|
||||
pass
|
||||
|
||||
|
||||
class MissingParameter(Error):
|
||||
pass
|
||||
|
||||
|
||||
class CredentialsInvalidError(Error):
|
||||
pass
|
||||
|
||||
|
||||
def _abstract():
|
||||
raise NotImplementedError('You need to override this function')
|
||||
|
||||
|
||||
def _oauth_uri(name, discovery, params):
|
||||
"""Look up the OAuth URI from the discovery
|
||||
document and add query parameters based on
|
||||
params.
|
||||
|
||||
name - The name of the OAuth URI to lookup, one
|
||||
of 'request', 'access', or 'authorize'.
|
||||
discovery - Portion of discovery document the describes
|
||||
the OAuth endpoints.
|
||||
params - Dictionary that is used to form the query parameters
|
||||
for the specified URI.
|
||||
"""
|
||||
if name not in ['request', 'access', 'authorize']:
|
||||
raise KeyError(name)
|
||||
keys = discovery[name]['parameters'].keys()
|
||||
query = {}
|
||||
for key in keys:
|
||||
if key in params:
|
||||
query[key] = params[key]
|
||||
return discovery[name]['url'] + '?' + urllib.urlencode(query)
|
||||
|
||||
|
||||
|
||||
class OAuthCredentials(Credentials):
|
||||
"""Credentials object for OAuth 1.0a
|
||||
"""
|
||||
|
||||
def __init__(self, consumer, token, user_agent):
|
||||
"""
|
||||
consumer - An instance of oauth.Consumer.
|
||||
token - An instance of oauth.Token constructed with
|
||||
the access token and secret.
|
||||
user_agent - The HTTP User-Agent to provide for this application.
|
||||
"""
|
||||
self.consumer = consumer
|
||||
self.token = token
|
||||
self.user_agent = user_agent
|
||||
self.store = None
|
||||
|
||||
# True if the credentials have been revoked
|
||||
self._invalid = False
|
||||
|
||||
@property
|
||||
def invalid(self):
|
||||
"""True if the credentials are invalid, such as being revoked."""
|
||||
return getattr(self, "_invalid", False)
|
||||
|
||||
def set_store(self, store):
|
||||
"""Set the storage for the credential.
|
||||
|
||||
Args:
|
||||
store: callable, a callable that when passed a Credential
|
||||
will store the credential back to where it came from.
|
||||
This is needed to store the latest access_token if it
|
||||
has been revoked.
|
||||
"""
|
||||
self.store = store
|
||||
|
||||
def __getstate__(self):
|
||||
"""Trim the state down to something that can be pickled."""
|
||||
d = copy.copy(self.__dict__)
|
||||
del d['store']
|
||||
return d
|
||||
|
||||
def __setstate__(self, state):
|
||||
"""Reconstitute the state of the object from being pickled."""
|
||||
self.__dict__.update(state)
|
||||
self.store = None
|
||||
|
||||
def authorize(self, http):
|
||||
"""Authorize an httplib2.Http instance with these Credentials
|
||||
|
||||
Args:
|
||||
http - An instance of httplib2.Http
|
||||
or something that acts like it.
|
||||
|
||||
Returns:
|
||||
A modified instance of http that was passed in.
|
||||
|
||||
Example:
|
||||
|
||||
h = httplib2.Http()
|
||||
h = credentials.authorize(h)
|
||||
|
||||
You can't create a new OAuth
|
||||
subclass of httplib2.Authenication because
|
||||
it never gets passed the absolute URI, which is
|
||||
needed for signing. So instead we have to overload
|
||||
'request' with a closure that adds in the
|
||||
Authorization header and then calls the original version
|
||||
of 'request()'.
|
||||
"""
|
||||
request_orig = http.request
|
||||
signer = oauth.SignatureMethod_HMAC_SHA1()
|
||||
|
||||
# The closure that will replace 'httplib2.Http.request'.
|
||||
def new_request(uri, method='GET', body=None, headers=None,
|
||||
redirections=httplib2.DEFAULT_MAX_REDIRECTS,
|
||||
connection_type=None):
|
||||
"""Modify the request headers to add the appropriate
|
||||
Authorization header."""
|
||||
response_code = 302
|
||||
http.follow_redirects = False
|
||||
while response_code in [301, 302]:
|
||||
req = oauth.Request.from_consumer_and_token(
|
||||
self.consumer, self.token, http_method=method, http_url=uri)
|
||||
req.sign_request(signer, self.consumer, self.token)
|
||||
if headers is None:
|
||||
headers = {}
|
||||
headers.update(req.to_header())
|
||||
if 'user-agent' in headers:
|
||||
headers['user-agent'] = self.user_agent + ' ' + headers['user-agent']
|
||||
else:
|
||||
headers['user-agent'] = self.user_agent
|
||||
|
||||
resp, content = request_orig(uri, method, body, headers,
|
||||
redirections, connection_type)
|
||||
response_code = resp.status
|
||||
if response_code in [301, 302]:
|
||||
uri = resp['location']
|
||||
|
||||
# Update the stored credential if it becomes invalid.
|
||||
if response_code == 401:
|
||||
logging.info('Access token no longer valid: %s' % content)
|
||||
self._invalid = True
|
||||
if self.store is not None:
|
||||
self.store(self)
|
||||
raise CredentialsInvalidError("Credentials are no longer valid.")
|
||||
|
||||
return resp, content
|
||||
|
||||
http.request = new_request
|
||||
return http
|
||||
|
||||
|
||||
class TwoLeggedOAuthCredentials(Credentials):
|
||||
"""Two Legged Credentials object for OAuth 1.0a.
|
||||
|
||||
The Two Legged object is created directly, not from a flow. Once you
|
||||
authorize and httplib2.Http instance you can change the requestor and that
|
||||
change will propogate to the authorized httplib2.Http instance. For example:
|
||||
|
||||
http = httplib2.Http()
|
||||
http = credentials.authorize(http)
|
||||
|
||||
credentials.requestor = 'foo@example.info'
|
||||
http.request(...)
|
||||
credentials.requestor = 'bar@example.info'
|
||||
http.request(...)
|
||||
"""
|
||||
|
||||
def __init__(self, consumer_key, consumer_secret, user_agent):
|
||||
"""
|
||||
Args:
|
||||
consumer_key: string, An OAuth 1.0 consumer key
|
||||
consumer_secret: string, An OAuth 1.0 consumer secret
|
||||
user_agent: string, The HTTP User-Agent to provide for this application.
|
||||
"""
|
||||
self.consumer = oauth.Consumer(consumer_key, consumer_secret)
|
||||
self.user_agent = user_agent
|
||||
self.store = None
|
||||
|
||||
# email address of the user to act on the behalf of.
|
||||
self._requestor = None
|
||||
|
||||
@property
|
||||
def invalid(self):
|
||||
"""True if the credentials are invalid, such as being revoked.
|
||||
|
||||
Always returns False for Two Legged Credentials.
|
||||
"""
|
||||
return False
|
||||
|
||||
def getrequestor(self):
|
||||
return self._requestor
|
||||
|
||||
def setrequestor(self, email):
|
||||
self._requestor = email
|
||||
|
||||
requestor = property(getrequestor, setrequestor, None,
|
||||
'The email address of the user to act on behalf of')
|
||||
|
||||
def set_store(self, store):
|
||||
"""Set the storage for the credential.
|
||||
|
||||
Args:
|
||||
store: callable, a callable that when passed a Credential
|
||||
will store the credential back to where it came from.
|
||||
This is needed to store the latest access_token if it
|
||||
has been revoked.
|
||||
"""
|
||||
self.store = store
|
||||
|
||||
def __getstate__(self):
|
||||
"""Trim the state down to something that can be pickled."""
|
||||
d = copy.copy(self.__dict__)
|
||||
del d['store']
|
||||
return d
|
||||
|
||||
def __setstate__(self, state):
|
||||
"""Reconstitute the state of the object from being pickled."""
|
||||
self.__dict__.update(state)
|
||||
self.store = None
|
||||
|
||||
def authorize(self, http):
|
||||
"""Authorize an httplib2.Http instance with these Credentials
|
||||
|
||||
Args:
|
||||
http - An instance of httplib2.Http
|
||||
or something that acts like it.
|
||||
|
||||
Returns:
|
||||
A modified instance of http that was passed in.
|
||||
|
||||
Example:
|
||||
|
||||
h = httplib2.Http()
|
||||
h = credentials.authorize(h)
|
||||
|
||||
You can't create a new OAuth
|
||||
subclass of httplib2.Authenication because
|
||||
it never gets passed the absolute URI, which is
|
||||
needed for signing. So instead we have to overload
|
||||
'request' with a closure that adds in the
|
||||
Authorization header and then calls the original version
|
||||
of 'request()'.
|
||||
"""
|
||||
request_orig = http.request
|
||||
signer = oauth.SignatureMethod_HMAC_SHA1()
|
||||
|
||||
# The closure that will replace 'httplib2.Http.request'.
|
||||
def new_request(uri, method='GET', body=None, headers=None,
|
||||
redirections=httplib2.DEFAULT_MAX_REDIRECTS,
|
||||
connection_type=None):
|
||||
"""Modify the request headers to add the appropriate
|
||||
Authorization header."""
|
||||
response_code = 302
|
||||
http.follow_redirects = False
|
||||
while response_code in [301, 302]:
|
||||
# add in xoauth_requestor_id=self._requestor to the uri
|
||||
if self._requestor is None:
|
||||
raise MissingParameter(
|
||||
'Requestor must be set before using TwoLeggedOAuthCredentials')
|
||||
parsed = list(urlparse.urlparse(uri))
|
||||
q = parse_qsl(parsed[4])
|
||||
q.append(('xoauth_requestor_id', self._requestor))
|
||||
parsed[4] = urllib.urlencode(q)
|
||||
uri = urlparse.urlunparse(parsed)
|
||||
|
||||
req = oauth.Request.from_consumer_and_token(
|
||||
self.consumer, None, http_method=method, http_url=uri)
|
||||
req.sign_request(signer, self.consumer, None)
|
||||
if headers is None:
|
||||
headers = {}
|
||||
headers.update(req.to_header())
|
||||
if 'user-agent' in headers:
|
||||
headers['user-agent'] = self.user_agent + ' ' + headers['user-agent']
|
||||
else:
|
||||
headers['user-agent'] = self.user_agent
|
||||
resp, content = request_orig(uri, method, body, headers,
|
||||
redirections, connection_type)
|
||||
response_code = resp.status
|
||||
if response_code in [301, 302]:
|
||||
uri = resp['location']
|
||||
|
||||
if response_code == 401:
|
||||
logging.info('Access token no longer valid: %s' % content)
|
||||
# Do not store the invalid state of the Credentials because
|
||||
# being 2LO they could be reinstated in the future.
|
||||
raise CredentialsInvalidError("Credentials are invalid.")
|
||||
|
||||
return resp, content
|
||||
|
||||
http.request = new_request
|
||||
return http
|
||||
|
||||
|
||||
class FlowThreeLegged(Flow):
|
||||
"""Does the Three Legged Dance for OAuth 1.0a.
|
||||
"""
|
||||
|
||||
def __init__(self, discovery, consumer_key, consumer_secret, user_agent,
|
||||
**kwargs):
|
||||
"""
|
||||
discovery - Section of the API discovery document that describes
|
||||
the OAuth endpoints.
|
||||
consumer_key - OAuth consumer key
|
||||
consumer_secret - OAuth consumer secret
|
||||
user_agent - The HTTP User-Agent that identifies the application.
|
||||
**kwargs - The keyword arguments are all optional and required
|
||||
parameters for the OAuth calls.
|
||||
"""
|
||||
self.discovery = discovery
|
||||
self.consumer_key = consumer_key
|
||||
self.consumer_secret = consumer_secret
|
||||
self.user_agent = user_agent
|
||||
self.params = kwargs
|
||||
self.request_token = {}
|
||||
required = {}
|
||||
for uriinfo in discovery.itervalues():
|
||||
for name, value in uriinfo['parameters'].iteritems():
|
||||
if value['required'] and not name.startswith('oauth_'):
|
||||
required[name] = 1
|
||||
for key in required.iterkeys():
|
||||
if key not in self.params:
|
||||
raise MissingParameter('Required parameter %s not supplied' % key)
|
||||
|
||||
def step1_get_authorize_url(self, oauth_callback='oob'):
|
||||
"""Returns a URI to redirect to the provider.
|
||||
|
||||
oauth_callback - Either the string 'oob' for a non-web-based application,
|
||||
or a URI that handles the callback from the authorization
|
||||
server.
|
||||
|
||||
If oauth_callback is 'oob' then pass in the
|
||||
generated verification code to step2_exchange,
|
||||
otherwise pass in the query parameters received
|
||||
at the callback uri to step2_exchange.
|
||||
"""
|
||||
consumer = oauth.Consumer(self.consumer_key, self.consumer_secret)
|
||||
client = oauth.Client(consumer)
|
||||
|
||||
headers = {
|
||||
'user-agent': self.user_agent,
|
||||
'content-type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
body = urllib.urlencode({'oauth_callback': oauth_callback})
|
||||
uri = _oauth_uri('request', self.discovery, self.params)
|
||||
|
||||
resp, content = client.request(uri, 'POST', headers=headers,
|
||||
body=body)
|
||||
if resp['status'] != '200':
|
||||
logging.error('Failed to retrieve temporary authorization: %s', content)
|
||||
raise RequestError('Invalid response %s.' % resp['status'])
|
||||
|
||||
self.request_token = dict(parse_qsl(content))
|
||||
|
||||
auth_params = copy.copy(self.params)
|
||||
auth_params['oauth_token'] = self.request_token['oauth_token']
|
||||
|
||||
return _oauth_uri('authorize', self.discovery, auth_params)
|
||||
|
||||
def step2_exchange(self, verifier):
|
||||
"""Exhanges an authorized request token
|
||||
for OAuthCredentials.
|
||||
|
||||
Args:
|
||||
verifier: string, dict - either the verifier token, or a dictionary
|
||||
of the query parameters to the callback, which contains
|
||||
the oauth_verifier.
|
||||
Returns:
|
||||
The Credentials object.
|
||||
"""
|
||||
|
||||
if not (isinstance(verifier, str) or isinstance(verifier, unicode)):
|
||||
verifier = verifier['oauth_verifier']
|
||||
|
||||
token = oauth.Token(
|
||||
self.request_token['oauth_token'],
|
||||
self.request_token['oauth_token_secret'])
|
||||
token.set_verifier(verifier)
|
||||
consumer = oauth.Consumer(self.consumer_key, self.consumer_secret)
|
||||
client = oauth.Client(consumer, token)
|
||||
|
||||
headers = {
|
||||
'user-agent': self.user_agent,
|
||||
'content-type': 'application/x-www-form-urlencoded'
|
||||
}
|
||||
|
||||
uri = _oauth_uri('access', self.discovery, self.params)
|
||||
resp, content = client.request(uri, 'POST', headers=headers)
|
||||
if resp['status'] != '200':
|
||||
logging.error('Failed to retrieve access token: %s', content)
|
||||
raise RequestError('Invalid response %s.' % resp['status'])
|
||||
|
||||
oauth_params = dict(parse_qsl(content))
|
||||
token = oauth.Token(
|
||||
oauth_params['oauth_token'],
|
||||
oauth_params['oauth_token_secret'])
|
||||
|
||||
return OAuthCredentials(consumer, token, self.user_agent)
|
||||
@@ -42,7 +42,6 @@ SOURCES = [
|
||||
'gflags_validators',
|
||||
'httplib2',
|
||||
'oauth2client',
|
||||
'oauth2',
|
||||
'apiclient',
|
||||
'uritemplate',
|
||||
]
|
||||
|
||||
@@ -1,299 +0,0 @@
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html><head><title>Python: module apiclient.ext.appengine</title>
|
||||
</head><body bgcolor="#f0f0f8">
|
||||
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
|
||||
<tr bgcolor="#7799ee">
|
||||
<td valign=bottom> <br>
|
||||
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="apiclient.html"><font color="#ffffff">apiclient</font></a>.<a href="apiclient.ext.html"><font color="#ffffff">ext</font></a>.appengine</strong></big></big></font></td
|
||||
><td align=right valign=bottom
|
||||
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/usr/local/google/home/jcgregorio/projects/apiclient-release/apiclient/ext/appengine.py">/usr/local/google/home/jcgregorio/projects/apiclient-release/apiclient/ext/appengine.py</a></font></td></tr></table>
|
||||
<p><tt>Utilities for Google App Engine<br>
|
||||
<br>
|
||||
Utilities for making it easier to use the<br>
|
||||
Google API Client for Python on Google App Engine.</tt></p>
|
||||
<p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#aa55cc">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
|
||||
|
||||
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
|
||||
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="google.appengine.ext.db.html">google.appengine.ext.db</a><br>
|
||||
</td><td width="25%" valign=top><a href="pickle.html">pickle</a><br>
|
||||
</td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#ee77aa">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
|
||||
|
||||
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
|
||||
<td width="100%"><dl>
|
||||
<dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
|
||||
</font></dt><dd>
|
||||
<dl>
|
||||
<dt><font face="helvetica, arial"><a href="apiclient.ext.appengine.html#StorageByKeyName">StorageByKeyName</a>
|
||||
</font></dt></dl>
|
||||
</dd>
|
||||
<dt><font face="helvetica, arial"><a href="google.appengine.ext.db.html#Property">google.appengine.ext.db.Property</a>(<a href="__builtin__.html#object">__builtin__.object</a>)
|
||||
</font></dt><dd>
|
||||
<dl>
|
||||
<dt><font face="helvetica, arial"><a href="apiclient.ext.appengine.html#FlowThreeLeggedProperty">FlowThreeLeggedProperty</a>
|
||||
</font></dt><dt><font face="helvetica, arial"><a href="apiclient.ext.appengine.html#OAuthCredentialsProperty">OAuthCredentialsProperty</a>
|
||||
</font></dt></dl>
|
||||
</dd>
|
||||
</dl>
|
||||
<p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#ffc8d8">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#000000" face="helvetica, arial"><a name="FlowThreeLeggedProperty">class <strong>FlowThreeLeggedProperty</strong></a>(<a href="google.appengine.ext.db.html#Property">google.appengine.ext.db.Property</a>)</font></td></tr>
|
||||
|
||||
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
||||
<td colspan=2><tt>Utility property that allows easy<br>
|
||||
storage and retreival of an<br>
|
||||
apiclient.oauth.FlowThreeLegged<br> </tt></td></tr>
|
||||
<tr><td> </td>
|
||||
<td width="100%"><dl><dt>Method resolution order:</dt>
|
||||
<dd><a href="apiclient.ext.appengine.html#FlowThreeLeggedProperty">FlowThreeLeggedProperty</a></dd>
|
||||
<dd><a href="google.appengine.ext.db.html#Property">google.appengine.ext.db.Property</a></dd>
|
||||
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Methods defined here:<br>
|
||||
<dl><dt><a name="FlowThreeLeggedProperty-empty"><strong>empty</strong></a>(self, value)</dt></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLeggedProperty-get_value_for_datastore"><strong>get_value_for_datastore</strong></a>(self, model_instance)</dt><dd><tt># For writing to datastore.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLeggedProperty-make_value_from_datastore"><strong>make_value_from_datastore</strong></a>(self, value)</dt><dd><tt># For reading from datastore.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLeggedProperty-validate"><strong>validate</strong></a>(self, value)</dt></dl>
|
||||
|
||||
<hr>
|
||||
Data and other attributes defined here:<br>
|
||||
<dl><dt><strong>data_type</strong> = <class 'apiclient.oauth.FlowThreeLegged'><dd><tt>Does the Three Legged Dance for OAuth 1.0a.</tt></dl>
|
||||
|
||||
<hr>
|
||||
Methods inherited from <a href="google.appengine.ext.db.html#Property">google.appengine.ext.db.Property</a>:<br>
|
||||
<dl><dt><a name="FlowThreeLeggedProperty-__get__"><strong>__get__</strong></a>(self, model_instance, model_class)</dt><dd><tt>Returns the value for this property on the given model instance.<br>
|
||||
<br>
|
||||
See <a href="http://docs.python.org/ref/descriptors.html">http://docs.python.org/ref/descriptors.html</a> for a description of<br>
|
||||
the arguments to this class and what they mean.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLeggedProperty-__init__"><strong>__init__</strong></a>(self, verbose_name<font color="#909090">=None</font>, name<font color="#909090">=None</font>, default<font color="#909090">=None</font>, required<font color="#909090">=False</font>, validator<font color="#909090">=None</font>, choices<font color="#909090">=None</font>, indexed<font color="#909090">=True</font>)</dt><dd><tt>Initializes this <a href="google.appengine.ext.db.html#Property">Property</a> with the given options.<br>
|
||||
<br>
|
||||
Args:<br>
|
||||
verbose_name: User friendly name of property.<br>
|
||||
name: Storage name for property. By default, uses attribute name<br>
|
||||
as it is assigned in the Model sub-class.<br>
|
||||
default: Default value for property if none is assigned.<br>
|
||||
required: Whether property is required.<br>
|
||||
validator: User provided method used for validation.<br>
|
||||
choices: User provided set of valid property values.<br>
|
||||
indexed: Whether property is indexed.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLeggedProperty-__property_config__"><strong>__property_config__</strong></a>(self, model_class, property_name)</dt><dd><tt>Configure property, connecting it to its model.<br>
|
||||
<br>
|
||||
Configure the property so that it knows its property name and what class<br>
|
||||
it belongs to.<br>
|
||||
<br>
|
||||
Args:<br>
|
||||
model_class: Model class which <a href="google.appengine.ext.db.html#Property">Property</a> will belong to.<br>
|
||||
property_name: Name of property within Model instance to store property<br>
|
||||
values in. By default this will be the property name preceded by<br>
|
||||
an underscore, but may change for different subclasses.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLeggedProperty-__set__"><strong>__set__</strong></a>(self, model_instance, value)</dt><dd><tt>Sets the value for this property on the given model instance.<br>
|
||||
<br>
|
||||
See <a href="http://docs.python.org/ref/descriptors.html">http://docs.python.org/ref/descriptors.html</a> for a description of<br>
|
||||
the arguments to this class and what they mean.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLeggedProperty-datastore_type"><strong>datastore_type</strong></a>(self)</dt><dd><tt>Deprecated backwards-compatible accessor method for self.<strong>data_type</strong>.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLeggedProperty-default_value"><strong>default_value</strong></a>(self)</dt><dd><tt>Default value for unassigned values.<br>
|
||||
<br>
|
||||
Returns:<br>
|
||||
Default value as provided by <a href="#FlowThreeLeggedProperty-__init__">__init__</a>(default).</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLeggedProperty-get_updated_value_for_datastore"><strong>get_updated_value_for_datastore</strong></a>(self, model_instance)</dt><dd><tt>Determine new value for auto-updated property.<br>
|
||||
<br>
|
||||
Some properies (e.g. DateTimeProperty, UserProperty) optionally update their<br>
|
||||
value on every put(). This call must return the new desired value for such<br>
|
||||
properties. For all other properties, this call must return<br>
|
||||
AUTO_UPDATE_UNCHANGED.<br>
|
||||
<br>
|
||||
Args:<br>
|
||||
model_instance: Instance to get new value for.<br>
|
||||
<br>
|
||||
Returns:<br>
|
||||
Datastore representation of the new model value in a form that is<br>
|
||||
appropriate for storing in the datastore, or AUTO_UPDATE_UNCHANGED.</tt></dd></dl>
|
||||
|
||||
<hr>
|
||||
Data descriptors inherited from <a href="google.appengine.ext.db.html#Property">google.appengine.ext.db.Property</a>:<br>
|
||||
<dl><dt><strong>__dict__</strong></dt>
|
||||
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
|
||||
</dl>
|
||||
<dl><dt><strong>__weakref__</strong></dt>
|
||||
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Data and other attributes inherited from <a href="google.appengine.ext.db.html#Property">google.appengine.ext.db.Property</a>:<br>
|
||||
<dl><dt><strong>creation_counter</strong> = 0</dl>
|
||||
|
||||
</td></tr></table> <p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#ffc8d8">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#000000" face="helvetica, arial"><a name="OAuthCredentialsProperty">class <strong>OAuthCredentialsProperty</strong></a>(<a href="google.appengine.ext.db.html#Property">google.appengine.ext.db.Property</a>)</font></td></tr>
|
||||
|
||||
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
||||
<td colspan=2><tt>Utility property that allows easy<br>
|
||||
storage and retrieval of<br>
|
||||
apiclient.oath.OAuthCredentials<br> </tt></td></tr>
|
||||
<tr><td> </td>
|
||||
<td width="100%"><dl><dt>Method resolution order:</dt>
|
||||
<dd><a href="apiclient.ext.appengine.html#OAuthCredentialsProperty">OAuthCredentialsProperty</a></dd>
|
||||
<dd><a href="google.appengine.ext.db.html#Property">google.appengine.ext.db.Property</a></dd>
|
||||
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Methods defined here:<br>
|
||||
<dl><dt><a name="OAuthCredentialsProperty-empty"><strong>empty</strong></a>(self, value)</dt></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentialsProperty-get_value_for_datastore"><strong>get_value_for_datastore</strong></a>(self, model_instance)</dt><dd><tt># For writing to datastore.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentialsProperty-make_value_from_datastore"><strong>make_value_from_datastore</strong></a>(self, value)</dt><dd><tt># For reading from datastore.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentialsProperty-validate"><strong>validate</strong></a>(self, value)</dt></dl>
|
||||
|
||||
<hr>
|
||||
Data and other attributes defined here:<br>
|
||||
<dl><dt><strong>data_type</strong> = <class 'apiclient.oauth.OAuthCredentials'><dd><tt>Credentials <a href="__builtin__.html#object">object</a> for OAuth 1.0a</tt></dl>
|
||||
|
||||
<hr>
|
||||
Methods inherited from <a href="google.appengine.ext.db.html#Property">google.appengine.ext.db.Property</a>:<br>
|
||||
<dl><dt><a name="OAuthCredentialsProperty-__get__"><strong>__get__</strong></a>(self, model_instance, model_class)</dt><dd><tt>Returns the value for this property on the given model instance.<br>
|
||||
<br>
|
||||
See <a href="http://docs.python.org/ref/descriptors.html">http://docs.python.org/ref/descriptors.html</a> for a description of<br>
|
||||
the arguments to this class and what they mean.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentialsProperty-__init__"><strong>__init__</strong></a>(self, verbose_name<font color="#909090">=None</font>, name<font color="#909090">=None</font>, default<font color="#909090">=None</font>, required<font color="#909090">=False</font>, validator<font color="#909090">=None</font>, choices<font color="#909090">=None</font>, indexed<font color="#909090">=True</font>)</dt><dd><tt>Initializes this <a href="google.appengine.ext.db.html#Property">Property</a> with the given options.<br>
|
||||
<br>
|
||||
Args:<br>
|
||||
verbose_name: User friendly name of property.<br>
|
||||
name: Storage name for property. By default, uses attribute name<br>
|
||||
as it is assigned in the Model sub-class.<br>
|
||||
default: Default value for property if none is assigned.<br>
|
||||
required: Whether property is required.<br>
|
||||
validator: User provided method used for validation.<br>
|
||||
choices: User provided set of valid property values.<br>
|
||||
indexed: Whether property is indexed.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentialsProperty-__property_config__"><strong>__property_config__</strong></a>(self, model_class, property_name)</dt><dd><tt>Configure property, connecting it to its model.<br>
|
||||
<br>
|
||||
Configure the property so that it knows its property name and what class<br>
|
||||
it belongs to.<br>
|
||||
<br>
|
||||
Args:<br>
|
||||
model_class: Model class which <a href="google.appengine.ext.db.html#Property">Property</a> will belong to.<br>
|
||||
property_name: Name of property within Model instance to store property<br>
|
||||
values in. By default this will be the property name preceded by<br>
|
||||
an underscore, but may change for different subclasses.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentialsProperty-__set__"><strong>__set__</strong></a>(self, model_instance, value)</dt><dd><tt>Sets the value for this property on the given model instance.<br>
|
||||
<br>
|
||||
See <a href="http://docs.python.org/ref/descriptors.html">http://docs.python.org/ref/descriptors.html</a> for a description of<br>
|
||||
the arguments to this class and what they mean.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentialsProperty-datastore_type"><strong>datastore_type</strong></a>(self)</dt><dd><tt>Deprecated backwards-compatible accessor method for self.<strong>data_type</strong>.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentialsProperty-default_value"><strong>default_value</strong></a>(self)</dt><dd><tt>Default value for unassigned values.<br>
|
||||
<br>
|
||||
Returns:<br>
|
||||
Default value as provided by <a href="#OAuthCredentialsProperty-__init__">__init__</a>(default).</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentialsProperty-get_updated_value_for_datastore"><strong>get_updated_value_for_datastore</strong></a>(self, model_instance)</dt><dd><tt>Determine new value for auto-updated property.<br>
|
||||
<br>
|
||||
Some properies (e.g. DateTimeProperty, UserProperty) optionally update their<br>
|
||||
value on every put(). This call must return the new desired value for such<br>
|
||||
properties. For all other properties, this call must return<br>
|
||||
AUTO_UPDATE_UNCHANGED.<br>
|
||||
<br>
|
||||
Args:<br>
|
||||
model_instance: Instance to get new value for.<br>
|
||||
<br>
|
||||
Returns:<br>
|
||||
Datastore representation of the new model value in a form that is<br>
|
||||
appropriate for storing in the datastore, or AUTO_UPDATE_UNCHANGED.</tt></dd></dl>
|
||||
|
||||
<hr>
|
||||
Data descriptors inherited from <a href="google.appengine.ext.db.html#Property">google.appengine.ext.db.Property</a>:<br>
|
||||
<dl><dt><strong>__dict__</strong></dt>
|
||||
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
|
||||
</dl>
|
||||
<dl><dt><strong>__weakref__</strong></dt>
|
||||
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Data and other attributes inherited from <a href="google.appengine.ext.db.html#Property">google.appengine.ext.db.Property</a>:<br>
|
||||
<dl><dt><strong>creation_counter</strong> = 0</dl>
|
||||
|
||||
</td></tr></table> <p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#ffc8d8">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#000000" face="helvetica, arial"><a name="StorageByKeyName">class <strong>StorageByKeyName</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
|
||||
|
||||
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
||||
<td colspan=2><tt>Store and retrieve a single credential to and from<br>
|
||||
the App Engine datastore.<br>
|
||||
<br>
|
||||
This Storage helper presumes the Credentials<br>
|
||||
have been stored as a CredenialsProperty<br>
|
||||
on a datastore model class, and that entities<br>
|
||||
are stored by key_name.<br> </tt></td></tr>
|
||||
<tr><td> </td>
|
||||
<td width="100%">Methods defined here:<br>
|
||||
<dl><dt><a name="StorageByKeyName-__init__"><strong>__init__</strong></a>(self, model, key_name, property_name)</dt><dd><tt>Constructor for Storage.<br>
|
||||
<br>
|
||||
Args:<br>
|
||||
model: db.Model, model class<br>
|
||||
key_name: string, key name for the entity that has the credentials<br>
|
||||
property_name: string, name of the property that is a CredentialsProperty</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="StorageByKeyName-get"><strong>get</strong></a>(self)</dt><dd><tt>Retrieve Credential from datastore.<br>
|
||||
<br>
|
||||
Returns:<br>
|
||||
Credentials</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="StorageByKeyName-put"><strong>put</strong></a>(self, credentials)</dt><dd><tt>Write a Credentials to the datastore.<br>
|
||||
<br>
|
||||
Args:<br>
|
||||
credentials: Credentials, the credentials to store.</tt></dd></dl>
|
||||
|
||||
<hr>
|
||||
Data descriptors defined here:<br>
|
||||
<dl><dt><strong>__dict__</strong></dt>
|
||||
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
|
||||
</dl>
|
||||
<dl><dt><strong>__weakref__</strong></dt>
|
||||
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
||||
</dl>
|
||||
</td></tr></table></td></tr></table><p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#55aa55">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
|
||||
|
||||
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
|
||||
<td width="100%"><strong>__author__</strong> = 'jcgregorio@google.com (Joe Gregorio)'</td></tr></table><p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#7799ee">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr>
|
||||
|
||||
<tr><td bgcolor="#7799ee"><tt> </tt></td><td> </td>
|
||||
<td width="100%">jcgregorio@google.com (Joe Gregorio)</td></tr></table>
|
||||
</body></html>
|
||||
@@ -1,65 +0,0 @@
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html><head><title>Python: module apiclient.ext.authtools</title>
|
||||
</head><body bgcolor="#f0f0f8">
|
||||
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
|
||||
<tr bgcolor="#7799ee">
|
||||
<td valign=bottom> <br>
|
||||
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="apiclient.html"><font color="#ffffff">apiclient</font></a>.<a href="apiclient.ext.html"><font color="#ffffff">ext</font></a>.authtools</strong></big></big></font></td
|
||||
><td align=right valign=bottom
|
||||
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/usr/local/google/home/jcgregorio/projects/apiclient-release/apiclient/ext/authtools.py">/usr/local/google/home/jcgregorio/projects/apiclient-release/apiclient/ext/authtools.py</a></font></td></tr></table>
|
||||
<p><tt>Command-line tools for authenticating via OAuth 1.0<br>
|
||||
<br>
|
||||
Do the OAuth 1.0 Three Legged Dance for<br>
|
||||
a command line application. Stores the generated<br>
|
||||
credentials in a common file that is used by<br>
|
||||
other example apps in the same directory.</tt></p>
|
||||
<p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#aa55cc">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
|
||||
|
||||
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
|
||||
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="BaseHTTPServer.html">BaseHTTPServer</a><br>
|
||||
<a href="gflags.html">gflags</a><br>
|
||||
</td><td width="25%" valign=top><a href="logging.html">logging</a><br>
|
||||
<a href="socket.html">socket</a><br>
|
||||
</td><td width="25%" valign=top><a href="sys.html">sys</a><br>
|
||||
</td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#eeaa77">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
|
||||
|
||||
<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td>
|
||||
<td width="100%"><dl><dt><a name="-run"><strong>run</strong></a>(flow, storage)</dt><dd><tt>Core code for a command-line application.<br>
|
||||
<br>
|
||||
Args:<br>
|
||||
flow: Flow, an OAuth 1.0 Flow to step through.<br>
|
||||
storage: Storage, a Storage to store the credential in.<br>
|
||||
<br>
|
||||
Returns:<br>
|
||||
Credentials, the obtained credential.<br>
|
||||
<br>
|
||||
Exceptions:<br>
|
||||
RequestError: if step2 of the flow fails.<br>
|
||||
Args:</tt></dd></dl>
|
||||
</td></tr></table><p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#55aa55">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
|
||||
|
||||
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
|
||||
<td width="100%"><strong>__all__</strong> = ['run']<br>
|
||||
<strong>__author__</strong> = 'jcgregorio@google.com (Joe Gregorio)'</td></tr></table><p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#7799ee">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr>
|
||||
|
||||
<tr><td bgcolor="#7799ee"><tt> </tt></td><td> </td>
|
||||
<td width="100%">jcgregorio@google.com (Joe Gregorio)</td></tr></table>
|
||||
</body></html>
|
||||
@@ -1,249 +0,0 @@
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html><head><title>Python: module apiclient.ext.django_orm</title>
|
||||
</head><body bgcolor="#f0f0f8">
|
||||
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
|
||||
<tr bgcolor="#7799ee">
|
||||
<td valign=bottom> <br>
|
||||
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="apiclient.html"><font color="#ffffff">apiclient</font></a>.<a href="apiclient.ext.html"><font color="#ffffff">ext</font></a>.django_orm</strong></big></big></font></td
|
||||
><td align=right valign=bottom
|
||||
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/home/jcgregorio/projects/apiclient/apiclient/ext/django_orm.py">/home/jcgregorio/projects/apiclient/apiclient/ext/django_orm.py</a></font></td></tr></table>
|
||||
<p><tt># Copyright (C) 2010 Google Inc.<br>
|
||||
#<br>
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");<br>
|
||||
# you may not use this file except in compliance with the License.<br>
|
||||
# You may obtain a copy of the License at<br>
|
||||
#<br>
|
||||
# <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a><br>
|
||||
#<br>
|
||||
# Unless required by applicable law or agreed to in writing, software<br>
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,<br>
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<br>
|
||||
# See the License for the specific language governing permissions and<br>
|
||||
# limitations under the License.</tt></p>
|
||||
<p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#aa55cc">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
|
||||
|
||||
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
|
||||
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="apiclient.html">apiclient</a><br>
|
||||
</td><td width="25%" valign=top><a href="base64.html">base64</a><br>
|
||||
</td><td width="25%" valign=top><a href="django.db.models.html">django.db.models</a><br>
|
||||
</td><td width="25%" valign=top><a href="pickle.html">pickle</a><br>
|
||||
</td></tr></table></td></tr></table><p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#ee77aa">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
|
||||
|
||||
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
|
||||
<td width="100%"><dl>
|
||||
<dt><font face="helvetica, arial"><a href="django.db.models.fields.html#Field">django.db.models.fields.Field</a>(<a href="__builtin__.html#object">__builtin__.object</a>)
|
||||
</font></dt><dd>
|
||||
<dl>
|
||||
<dt><font face="helvetica, arial"><a href="apiclient.ext.django_orm.html#FlowThreeLeggedField">FlowThreeLeggedField</a>
|
||||
</font></dt><dt><font face="helvetica, arial"><a href="apiclient.ext.django_orm.html#OAuthCredentialsField">OAuthCredentialsField</a>
|
||||
</font></dt></dl>
|
||||
</dd>
|
||||
</dl>
|
||||
<p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#ffc8d8">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#000000" face="helvetica, arial"><a name="FlowThreeLeggedField">class <strong>FlowThreeLeggedField</strong></a>(<a href="django.db.models.fields.html#Field">django.db.models.fields.Field</a>)</font></td></tr>
|
||||
|
||||
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
|
||||
<td width="100%"><dl><dt>Method resolution order:</dt>
|
||||
<dd><a href="apiclient.ext.django_orm.html#FlowThreeLeggedField">FlowThreeLeggedField</a></dd>
|
||||
<dd><a href="django.db.models.fields.html#Field">django.db.models.fields.Field</a></dd>
|
||||
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Methods defined here:<br>
|
||||
<dl><dt><a name="FlowThreeLeggedField-contribute_to_class"><strong>contribute_to_class</strong></a>(self, cls, name)</dt></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLeggedField-db_type"><strong>db_type</strong></a>(self)</dt></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLeggedField-get_db_prep_value"><strong>get_db_prep_value</strong></a>(self, value)</dt></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLeggedField-to_python"><strong>to_python</strong></a>(self, value)</dt></dl>
|
||||
|
||||
<hr>
|
||||
Data and other attributes defined here:<br>
|
||||
<dl><dt><strong>__metaclass__</strong> = <class 'django.db.models.fields.subclassing.SubfieldBase'><dd><tt>A metaclass for custom <a href="django.db.models.fields.html#Field">Field</a> subclasses. This ensures the model's attribute<br>
|
||||
has the descriptor protocol attached to it.</tt></dl>
|
||||
|
||||
<hr>
|
||||
Methods inherited from <a href="django.db.models.fields.html#Field">django.db.models.fields.Field</a>:<br>
|
||||
<dl><dt><a name="FlowThreeLeggedField-__cmp__"><strong>__cmp__</strong></a>(self, other)</dt></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLeggedField-__deepcopy__"><strong>__deepcopy__</strong></a>(self, memodict)</dt></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLeggedField-__init__"><strong>__init__</strong></a>(self, verbose_name<font color="#909090">=None</font>, name<font color="#909090">=None</font>, primary_key<font color="#909090">=False</font>, max_length<font color="#909090">=None</font>, unique<font color="#909090">=False</font>, blank<font color="#909090">=False</font>, null<font color="#909090">=False</font>, db_index<font color="#909090">=False</font>, rel<font color="#909090">=None</font>, default<font color="#909090">=<class django.db.models.fields.NOT_PROVIDED></font>, editable<font color="#909090">=True</font>, serialize<font color="#909090">=True</font>, unique_for_date<font color="#909090">=None</font>, unique_for_month<font color="#909090">=None</font>, unique_for_year<font color="#909090">=None</font>, choices<font color="#909090">=None</font>, help_text<font color="#909090">=''</font>, db_column<font color="#909090">=None</font>, db_tablespace<font color="#909090">=None</font>, auto_created<font color="#909090">=False</font>)</dt></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLeggedField-bind"><strong>bind</strong></a>(self, fieldmapping, original, bound_field_class)</dt></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLeggedField-formfield"><strong>formfield</strong></a>(self, form_class<font color="#909090">=<class 'django.forms.fields.CharField'></font>, **kwargs)</dt><dd><tt>Returns a django.forms.<a href="django.db.models.fields.html#Field">Field</a> instance for this database <a href="django.db.models.fields.html#Field">Field</a>.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLeggedField-get_attname"><strong>get_attname</strong></a>(self)</dt></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLeggedField-get_attname_column"><strong>get_attname_column</strong></a>(self)</dt></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLeggedField-get_cache_name"><strong>get_cache_name</strong></a>(self)</dt></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLeggedField-get_choices"><strong>get_choices</strong></a>(self, include_blank<font color="#909090">=True</font>, blank_choice<font color="#909090">=[('', '---------')]</font>)</dt><dd><tt>Returns choices with a default blank choices included, for use<br>
|
||||
as SelectField choices for this field.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLeggedField-get_choices_default"><strong>get_choices_default</strong></a>(self)</dt></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLeggedField-get_db_prep_lookup"><strong>get_db_prep_lookup</strong></a>(self, lookup_type, value)</dt><dd><tt>Returns field's value prepared for database lookup.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLeggedField-get_db_prep_save"><strong>get_db_prep_save</strong></a>(self, value)</dt><dd><tt>Returns field's value prepared for saving into a database.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLeggedField-get_default"><strong>get_default</strong></a>(self)</dt><dd><tt>Returns the default value for this field.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLeggedField-get_flatchoices"><strong>get_flatchoices</strong></a>(self, include_blank<font color="#909090">=True</font>, blank_choice<font color="#909090">=[('', '---------')]</font>)</dt><dd><tt>Returns flattened choices with a default blank choice included.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLeggedField-get_internal_type"><strong>get_internal_type</strong></a>(self)</dt></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLeggedField-get_validator_unique_lookup_type"><strong>get_validator_unique_lookup_type</strong></a>(self)</dt></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLeggedField-has_default"><strong>has_default</strong></a>(self)</dt><dd><tt>Returns a boolean of whether this field has a default value.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLeggedField-pre_save"><strong>pre_save</strong></a>(self, model_instance, add)</dt><dd><tt>Returns field's value just before saving.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLeggedField-save_form_data"><strong>save_form_data</strong></a>(self, instance, data)</dt></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLeggedField-set_attributes_from_name"><strong>set_attributes_from_name</strong></a>(self, name)</dt></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLeggedField-value_from_object"><strong>value_from_object</strong></a>(self, obj)</dt><dd><tt>Returns the value of this field in the given model instance.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLeggedField-value_to_string"><strong>value_to_string</strong></a>(self, obj)</dt><dd><tt>Returns a string value of this field from the passed obj.<br>
|
||||
This is used by the serialization framework.</tt></dd></dl>
|
||||
|
||||
<hr>
|
||||
Data descriptors inherited from <a href="django.db.models.fields.html#Field">django.db.models.fields.Field</a>:<br>
|
||||
<dl><dt><strong>__dict__</strong></dt>
|
||||
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
|
||||
</dl>
|
||||
<dl><dt><strong>__weakref__</strong></dt>
|
||||
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
||||
</dl>
|
||||
<dl><dt><strong>choices</strong></dt>
|
||||
</dl>
|
||||
<dl><dt><strong>flatchoices</strong></dt>
|
||||
<dd><tt>Flattened version of choices tuple.</tt></dd>
|
||||
</dl>
|
||||
<dl><dt><strong>unique</strong></dt>
|
||||
</dl>
|
||||
<hr>
|
||||
Data and other attributes inherited from <a href="django.db.models.fields.html#Field">django.db.models.fields.Field</a>:<br>
|
||||
<dl><dt><strong>auto_creation_counter</strong> = -1</dl>
|
||||
|
||||
<dl><dt><strong>creation_counter</strong> = 0</dl>
|
||||
|
||||
<dl><dt><strong>empty_strings_allowed</strong> = True</dl>
|
||||
|
||||
</td></tr></table> <p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#ffc8d8">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#000000" face="helvetica, arial"><a name="OAuthCredentialsField">class <strong>OAuthCredentialsField</strong></a>(<a href="django.db.models.fields.html#Field">django.db.models.fields.Field</a>)</font></td></tr>
|
||||
|
||||
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
|
||||
<td width="100%"><dl><dt>Method resolution order:</dt>
|
||||
<dd><a href="apiclient.ext.django_orm.html#OAuthCredentialsField">OAuthCredentialsField</a></dd>
|
||||
<dd><a href="django.db.models.fields.html#Field">django.db.models.fields.Field</a></dd>
|
||||
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Methods defined here:<br>
|
||||
<dl><dt><a name="OAuthCredentialsField-contribute_to_class"><strong>contribute_to_class</strong></a>(self, cls, name)</dt></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentialsField-db_type"><strong>db_type</strong></a>(self)</dt></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentialsField-get_db_prep_value"><strong>get_db_prep_value</strong></a>(self, value)</dt></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentialsField-to_python"><strong>to_python</strong></a>(self, value)</dt></dl>
|
||||
|
||||
<hr>
|
||||
Data and other attributes defined here:<br>
|
||||
<dl><dt><strong>__metaclass__</strong> = <class 'django.db.models.fields.subclassing.SubfieldBase'><dd><tt>A metaclass for custom <a href="django.db.models.fields.html#Field">Field</a> subclasses. This ensures the model's attribute<br>
|
||||
has the descriptor protocol attached to it.</tt></dl>
|
||||
|
||||
<hr>
|
||||
Methods inherited from <a href="django.db.models.fields.html#Field">django.db.models.fields.Field</a>:<br>
|
||||
<dl><dt><a name="OAuthCredentialsField-__cmp__"><strong>__cmp__</strong></a>(self, other)</dt></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentialsField-__deepcopy__"><strong>__deepcopy__</strong></a>(self, memodict)</dt></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentialsField-__init__"><strong>__init__</strong></a>(self, verbose_name<font color="#909090">=None</font>, name<font color="#909090">=None</font>, primary_key<font color="#909090">=False</font>, max_length<font color="#909090">=None</font>, unique<font color="#909090">=False</font>, blank<font color="#909090">=False</font>, null<font color="#909090">=False</font>, db_index<font color="#909090">=False</font>, rel<font color="#909090">=None</font>, default<font color="#909090">=<class django.db.models.fields.NOT_PROVIDED></font>, editable<font color="#909090">=True</font>, serialize<font color="#909090">=True</font>, unique_for_date<font color="#909090">=None</font>, unique_for_month<font color="#909090">=None</font>, unique_for_year<font color="#909090">=None</font>, choices<font color="#909090">=None</font>, help_text<font color="#909090">=''</font>, db_column<font color="#909090">=None</font>, db_tablespace<font color="#909090">=None</font>, auto_created<font color="#909090">=False</font>)</dt></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentialsField-bind"><strong>bind</strong></a>(self, fieldmapping, original, bound_field_class)</dt></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentialsField-formfield"><strong>formfield</strong></a>(self, form_class<font color="#909090">=<class 'django.forms.fields.CharField'></font>, **kwargs)</dt><dd><tt>Returns a django.forms.<a href="django.db.models.fields.html#Field">Field</a> instance for this database <a href="django.db.models.fields.html#Field">Field</a>.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentialsField-get_attname"><strong>get_attname</strong></a>(self)</dt></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentialsField-get_attname_column"><strong>get_attname_column</strong></a>(self)</dt></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentialsField-get_cache_name"><strong>get_cache_name</strong></a>(self)</dt></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentialsField-get_choices"><strong>get_choices</strong></a>(self, include_blank<font color="#909090">=True</font>, blank_choice<font color="#909090">=[('', '---------')]</font>)</dt><dd><tt>Returns choices with a default blank choices included, for use<br>
|
||||
as SelectField choices for this field.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentialsField-get_choices_default"><strong>get_choices_default</strong></a>(self)</dt></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentialsField-get_db_prep_lookup"><strong>get_db_prep_lookup</strong></a>(self, lookup_type, value)</dt><dd><tt>Returns field's value prepared for database lookup.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentialsField-get_db_prep_save"><strong>get_db_prep_save</strong></a>(self, value)</dt><dd><tt>Returns field's value prepared for saving into a database.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentialsField-get_default"><strong>get_default</strong></a>(self)</dt><dd><tt>Returns the default value for this field.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentialsField-get_flatchoices"><strong>get_flatchoices</strong></a>(self, include_blank<font color="#909090">=True</font>, blank_choice<font color="#909090">=[('', '---------')]</font>)</dt><dd><tt>Returns flattened choices with a default blank choice included.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentialsField-get_internal_type"><strong>get_internal_type</strong></a>(self)</dt></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentialsField-get_validator_unique_lookup_type"><strong>get_validator_unique_lookup_type</strong></a>(self)</dt></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentialsField-has_default"><strong>has_default</strong></a>(self)</dt><dd><tt>Returns a boolean of whether this field has a default value.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentialsField-pre_save"><strong>pre_save</strong></a>(self, model_instance, add)</dt><dd><tt>Returns field's value just before saving.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentialsField-save_form_data"><strong>save_form_data</strong></a>(self, instance, data)</dt></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentialsField-set_attributes_from_name"><strong>set_attributes_from_name</strong></a>(self, name)</dt></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentialsField-value_from_object"><strong>value_from_object</strong></a>(self, obj)</dt><dd><tt>Returns the value of this field in the given model instance.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentialsField-value_to_string"><strong>value_to_string</strong></a>(self, obj)</dt><dd><tt>Returns a string value of this field from the passed obj.<br>
|
||||
This is used by the serialization framework.</tt></dd></dl>
|
||||
|
||||
<hr>
|
||||
Data descriptors inherited from <a href="django.db.models.fields.html#Field">django.db.models.fields.Field</a>:<br>
|
||||
<dl><dt><strong>__dict__</strong></dt>
|
||||
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
|
||||
</dl>
|
||||
<dl><dt><strong>__weakref__</strong></dt>
|
||||
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
||||
</dl>
|
||||
<dl><dt><strong>choices</strong></dt>
|
||||
</dl>
|
||||
<dl><dt><strong>flatchoices</strong></dt>
|
||||
<dd><tt>Flattened version of choices tuple.</tt></dd>
|
||||
</dl>
|
||||
<dl><dt><strong>unique</strong></dt>
|
||||
</dl>
|
||||
<hr>
|
||||
Data and other attributes inherited from <a href="django.db.models.fields.html#Field">django.db.models.fields.Field</a>:<br>
|
||||
<dl><dt><strong>auto_creation_counter</strong> = -1</dl>
|
||||
|
||||
<dl><dt><strong>creation_counter</strong> = 0</dl>
|
||||
|
||||
<dl><dt><strong>empty_strings_allowed</strong> = True</dl>
|
||||
|
||||
</td></tr></table></td></tr></table>
|
||||
</body></html>
|
||||
@@ -1,127 +0,0 @@
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html><head><title>Python: module apiclient.ext.file</title>
|
||||
</head><body bgcolor="#f0f0f8">
|
||||
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
|
||||
<tr bgcolor="#7799ee">
|
||||
<td valign=bottom> <br>
|
||||
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="apiclient.html"><font color="#ffffff">apiclient</font></a>.<a href="apiclient.ext.html"><font color="#ffffff">ext</font></a>.file</strong></big></big></font></td
|
||||
><td align=right valign=bottom
|
||||
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/usr/local/google/home/jcgregorio/projects/apiclient-release/apiclient/ext/file.py">/usr/local/google/home/jcgregorio/projects/apiclient-release/apiclient/ext/file.py</a></font></td></tr></table>
|
||||
<p><tt>Utilities for OAuth.<br>
|
||||
<br>
|
||||
Utilities for making it easier to work with OAuth 1.0 credentials.</tt></p>
|
||||
<p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#aa55cc">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
|
||||
|
||||
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
|
||||
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="pickle.html">pickle</a><br>
|
||||
</td><td width="25%" valign=top><a href="threading.html">threading</a><br>
|
||||
</td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#ee77aa">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
|
||||
|
||||
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
|
||||
<td width="100%"><dl>
|
||||
<dt><font face="helvetica, arial"><a href="oauth2client.client.html#Storage">oauth2client.client.Storage</a>(<a href="__builtin__.html#object">__builtin__.object</a>)
|
||||
</font></dt><dd>
|
||||
<dl>
|
||||
<dt><font face="helvetica, arial"><a href="apiclient.ext.file.html#Storage">Storage</a>
|
||||
</font></dt></dl>
|
||||
</dd>
|
||||
</dl>
|
||||
<p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#ffc8d8">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#000000" face="helvetica, arial"><a name="Storage">class <strong>Storage</strong></a>(<a href="oauth2client.client.html#Storage">oauth2client.client.Storage</a>)</font></td></tr>
|
||||
|
||||
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
||||
<td colspan=2><tt>Store and retrieve a single credential to and from a file.<br> </tt></td></tr>
|
||||
<tr><td> </td>
|
||||
<td width="100%"><dl><dt>Method resolution order:</dt>
|
||||
<dd><a href="apiclient.ext.file.html#Storage">Storage</a></dd>
|
||||
<dd><a href="oauth2client.client.html#Storage">oauth2client.client.Storage</a></dd>
|
||||
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Methods defined here:<br>
|
||||
<dl><dt><a name="Storage-__init__"><strong>__init__</strong></a>(self, filename)</dt></dl>
|
||||
|
||||
<dl><dt><a name="Storage-get"><strong>get</strong></a>(self)</dt><dd><tt>Retrieve Credential from file.<br>
|
||||
<br>
|
||||
Returns:<br>
|
||||
apiclient.oauth.Credentials</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="Storage-put"><strong>put</strong></a>(self, credentials)</dt><dd><tt>Write a pickled Credentials to file.<br>
|
||||
<br>
|
||||
Args:<br>
|
||||
credentials: Credentials, the credentials to store.</tt></dd></dl>
|
||||
|
||||
<hr>
|
||||
Methods inherited from <a href="oauth2client.client.html#Storage">oauth2client.client.Storage</a>:<br>
|
||||
<dl><dt><a name="Storage-acquire_lock"><strong>acquire_lock</strong></a>(self)</dt><dd><tt>Acquires any lock necessary to access this <a href="#Storage">Storage</a>.<br>
|
||||
<br>
|
||||
This lock is not reentrant.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="Storage-delete"><strong>delete</strong></a>(self)</dt><dd><tt>Delete credential.<br>
|
||||
<br>
|
||||
Frees any resources associated with storing the credential.<br>
|
||||
The <a href="#Storage">Storage</a> lock must *not* be held when this is called.<br>
|
||||
<br>
|
||||
Returns:<br>
|
||||
None</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="Storage-locked_delete"><strong>locked_delete</strong></a>(self)</dt><dd><tt>Delete a credential.<br>
|
||||
<br>
|
||||
The <a href="#Storage">Storage</a> lock must be held when this is called.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="Storage-locked_get"><strong>locked_get</strong></a>(self)</dt><dd><tt>Retrieve credential.<br>
|
||||
<br>
|
||||
The <a href="#Storage">Storage</a> lock must be held when this is called.<br>
|
||||
<br>
|
||||
Returns:<br>
|
||||
oauth2client.client.Credentials</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="Storage-locked_put"><strong>locked_put</strong></a>(self, credentials)</dt><dd><tt>Write a credential.<br>
|
||||
<br>
|
||||
The <a href="#Storage">Storage</a> lock must be held when this is called.<br>
|
||||
<br>
|
||||
Args:<br>
|
||||
credentials: Credentials, the credentials to store.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="Storage-release_lock"><strong>release_lock</strong></a>(self)</dt><dd><tt>Release the <a href="#Storage">Storage</a> lock.<br>
|
||||
<br>
|
||||
Trying to release a lock that isn't held will result in a<br>
|
||||
RuntimeError.</tt></dd></dl>
|
||||
|
||||
<hr>
|
||||
Data descriptors inherited from <a href="oauth2client.client.html#Storage">oauth2client.client.Storage</a>:<br>
|
||||
<dl><dt><strong>__dict__</strong></dt>
|
||||
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
|
||||
</dl>
|
||||
<dl><dt><strong>__weakref__</strong></dt>
|
||||
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
||||
</dl>
|
||||
</td></tr></table></td></tr></table><p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#55aa55">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
|
||||
|
||||
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
|
||||
<td width="100%"><strong>__author__</strong> = 'jcgregorio@google.com (Joe Gregorio)'</td></tr></table><p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#7799ee">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr>
|
||||
|
||||
<tr><td bgcolor="#7799ee"><tt> </tt></td><td> </td>
|
||||
<td width="100%">jcgregorio@google.com (Joe Gregorio)</td></tr></table>
|
||||
</body></html>
|
||||
@@ -1,616 +0,0 @@
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html><head><title>Python: module apiclient.oauth</title>
|
||||
</head><body bgcolor="#f0f0f8">
|
||||
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
|
||||
<tr bgcolor="#7799ee">
|
||||
<td valign=bottom> <br>
|
||||
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="apiclient.html"><font color="#ffffff">apiclient</font></a>.oauth</strong></big></big></font></td
|
||||
><td align=right valign=bottom
|
||||
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/usr/local/google/home/jcgregorio/projects/apiclient-release/apiclient/oauth.py">/usr/local/google/home/jcgregorio/projects/apiclient-release/apiclient/oauth.py</a></font></td></tr></table>
|
||||
<p><tt>Utilities for OAuth.<br>
|
||||
<br>
|
||||
Utilities for making it easier to work with OAuth.</tt></p>
|
||||
<p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#aa55cc">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
|
||||
|
||||
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
|
||||
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="copy.html">copy</a><br>
|
||||
<a href="httplib2.html">httplib2</a><br>
|
||||
</td><td width="25%" valign=top><a href="logging.html">logging</a><br>
|
||||
<a href="oauth2.html">oauth2</a><br>
|
||||
</td><td width="25%" valign=top><a href="json.html">json</a><br>
|
||||
<a href="urllib.html">urllib</a><br>
|
||||
</td><td width="25%" valign=top><a href="urlparse.html">urlparse</a><br>
|
||||
</td></tr></table></td></tr></table><p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#ee77aa">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
|
||||
|
||||
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
|
||||
<td width="100%"><dl>
|
||||
<dt><font face="helvetica, arial"><a href="exceptions.html#Exception">exceptions.Exception</a>(<a href="exceptions.html#BaseException">exceptions.BaseException</a>)
|
||||
</font></dt><dd>
|
||||
<dl>
|
||||
<dt><font face="helvetica, arial"><a href="apiclient.oauth.html#Error">Error</a>
|
||||
</font></dt><dd>
|
||||
<dl>
|
||||
<dt><font face="helvetica, arial"><a href="apiclient.oauth.html#CredentialsInvalidError">CredentialsInvalidError</a>
|
||||
</font></dt><dt><font face="helvetica, arial"><a href="apiclient.oauth.html#MissingParameter">MissingParameter</a>
|
||||
</font></dt><dt><font face="helvetica, arial"><a href="apiclient.oauth.html#RequestError">RequestError</a>
|
||||
</font></dt></dl>
|
||||
</dd>
|
||||
</dl>
|
||||
</dd>
|
||||
<dt><font face="helvetica, arial"><a href="oauth2client.client.html#Credentials">oauth2client.client.Credentials</a>(<a href="__builtin__.html#object">__builtin__.object</a>)
|
||||
</font></dt><dd>
|
||||
<dl>
|
||||
<dt><font face="helvetica, arial"><a href="apiclient.oauth.html#OAuthCredentials">OAuthCredentials</a>
|
||||
</font></dt><dt><font face="helvetica, arial"><a href="apiclient.oauth.html#TwoLeggedOAuthCredentials">TwoLeggedOAuthCredentials</a>
|
||||
</font></dt></dl>
|
||||
</dd>
|
||||
<dt><font face="helvetica, arial"><a href="oauth2client.client.html#Flow">oauth2client.client.Flow</a>(<a href="__builtin__.html#object">__builtin__.object</a>)
|
||||
</font></dt><dd>
|
||||
<dl>
|
||||
<dt><font face="helvetica, arial"><a href="apiclient.oauth.html#FlowThreeLegged">FlowThreeLegged</a>
|
||||
</font></dt></dl>
|
||||
</dd>
|
||||
</dl>
|
||||
<p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#ffc8d8">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#000000" face="helvetica, arial"><a name="CredentialsInvalidError">class <strong>CredentialsInvalidError</strong></a>(<a href="apiclient.oauth.html#Error">Error</a>)</font></td></tr>
|
||||
|
||||
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
|
||||
<td width="100%"><dl><dt>Method resolution order:</dt>
|
||||
<dd><a href="apiclient.oauth.html#CredentialsInvalidError">CredentialsInvalidError</a></dd>
|
||||
<dd><a href="apiclient.oauth.html#Error">Error</a></dd>
|
||||
<dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd>
|
||||
<dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd>
|
||||
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Data descriptors inherited from <a href="apiclient.oauth.html#Error">Error</a>:<br>
|
||||
<dl><dt><strong>__weakref__</strong></dt>
|
||||
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
|
||||
<dl><dt><a name="CredentialsInvalidError-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#CredentialsInvalidError-__init__">__init__</a>(...) initializes x; see x.__class__.__doc__ for signature</tt></dd></dl>
|
||||
|
||||
<hr>
|
||||
Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
|
||||
<dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#CredentialsInvalidError-__new__">__new__</a>(S, ...) -> a new object with type S, a subtype of T</tt></dl>
|
||||
|
||||
<hr>
|
||||
Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
|
||||
<dl><dt><a name="CredentialsInvalidError-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#CredentialsInvalidError-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="CredentialsInvalidError-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#CredentialsInvalidError-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="CredentialsInvalidError-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#CredentialsInvalidError-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="CredentialsInvalidError-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#CredentialsInvalidError-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br>
|
||||
<br>
|
||||
Use of negative indices is not supported.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="CredentialsInvalidError-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl>
|
||||
|
||||
<dl><dt><a name="CredentialsInvalidError-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#CredentialsInvalidError-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="CredentialsInvalidError-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#CredentialsInvalidError-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="CredentialsInvalidError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>
|
||||
|
||||
<dl><dt><a name="CredentialsInvalidError-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#CredentialsInvalidError-__str__">__str__</a>() <==> str(x)</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="CredentialsInvalidError-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl>
|
||||
|
||||
<hr>
|
||||
Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
|
||||
<dl><dt><strong>__dict__</strong></dt>
|
||||
</dl>
|
||||
<dl><dt><strong>args</strong></dt>
|
||||
</dl>
|
||||
<dl><dt><strong>message</strong></dt>
|
||||
</dl>
|
||||
</td></tr></table> <p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#ffc8d8">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#000000" face="helvetica, arial"><a name="Error">class <strong>Error</strong></a>(<a href="exceptions.html#Exception">exceptions.Exception</a>)</font></td></tr>
|
||||
|
||||
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
||||
<td colspan=2><tt>Base error for this module.<br> </tt></td></tr>
|
||||
<tr><td> </td>
|
||||
<td width="100%"><dl><dt>Method resolution order:</dt>
|
||||
<dd><a href="apiclient.oauth.html#Error">Error</a></dd>
|
||||
<dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd>
|
||||
<dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd>
|
||||
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Data descriptors defined here:<br>
|
||||
<dl><dt><strong>__weakref__</strong></dt>
|
||||
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
|
||||
<dl><dt><a name="Error-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__init__">__init__</a>(...) initializes x; see x.__class__.__doc__ for signature</tt></dd></dl>
|
||||
|
||||
<hr>
|
||||
Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
|
||||
<dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#Error-__new__">__new__</a>(S, ...) -> a new object with type S, a subtype of T</tt></dl>
|
||||
|
||||
<hr>
|
||||
Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
|
||||
<dl><dt><a name="Error-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="Error-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="Error-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="Error-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br>
|
||||
<br>
|
||||
Use of negative indices is not supported.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="Error-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl>
|
||||
|
||||
<dl><dt><a name="Error-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="Error-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="Error-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>
|
||||
|
||||
<dl><dt><a name="Error-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#Error-__str__">__str__</a>() <==> str(x)</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="Error-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl>
|
||||
|
||||
<hr>
|
||||
Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
|
||||
<dl><dt><strong>__dict__</strong></dt>
|
||||
</dl>
|
||||
<dl><dt><strong>args</strong></dt>
|
||||
</dl>
|
||||
<dl><dt><strong>message</strong></dt>
|
||||
</dl>
|
||||
</td></tr></table> <p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#ffc8d8">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#000000" face="helvetica, arial"><a name="FlowThreeLegged">class <strong>FlowThreeLegged</strong></a>(<a href="oauth2client.client.html#Flow">oauth2client.client.Flow</a>)</font></td></tr>
|
||||
|
||||
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
||||
<td colspan=2><tt>Does the Three Legged Dance for OAuth 1.0a.<br> </tt></td></tr>
|
||||
<tr><td> </td>
|
||||
<td width="100%"><dl><dt>Method resolution order:</dt>
|
||||
<dd><a href="apiclient.oauth.html#FlowThreeLegged">FlowThreeLegged</a></dd>
|
||||
<dd><a href="oauth2client.client.html#Flow">oauth2client.client.Flow</a></dd>
|
||||
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Methods defined here:<br>
|
||||
<dl><dt><a name="FlowThreeLegged-__init__"><strong>__init__</strong></a>(self, discovery, consumer_key, consumer_secret, user_agent, **kwargs)</dt><dd><tt>discovery - Section of the API discovery document that describes<br>
|
||||
the OAuth endpoints.<br>
|
||||
consumer_key - OAuth consumer key<br>
|
||||
consumer_secret - OAuth consumer secret<br>
|
||||
user_agent - The HTTP User-Agent that identifies the application.<br>
|
||||
**kwargs - The keyword arguments are all optional and required<br>
|
||||
parameters for the OAuth calls.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLegged-step1_get_authorize_url"><strong>step1_get_authorize_url</strong></a>(self, oauth_callback<font color="#909090">='oob'</font>)</dt><dd><tt>Returns a URI to redirect to the provider.<br>
|
||||
<br>
|
||||
oauth_callback - Either the string 'oob' for a non-web-based application,<br>
|
||||
or a URI that handles the callback from the authorization<br>
|
||||
server.<br>
|
||||
<br>
|
||||
If oauth_callback is 'oob' then pass in the<br>
|
||||
generated verification code to step2_exchange,<br>
|
||||
otherwise pass in the query parameters received<br>
|
||||
at the callback uri to step2_exchange.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="FlowThreeLegged-step2_exchange"><strong>step2_exchange</strong></a>(self, verifier)</dt><dd><tt>Exhanges an authorized request token<br>
|
||||
for <a href="#OAuthCredentials">OAuthCredentials</a>.<br>
|
||||
<br>
|
||||
Args:<br>
|
||||
verifier: string, dict - either the verifier token, or a dictionary<br>
|
||||
of the query parameters to the callback, which contains<br>
|
||||
the oauth_verifier.<br>
|
||||
Returns:<br>
|
||||
The <a href="oauth2client.client.html#Credentials">Credentials</a> object.</tt></dd></dl>
|
||||
|
||||
<hr>
|
||||
Data descriptors inherited from <a href="oauth2client.client.html#Flow">oauth2client.client.Flow</a>:<br>
|
||||
<dl><dt><strong>__dict__</strong></dt>
|
||||
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
|
||||
</dl>
|
||||
<dl><dt><strong>__weakref__</strong></dt>
|
||||
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
||||
</dl>
|
||||
</td></tr></table> <p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#ffc8d8">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#000000" face="helvetica, arial"><a name="MissingParameter">class <strong>MissingParameter</strong></a>(<a href="apiclient.oauth.html#Error">Error</a>)</font></td></tr>
|
||||
|
||||
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
|
||||
<td width="100%"><dl><dt>Method resolution order:</dt>
|
||||
<dd><a href="apiclient.oauth.html#MissingParameter">MissingParameter</a></dd>
|
||||
<dd><a href="apiclient.oauth.html#Error">Error</a></dd>
|
||||
<dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd>
|
||||
<dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd>
|
||||
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Data descriptors inherited from <a href="apiclient.oauth.html#Error">Error</a>:<br>
|
||||
<dl><dt><strong>__weakref__</strong></dt>
|
||||
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
|
||||
<dl><dt><a name="MissingParameter-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#MissingParameter-__init__">__init__</a>(...) initializes x; see x.__class__.__doc__ for signature</tt></dd></dl>
|
||||
|
||||
<hr>
|
||||
Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
|
||||
<dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#MissingParameter-__new__">__new__</a>(S, ...) -> a new object with type S, a subtype of T</tt></dl>
|
||||
|
||||
<hr>
|
||||
Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
|
||||
<dl><dt><a name="MissingParameter-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#MissingParameter-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="MissingParameter-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#MissingParameter-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="MissingParameter-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#MissingParameter-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="MissingParameter-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#MissingParameter-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br>
|
||||
<br>
|
||||
Use of negative indices is not supported.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="MissingParameter-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl>
|
||||
|
||||
<dl><dt><a name="MissingParameter-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#MissingParameter-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="MissingParameter-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#MissingParameter-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="MissingParameter-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>
|
||||
|
||||
<dl><dt><a name="MissingParameter-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#MissingParameter-__str__">__str__</a>() <==> str(x)</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="MissingParameter-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl>
|
||||
|
||||
<hr>
|
||||
Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
|
||||
<dl><dt><strong>__dict__</strong></dt>
|
||||
</dl>
|
||||
<dl><dt><strong>args</strong></dt>
|
||||
</dl>
|
||||
<dl><dt><strong>message</strong></dt>
|
||||
</dl>
|
||||
</td></tr></table> <p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#ffc8d8">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#000000" face="helvetica, arial"><a name="OAuthCredentials">class <strong>OAuthCredentials</strong></a>(<a href="oauth2client.client.html#Credentials">oauth2client.client.Credentials</a>)</font></td></tr>
|
||||
|
||||
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
||||
<td colspan=2><tt><a href="oauth2client.client.html#Credentials">Credentials</a> object for OAuth 1.0a<br> </tt></td></tr>
|
||||
<tr><td> </td>
|
||||
<td width="100%"><dl><dt>Method resolution order:</dt>
|
||||
<dd><a href="apiclient.oauth.html#OAuthCredentials">OAuthCredentials</a></dd>
|
||||
<dd><a href="oauth2client.client.html#Credentials">oauth2client.client.Credentials</a></dd>
|
||||
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Methods defined here:<br>
|
||||
<dl><dt><a name="OAuthCredentials-__getstate__"><strong>__getstate__</strong></a>(self)</dt><dd><tt>Trim the state down to something that can be pickled.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentials-__init__"><strong>__init__</strong></a>(self, consumer, token, user_agent)</dt><dd><tt>consumer - An instance of oauth.Consumer.<br>
|
||||
token - An instance of oauth.Token constructed with<br>
|
||||
the access token and secret.<br>
|
||||
user_agent - The HTTP User-Agent to provide for this application.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentials-__setstate__"><strong>__setstate__</strong></a>(self, state)</dt><dd><tt>Reconstitute the state of the object from being pickled.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentials-authorize"><strong>authorize</strong></a>(self, http)</dt><dd><tt>Authorize an httplib2.Http instance with these <a href="oauth2client.client.html#Credentials">Credentials</a><br>
|
||||
<br>
|
||||
Args:<br>
|
||||
http - An instance of httplib2.Http<br>
|
||||
or something that acts like it.<br>
|
||||
<br>
|
||||
Returns:<br>
|
||||
A modified instance of http that was passed in.<br>
|
||||
<br>
|
||||
Example:<br>
|
||||
<br>
|
||||
h = httplib2.Http()<br>
|
||||
h = credentials.<a href="#OAuthCredentials-authorize">authorize</a>(h)<br>
|
||||
<br>
|
||||
You can't create a new OAuth<br>
|
||||
subclass of httplib2.Authenication because<br>
|
||||
it never gets passed the absolute URI, which is<br>
|
||||
needed for signing. So instead we have to overload<br>
|
||||
'request' with a closure that adds in the<br>
|
||||
Authorization header and then calls the original version<br>
|
||||
of 'request()'.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentials-set_store"><strong>set_store</strong></a>(self, store)</dt><dd><tt>Set the storage for the credential.<br>
|
||||
<br>
|
||||
Args:<br>
|
||||
store: callable, a callable that when passed a Credential<br>
|
||||
will store the credential back to where it came from.<br>
|
||||
This is needed to store the latest access_token if it<br>
|
||||
has been revoked.</tt></dd></dl>
|
||||
|
||||
<hr>
|
||||
Data descriptors defined here:<br>
|
||||
<dl><dt><strong>invalid</strong></dt>
|
||||
<dd><tt>True if the credentials are invalid, such as being revoked.</tt></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Methods inherited from <a href="oauth2client.client.html#Credentials">oauth2client.client.Credentials</a>:<br>
|
||||
<dl><dt><a name="OAuthCredentials-apply"><strong>apply</strong></a>(self, headers)</dt><dd><tt>Add the authorization to the headers.<br>
|
||||
<br>
|
||||
Args:<br>
|
||||
headers: dict, the headers to add the Authorization header to.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentials-refresh"><strong>refresh</strong></a>(self, http)</dt><dd><tt>Forces a refresh of the access_token.<br>
|
||||
<br>
|
||||
Args:<br>
|
||||
http: httplib2.Http, an http object to be used to make the refresh<br>
|
||||
request.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentials-to_json"><strong>to_json</strong></a>(self)</dt><dd><tt>Creating a JSON representation of an instance of <a href="oauth2client.client.html#Credentials">Credentials</a>.<br>
|
||||
<br>
|
||||
Returns:<br>
|
||||
string, a JSON representation of this instance, suitable to pass to<br>
|
||||
<a href="#OAuthCredentials-from_json">from_json</a>().</tt></dd></dl>
|
||||
|
||||
<hr>
|
||||
Class methods inherited from <a href="oauth2client.client.html#Credentials">oauth2client.client.Credentials</a>:<br>
|
||||
<dl><dt><a name="OAuthCredentials-from_json"><strong>from_json</strong></a>(cls, s)<font color="#909090"><font face="helvetica, arial"> from <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt><dd><tt>Instantiate a <a href="oauth2client.client.html#Credentials">Credentials</a> object from a JSON description of it. The JSON<br>
|
||||
should have been produced by calling .<a href="#OAuthCredentials-to_json">to_json</a>() on the object.<br>
|
||||
<br>
|
||||
Args:<br>
|
||||
data: dict, A deserialized JSON object.<br>
|
||||
<br>
|
||||
Returns:<br>
|
||||
An instance of a <a href="oauth2client.client.html#Credentials">Credentials</a> subclass.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="OAuthCredentials-new_from_json"><strong>new_from_json</strong></a>(cls, s)<font color="#909090"><font face="helvetica, arial"> from <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt><dd><tt>Utility class method to instantiate a <a href="oauth2client.client.html#Credentials">Credentials</a> subclass from a JSON<br>
|
||||
representation produced by <a href="#OAuthCredentials-to_json">to_json</a>().<br>
|
||||
<br>
|
||||
Args:<br>
|
||||
s: string, JSON from <a href="#OAuthCredentials-to_json">to_json</a>().<br>
|
||||
<br>
|
||||
Returns:<br>
|
||||
An instance of the subclass of <a href="oauth2client.client.html#Credentials">Credentials</a> that was serialized with<br>
|
||||
<a href="#OAuthCredentials-to_json">to_json</a>().</tt></dd></dl>
|
||||
|
||||
<hr>
|
||||
Data descriptors inherited from <a href="oauth2client.client.html#Credentials">oauth2client.client.Credentials</a>:<br>
|
||||
<dl><dt><strong>__dict__</strong></dt>
|
||||
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
|
||||
</dl>
|
||||
<dl><dt><strong>__weakref__</strong></dt>
|
||||
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Data and other attributes inherited from <a href="oauth2client.client.html#Credentials">oauth2client.client.Credentials</a>:<br>
|
||||
<dl><dt><strong>NON_SERIALIZED_MEMBERS</strong> = ['store']</dl>
|
||||
|
||||
</td></tr></table> <p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#ffc8d8">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#000000" face="helvetica, arial"><a name="RequestError">class <strong>RequestError</strong></a>(<a href="apiclient.oauth.html#Error">Error</a>)</font></td></tr>
|
||||
|
||||
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
||||
<td colspan=2><tt><a href="#Error">Error</a> occurred during request.<br> </tt></td></tr>
|
||||
<tr><td> </td>
|
||||
<td width="100%"><dl><dt>Method resolution order:</dt>
|
||||
<dd><a href="apiclient.oauth.html#RequestError">RequestError</a></dd>
|
||||
<dd><a href="apiclient.oauth.html#Error">Error</a></dd>
|
||||
<dd><a href="exceptions.html#Exception">exceptions.Exception</a></dd>
|
||||
<dd><a href="exceptions.html#BaseException">exceptions.BaseException</a></dd>
|
||||
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Data descriptors inherited from <a href="apiclient.oauth.html#Error">Error</a>:<br>
|
||||
<dl><dt><strong>__weakref__</strong></dt>
|
||||
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Methods inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
|
||||
<dl><dt><a name="RequestError-__init__"><strong>__init__</strong></a>(...)</dt><dd><tt>x.<a href="#RequestError-__init__">__init__</a>(...) initializes x; see x.__class__.__doc__ for signature</tt></dd></dl>
|
||||
|
||||
<hr>
|
||||
Data and other attributes inherited from <a href="exceptions.html#Exception">exceptions.Exception</a>:<br>
|
||||
<dl><dt><strong>__new__</strong> = <built-in method __new__ of type object><dd><tt>T.<a href="#RequestError-__new__">__new__</a>(S, ...) -> a new object with type S, a subtype of T</tt></dl>
|
||||
|
||||
<hr>
|
||||
Methods inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
|
||||
<dl><dt><a name="RequestError-__delattr__"><strong>__delattr__</strong></a>(...)</dt><dd><tt>x.<a href="#RequestError-__delattr__">__delattr__</a>('name') <==> del x.name</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="RequestError-__getattribute__"><strong>__getattribute__</strong></a>(...)</dt><dd><tt>x.<a href="#RequestError-__getattribute__">__getattribute__</a>('name') <==> x.name</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="RequestError-__getitem__"><strong>__getitem__</strong></a>(...)</dt><dd><tt>x.<a href="#RequestError-__getitem__">__getitem__</a>(y) <==> x[y]</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="RequestError-__getslice__"><strong>__getslice__</strong></a>(...)</dt><dd><tt>x.<a href="#RequestError-__getslice__">__getslice__</a>(i, j) <==> x[i:j]<br>
|
||||
<br>
|
||||
Use of negative indices is not supported.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="RequestError-__reduce__"><strong>__reduce__</strong></a>(...)</dt></dl>
|
||||
|
||||
<dl><dt><a name="RequestError-__repr__"><strong>__repr__</strong></a>(...)</dt><dd><tt>x.<a href="#RequestError-__repr__">__repr__</a>() <==> repr(x)</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="RequestError-__setattr__"><strong>__setattr__</strong></a>(...)</dt><dd><tt>x.<a href="#RequestError-__setattr__">__setattr__</a>('name', value) <==> x.name = value</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="RequestError-__setstate__"><strong>__setstate__</strong></a>(...)</dt></dl>
|
||||
|
||||
<dl><dt><a name="RequestError-__str__"><strong>__str__</strong></a>(...)</dt><dd><tt>x.<a href="#RequestError-__str__">__str__</a>() <==> str(x)</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="RequestError-__unicode__"><strong>__unicode__</strong></a>(...)</dt></dl>
|
||||
|
||||
<hr>
|
||||
Data descriptors inherited from <a href="exceptions.html#BaseException">exceptions.BaseException</a>:<br>
|
||||
<dl><dt><strong>__dict__</strong></dt>
|
||||
</dl>
|
||||
<dl><dt><strong>args</strong></dt>
|
||||
</dl>
|
||||
<dl><dt><strong>message</strong></dt>
|
||||
</dl>
|
||||
</td></tr></table> <p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#ffc8d8">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#000000" face="helvetica, arial"><a name="TwoLeggedOAuthCredentials">class <strong>TwoLeggedOAuthCredentials</strong></a>(<a href="oauth2client.client.html#Credentials">oauth2client.client.Credentials</a>)</font></td></tr>
|
||||
|
||||
<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td>
|
||||
<td colspan=2><tt>Two Legged <a href="oauth2client.client.html#Credentials">Credentials</a> object for OAuth 1.0a.<br>
|
||||
<br>
|
||||
The Two Legged object is created directly, not from a flow. Once you<br>
|
||||
authorize and httplib2.Http instance you can change the requestor and that<br>
|
||||
change will propogate to the authorized httplib2.Http instance. For example:<br>
|
||||
<br>
|
||||
http = httplib2.Http()<br>
|
||||
http = credentials.<a href="#TwoLeggedOAuthCredentials-authorize">authorize</a>(http)<br>
|
||||
<br>
|
||||
credentials.requestor = 'foo@example.info'<br>
|
||||
http.request(...)<br>
|
||||
credentials.requestor = 'bar@example.info'<br>
|
||||
http.request(...)<br> </tt></td></tr>
|
||||
<tr><td> </td>
|
||||
<td width="100%"><dl><dt>Method resolution order:</dt>
|
||||
<dd><a href="apiclient.oauth.html#TwoLeggedOAuthCredentials">TwoLeggedOAuthCredentials</a></dd>
|
||||
<dd><a href="oauth2client.client.html#Credentials">oauth2client.client.Credentials</a></dd>
|
||||
<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Methods defined here:<br>
|
||||
<dl><dt><a name="TwoLeggedOAuthCredentials-__getstate__"><strong>__getstate__</strong></a>(self)</dt><dd><tt>Trim the state down to something that can be pickled.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="TwoLeggedOAuthCredentials-__init__"><strong>__init__</strong></a>(self, consumer_key, consumer_secret, user_agent)</dt><dd><tt>Args:<br>
|
||||
consumer_key: string, An OAuth 1.0 consumer key<br>
|
||||
consumer_secret: string, An OAuth 1.0 consumer secret<br>
|
||||
user_agent: string, The HTTP User-Agent to provide for this application.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="TwoLeggedOAuthCredentials-__setstate__"><strong>__setstate__</strong></a>(self, state)</dt><dd><tt>Reconstitute the state of the object from being pickled.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="TwoLeggedOAuthCredentials-authorize"><strong>authorize</strong></a>(self, http)</dt><dd><tt>Authorize an httplib2.Http instance with these <a href="oauth2client.client.html#Credentials">Credentials</a><br>
|
||||
<br>
|
||||
Args:<br>
|
||||
http - An instance of httplib2.Http<br>
|
||||
or something that acts like it.<br>
|
||||
<br>
|
||||
Returns:<br>
|
||||
A modified instance of http that was passed in.<br>
|
||||
<br>
|
||||
Example:<br>
|
||||
<br>
|
||||
h = httplib2.Http()<br>
|
||||
h = credentials.<a href="#TwoLeggedOAuthCredentials-authorize">authorize</a>(h)<br>
|
||||
<br>
|
||||
You can't create a new OAuth<br>
|
||||
subclass of httplib2.Authenication because<br>
|
||||
it never gets passed the absolute URI, which is<br>
|
||||
needed for signing. So instead we have to overload<br>
|
||||
'request' with a closure that adds in the<br>
|
||||
Authorization header and then calls the original version<br>
|
||||
of 'request()'.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="TwoLeggedOAuthCredentials-getrequestor"><strong>getrequestor</strong></a>(self)</dt></dl>
|
||||
|
||||
<dl><dt><a name="TwoLeggedOAuthCredentials-set_store"><strong>set_store</strong></a>(self, store)</dt><dd><tt>Set the storage for the credential.<br>
|
||||
<br>
|
||||
Args:<br>
|
||||
store: callable, a callable that when passed a Credential<br>
|
||||
will store the credential back to where it came from.<br>
|
||||
This is needed to store the latest access_token if it<br>
|
||||
has been revoked.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="TwoLeggedOAuthCredentials-setrequestor"><strong>setrequestor</strong></a>(self, email)</dt></dl>
|
||||
|
||||
<hr>
|
||||
Data descriptors defined here:<br>
|
||||
<dl><dt><strong>invalid</strong></dt>
|
||||
<dd><tt>True if the credentials are invalid, such as being revoked.<br>
|
||||
<br>
|
||||
Always returns False for Two Legged Credentials.</tt></dd>
|
||||
</dl>
|
||||
<dl><dt><strong>requestor</strong></dt>
|
||||
<dd><tt>The email address of the user to act on behalf of</tt></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Methods inherited from <a href="oauth2client.client.html#Credentials">oauth2client.client.Credentials</a>:<br>
|
||||
<dl><dt><a name="TwoLeggedOAuthCredentials-apply"><strong>apply</strong></a>(self, headers)</dt><dd><tt>Add the authorization to the headers.<br>
|
||||
<br>
|
||||
Args:<br>
|
||||
headers: dict, the headers to add the Authorization header to.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="TwoLeggedOAuthCredentials-refresh"><strong>refresh</strong></a>(self, http)</dt><dd><tt>Forces a refresh of the access_token.<br>
|
||||
<br>
|
||||
Args:<br>
|
||||
http: httplib2.Http, an http object to be used to make the refresh<br>
|
||||
request.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="TwoLeggedOAuthCredentials-to_json"><strong>to_json</strong></a>(self)</dt><dd><tt>Creating a JSON representation of an instance of <a href="oauth2client.client.html#Credentials">Credentials</a>.<br>
|
||||
<br>
|
||||
Returns:<br>
|
||||
string, a JSON representation of this instance, suitable to pass to<br>
|
||||
<a href="#TwoLeggedOAuthCredentials-from_json">from_json</a>().</tt></dd></dl>
|
||||
|
||||
<hr>
|
||||
Class methods inherited from <a href="oauth2client.client.html#Credentials">oauth2client.client.Credentials</a>:<br>
|
||||
<dl><dt><a name="TwoLeggedOAuthCredentials-from_json"><strong>from_json</strong></a>(cls, s)<font color="#909090"><font face="helvetica, arial"> from <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt><dd><tt>Instantiate a <a href="oauth2client.client.html#Credentials">Credentials</a> object from a JSON description of it. The JSON<br>
|
||||
should have been produced by calling .<a href="#TwoLeggedOAuthCredentials-to_json">to_json</a>() on the object.<br>
|
||||
<br>
|
||||
Args:<br>
|
||||
data: dict, A deserialized JSON object.<br>
|
||||
<br>
|
||||
Returns:<br>
|
||||
An instance of a <a href="oauth2client.client.html#Credentials">Credentials</a> subclass.</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="TwoLeggedOAuthCredentials-new_from_json"><strong>new_from_json</strong></a>(cls, s)<font color="#909090"><font face="helvetica, arial"> from <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt><dd><tt>Utility class method to instantiate a <a href="oauth2client.client.html#Credentials">Credentials</a> subclass from a JSON<br>
|
||||
representation produced by <a href="#TwoLeggedOAuthCredentials-to_json">to_json</a>().<br>
|
||||
<br>
|
||||
Args:<br>
|
||||
s: string, JSON from <a href="#TwoLeggedOAuthCredentials-to_json">to_json</a>().<br>
|
||||
<br>
|
||||
Returns:<br>
|
||||
An instance of the subclass of <a href="oauth2client.client.html#Credentials">Credentials</a> that was serialized with<br>
|
||||
<a href="#TwoLeggedOAuthCredentials-to_json">to_json</a>().</tt></dd></dl>
|
||||
|
||||
<hr>
|
||||
Data descriptors inherited from <a href="oauth2client.client.html#Credentials">oauth2client.client.Credentials</a>:<br>
|
||||
<dl><dt><strong>__dict__</strong></dt>
|
||||
<dd><tt>dictionary for instance variables (if defined)</tt></dd>
|
||||
</dl>
|
||||
<dl><dt><strong>__weakref__</strong></dt>
|
||||
<dd><tt>list of weak references to the object (if defined)</tt></dd>
|
||||
</dl>
|
||||
<hr>
|
||||
Data and other attributes inherited from <a href="oauth2client.client.html#Credentials">oauth2client.client.Credentials</a>:<br>
|
||||
<dl><dt><strong>NON_SERIALIZED_MEMBERS</strong> = ['store']</dl>
|
||||
|
||||
</td></tr></table></td></tr></table><p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#55aa55">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
|
||||
|
||||
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
|
||||
<td width="100%"><strong>__author__</strong> = 'jcgregorio@google.com (Joe Gregorio)'</td></tr></table><p>
|
||||
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
|
||||
<tr bgcolor="#7799ee">
|
||||
<td colspan=3 valign=bottom> <br>
|
||||
<font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr>
|
||||
|
||||
<tr><td bgcolor="#7799ee"><tt> </tt></td><td> </td>
|
||||
<td width="100%">jcgregorio@google.com (Joe Gregorio)</td></tr></table>
|
||||
</body></html>
|
||||
@@ -24,41 +24,44 @@ Returns:<br>
|
||||
An object of the form<br>
|
||||
<br>
|
||||
{<br>
|
||||
"protocol": "rest", # The protocol described by this document.<br>
|
||||
"methods": { # API-level methods for this API.<br>
|
||||
},<br>
|
||||
"labels": [ # Labels for the status of this API, such as labs or deprecated.<br>
|
||||
"A String",<br>
|
||||
],<br>
|
||||
"batchPath": "batch", # The path for REST batch requests.<br>
|
||||
"id": "A String", # The id of this API.<br>
|
||||
"schemas": { # The schemas for this API.<br>
|
||||
},<br>
|
||||
"kind": "discovery#restDescription", # The kind for this response.<br>
|
||||
"protocol": "rest", # The protocol described by this document.<br>
|
||||
"description": "A String", # The description of this API.<br>
|
||||
"rootUrl": "A String", # The root url under which all API services live.<br>
|
||||
"parameters": { # Common parameters that apply across all apis.<br>
|
||||
},<br>
|
||||
"icons": { # Links to 16x16 and 32x32 icons representing the API.<br>
|
||||
"x32": "A String", # The url of the 32x32 icon.<br>
|
||||
"x16": "A String", # The url of the 16x16 icon.<br>
|
||||
},<br>
|
||||
"basePath": "A String", # The base path for REST requests.<br>
|
||||
"labels": [ # Labels for the status of this API, such as labs or deprecated.<br>
|
||||
"baseUrl": "A String", # [DEPRECATED] The base URL for REST requests.<br>
|
||||
"version": "A String", # The version of this API.<br>
|
||||
"features": [ # A list of supported features for this API.<br>
|
||||
"A String",<br>
|
||||
],<br>
|
||||
"baseUrl": "A String", # The base URL for REST requests.<br>
|
||||
"servicePath": "A String", # The base path for all REST requests.<br>
|
||||
"resources": { # The resources in this API.<br>
|
||||
},<br>
|
||||
"revision": "A String", # The version of this API.<br>
|
||||
"description": "A String", # The description of this API.<br>
|
||||
"auth": { # Authentication information.<br>
|
||||
"oauth2": { # OAuth 2.0 authentication information.<br>
|
||||
"scopes": { # Available OAuth 2.0 scopes.<br>
|
||||
},<br>
|
||||
},<br>
|
||||
},<br>
|
||||
"kind": "discovery#restDescription", # The kind for this response.<br>
|
||||
"name": "A String", # The name of this API.<br>
|
||||
"methods": { # API-level methods for this API.<br>
|
||||
},<br>
|
||||
"version": "A String", # The version of this API.<br>
|
||||
"features": [ # A list of supported features for this API.<br>
|
||||
"A String",<br>
|
||||
],<br>
|
||||
"basePath": "A String", # [DEPRECATED] The base path for REST requests.<br>
|
||||
"title": "A String", # The title of this API.<br>
|
||||
"discoveryVersion": "v1", # Indicate the version of the Discovery API used to generate this doc.<br>
|
||||
"revision": "A String", # The version of this API.<br>
|
||||
"id": "A String", # The id of this API.<br>
|
||||
"resources": { # The resources in this API.<br>
|
||||
},<br>
|
||||
"documentationLink": "A String", # A link to human readable documentation for the API.<br>
|
||||
}</tt></dd></dl>
|
||||
|
||||
|
||||
@@ -14,6 +14,43 @@
|
||||
<td width="100%">Methods defined here:<br>
|
||||
<dl><dt><a name="Resource-__init__"><strong>__init__</strong></a>(self)</dt></dl>
|
||||
|
||||
<dl><dt><a name="Resource-issueTokenGet"><strong>issueTokenGet</strong></a> = method(self, **kwargs)</dt><dd><tt>A description of how to use this function<br>
|
||||
<br>
|
||||
Args:<br>
|
||||
origin: string, A parameter<br>
|
||||
force: boolean, A parameter<br>
|
||||
client_id: string, A parameter (required)<br>
|
||||
alg: string, A parameter<br>
|
||||
app_id: string, A parameter<br>
|
||||
android_device_id: string, A parameter<br>
|
||||
audience: string, A parameter<br>
|
||||
hl: string, A parameter<br>
|
||||
scope: string, A parameter (required)<br>
|
||||
response_type: string, A parameter (required)<br>
|
||||
<br>
|
||||
Returns:<br>
|
||||
An object of the form<br>
|
||||
<br>
|
||||
{<br>
|
||||
"consent": {<br>
|
||||
"scopes": [<br>
|
||||
{<br>
|
||||
"description": "A String",<br>
|
||||
"detail": "A String",<br>
|
||||
},<br>
|
||||
],<br>
|
||||
"oauthClient": {<br>
|
||||
"iconUri": "A String",<br>
|
||||
"developerEmail": "A String",<br>
|
||||
"name": "A String",<br>
|
||||
},<br>
|
||||
},<br>
|
||||
"token": "A String",<br>
|
||||
"code": "A String",<br>
|
||||
"issueAdvice": "A String",<br>
|
||||
"idToken": "A String",<br>
|
||||
}</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="Resource-tokeninfo"><strong>tokeninfo</strong></a> = method(self, **kwargs)</dt><dd><tt>A description of how to use this function<br>
|
||||
<br>
|
||||
Args:<br>
|
||||
|
||||
@@ -65,7 +65,7 @@ Returns:<br>
|
||||
"community": { # The community which is related with this activity, e.g. a joined community.<br>
|
||||
"category": "A String", # The category of the community.<br>
|
||||
"kind": "orkut#community", # Identifies this resource as a community. Value: "orkut#community"<br>
|
||||
"member_count": 42, # The count of members on the community.<br>
|
||||
"member_count": 42, # The number of users who are part of the community. This number may be approximate, so do not rely on it for iteration.<br>
|
||||
"description": "A String", # The description of the community.<br>
|
||||
"language": "A String", # The official language of the community.<br>
|
||||
"links": [ # List of resources for the community.<br>
|
||||
@@ -79,16 +79,16 @@ Returns:<br>
|
||||
"creation_date": "A String", # The time the community was created, in <a href="http://www.rfc-editor.org/rfc/rfc3339.txt">RFC 3339</a> format.<br>
|
||||
"owner": { # The person who owns the community.<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
"id": "A String", # Unique identifier of the person who posted the comment. This is the person's OpenSocial ID.<br>
|
||||
},<br>
|
||||
"moderators": [ # The moderator of the community.<br>
|
||||
"moderators": [ # The list of moderators of the community.<br>
|
||||
{<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
@@ -99,7 +99,7 @@ Returns:<br>
|
||||
"co_owners": [ # The co-owners of the community.<br>
|
||||
{<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
@@ -149,7 +149,7 @@ Returns:<br>
|
||||
],<br>
|
||||
"actor": { # The person who posted the comment.<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
@@ -167,7 +167,7 @@ Returns:<br>
|
||||
"updated": "A String", # The time at which the activity was last updated.<br>
|
||||
"actor": { # The person who performed the activity.<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
|
||||
@@ -46,7 +46,7 @@ Returns:<br>
|
||||
],<br>
|
||||
"actor": { # The person who posted the comment.<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
@@ -81,7 +81,7 @@ Args:<br>
|
||||
],<br>
|
||||
"actor": { # The person who posted the comment.<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
@@ -115,7 +115,7 @@ Returns:<br>
|
||||
],<br>
|
||||
"actor": { # The person who posted the comment.<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
@@ -162,7 +162,7 @@ Returns:<br>
|
||||
],<br>
|
||||
"actor": { # The person who posted the comment.<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<td width="100%">Methods defined here:<br>
|
||||
<dl><dt><a name="Resource-__init__"><strong>__init__</strong></a>(self)</dt></dl>
|
||||
|
||||
<dl><dt><a name="Resource-get"><strong>get</strong></a> = method(self, **kwargs)</dt><dd><tt>Retrieves the profile of a community.<br>
|
||||
<dl><dt><a name="Resource-get"><strong>get</strong></a> = method(self, **kwargs)</dt><dd><tt>Retrieves the basic information (aka. profile) of a community.<br>
|
||||
<br>
|
||||
Args:<br>
|
||||
hl: string, Specifies the interface language (host language) of your user interface.<br>
|
||||
@@ -26,7 +26,7 @@ Returns:<br>
|
||||
{<br>
|
||||
"category": "A String", # The category of the community.<br>
|
||||
"kind": "orkut#community", # Identifies this resource as a community. Value: "orkut#community"<br>
|
||||
"member_count": 42, # The count of members on the community.<br>
|
||||
"member_count": 42, # The number of users who are part of the community. This number may be approximate, so do not rely on it for iteration.<br>
|
||||
"description": "A String", # The description of the community.<br>
|
||||
"language": "A String", # The official language of the community.<br>
|
||||
"links": [ # List of resources for the community.<br>
|
||||
@@ -40,16 +40,16 @@ Returns:<br>
|
||||
"creation_date": "A String", # The time the community was created, in <a href="http://www.rfc-editor.org/rfc/rfc3339.txt">RFC 3339</a> format.<br>
|
||||
"owner": { # The person who owns the community.<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
"id": "A String", # Unique identifier of the person who posted the comment. This is the person's OpenSocial ID.<br>
|
||||
},<br>
|
||||
"moderators": [ # The moderator of the community.<br>
|
||||
"moderators": [ # The list of moderators of the community.<br>
|
||||
{<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
@@ -60,7 +60,7 @@ Returns:<br>
|
||||
"co_owners": [ # The co-owners of the community.<br>
|
||||
{<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
@@ -72,7 +72,7 @@ Returns:<br>
|
||||
"name": "A String", # The name of the community.<br>
|
||||
}</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="Resource-list"><strong>list</strong></a> = method(self, **kwargs)</dt><dd><tt>Retrieves the communities an user is member of.<br>
|
||||
<dl><dt><a name="Resource-list"><strong>list</strong></a> = method(self, **kwargs)</dt><dd><tt>Retrieves the list of communities the current user is a member of.<br>
|
||||
<br>
|
||||
Args:<br>
|
||||
orderBy: string, How to order the communities by.<br>
|
||||
@@ -91,7 +91,7 @@ Returns:<br>
|
||||
{<br>
|
||||
"category": "A String", # The category of the community.<br>
|
||||
"kind": "orkut#community", # Identifies this resource as a community. Value: "orkut#community"<br>
|
||||
"member_count": 42, # The count of members on the community.<br>
|
||||
"member_count": 42, # The number of users who are part of the community. This number may be approximate, so do not rely on it for iteration.<br>
|
||||
"description": "A String", # The description of the community.<br>
|
||||
"language": "A String", # The official language of the community.<br>
|
||||
"links": [ # List of resources for the community.<br>
|
||||
@@ -105,16 +105,16 @@ Returns:<br>
|
||||
"creation_date": "A String", # The time the community was created, in <a href="http://www.rfc-editor.org/rfc/rfc3339.txt">RFC 3339</a> format.<br>
|
||||
"owner": { # The person who owns the community.<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
"id": "A String", # Unique identifier of the person who posted the comment. This is the person's OpenSocial ID.<br>
|
||||
},<br>
|
||||
"moderators": [ # The moderator of the community.<br>
|
||||
"moderators": [ # The list of moderators of the community.<br>
|
||||
{<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
@@ -125,7 +125,7 @@ Returns:<br>
|
||||
"co_owners": [ # The co-owners of the community.<br>
|
||||
{<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
|
||||
@@ -14,13 +14,13 @@
|
||||
<td width="100%">Methods defined here:<br>
|
||||
<dl><dt><a name="Resource-__init__"><strong>__init__</strong></a>(self)</dt></dl>
|
||||
|
||||
<dl><dt><a name="Resource-delete"><strong>delete</strong></a> = method(self, **kwargs)</dt><dd><tt>Removes an user from the followers of a community.<br>
|
||||
<dl><dt><a name="Resource-delete"><strong>delete</strong></a> = method(self, **kwargs)</dt><dd><tt>Removes a user from the followers of a community.<br>
|
||||
<br>
|
||||
Args:<br>
|
||||
userId: string, ID of the user. (required)<br>
|
||||
communityId: integer, ID of the community. (required)</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="Resource-insert"><strong>insert</strong></a> = method(self, **kwargs)</dt><dd><tt>Adds an user as a follower of a community.<br>
|
||||
<dl><dt><a name="Resource-insert"><strong>insert</strong></a> = method(self, **kwargs)</dt><dd><tt>Adds a user as a follower of a community.<br>
|
||||
<br>
|
||||
Args:<br>
|
||||
userId: string, ID of the user. (required)<br>
|
||||
|
||||
@@ -99,7 +99,7 @@ Returns:<br>
|
||||
"kind": "orkut#communityMembers", # Kind of this item. Always orkut#communityMembers.<br>
|
||||
}</tt></dd></dl>
|
||||
|
||||
<dl><dt><a name="Resource-list"><strong>list</strong></a> = method(self, **kwargs)</dt><dd><tt>Lists members of a community.<br>
|
||||
<dl><dt><a name="Resource-list"><strong>list</strong></a> = method(self, **kwargs)</dt><dd><tt>Lists members of a community. Use the pagination tokens to retrieve the full list; do not rely on the member count available in the community profile information to know when to stop iterating, as that count may be approximate.<br>
|
||||
<br>
|
||||
Args:<br>
|
||||
friendsOnly: boolean, Whether to list only community members who are friends of the user.<br>
|
||||
|
||||
@@ -40,7 +40,7 @@ Args:<br>
|
||||
],<br>
|
||||
"author": { # The creator of the message. If ommited, the message is annonimous.<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
@@ -71,7 +71,7 @@ Returns:<br>
|
||||
],<br>
|
||||
"author": { # The creator of the message. If ommited, the message is annonimous.<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
@@ -112,7 +112,7 @@ Returns:<br>
|
||||
],<br>
|
||||
"author": { # The creator of the message. If ommited, the message is annonimous.<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
|
||||
@@ -27,7 +27,7 @@ Args:<br>
|
||||
"id": 42, # The ID of the comment.<br>
|
||||
"author": { # The creator of the comment.<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
@@ -48,7 +48,7 @@ Returns:<br>
|
||||
"id": 42, # The ID of the comment.<br>
|
||||
"author": { # The creator of the comment.<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
@@ -79,7 +79,7 @@ Returns:<br>
|
||||
"id": 42, # The ID of the comment.<br>
|
||||
"author": { # The creator of the comment.<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
|
||||
@@ -43,7 +43,7 @@ Returns:<br>
|
||||
"totalNumberOfVotes": 42, # The total number of votes this poll has received.<br>
|
||||
"author": { # The person who created the poll.<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
@@ -110,7 +110,7 @@ Returns:<br>
|
||||
"totalNumberOfVotes": 42, # The total number of votes this poll has received.<br>
|
||||
"author": { # The person who created the poll.<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
|
||||
@@ -28,7 +28,7 @@ Returns:<br>
|
||||
{<br>
|
||||
"category": "A String", # The category of the community.<br>
|
||||
"kind": "orkut#community", # Identifies this resource as a community. Value: "orkut#community"<br>
|
||||
"member_count": 42, # The count of members on the community.<br>
|
||||
"member_count": 42, # The number of users who are part of the community. This number may be approximate, so do not rely on it for iteration.<br>
|
||||
"description": "A String", # The description of the community.<br>
|
||||
"language": "A String", # The official language of the community.<br>
|
||||
"links": [ # List of resources for the community.<br>
|
||||
@@ -42,16 +42,16 @@ Returns:<br>
|
||||
"creation_date": "A String", # The time the community was created, in <a href="http://www.rfc-editor.org/rfc/rfc3339.txt">RFC 3339</a> format.<br>
|
||||
"owner": { # The person who owns the community.<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
"id": "A String", # Unique identifier of the person who posted the comment. This is the person's OpenSocial ID.<br>
|
||||
},<br>
|
||||
"moderators": [ # The moderator of the community.<br>
|
||||
"moderators": [ # The list of moderators of the community.<br>
|
||||
{<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
@@ -62,7 +62,7 @@ Returns:<br>
|
||||
"co_owners": [ # The co-owners of the community.<br>
|
||||
{<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
|
||||
@@ -44,7 +44,7 @@ Returns:<br>
|
||||
],<br>
|
||||
"author": { # The creator of the topic.<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
@@ -65,7 +65,7 @@ Returns:<br>
|
||||
],<br>
|
||||
"author": { # The creator of the message. If ommited, the message is annonimous.<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
@@ -103,7 +103,7 @@ Args:<br>
|
||||
],<br>
|
||||
"author": { # The creator of the topic.<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
@@ -124,7 +124,7 @@ Args:<br>
|
||||
],<br>
|
||||
"author": { # The creator of the message. If ommited, the message is annonimous.<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
@@ -162,7 +162,7 @@ Returns:<br>
|
||||
],<br>
|
||||
"author": { # The creator of the topic.<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
@@ -183,7 +183,7 @@ Returns:<br>
|
||||
],<br>
|
||||
"author": { # The creator of the message. If ommited, the message is annonimous.<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
@@ -230,7 +230,7 @@ Returns:<br>
|
||||
],<br>
|
||||
"author": { # The creator of the topic.<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
@@ -251,7 +251,7 @@ Returns:<br>
|
||||
],<br>
|
||||
"author": { # The creator of the message. If ommited, the message is annonimous.<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<td width="100%">Methods defined here:<br>
|
||||
<dl><dt><a name="Resource-__init__"><strong>__init__</strong></a>(self)</dt></dl>
|
||||
|
||||
<dl><dt><a name="Resource-list"><strong>list</strong></a> = method(self, **kwargs)</dt><dd><tt>Retrieves the counters of an user.<br>
|
||||
<dl><dt><a name="Resource-list"><strong>list</strong></a> = method(self, **kwargs)</dt><dd><tt>Retrieves the counters of a user.<br>
|
||||
<br>
|
||||
Args:<br>
|
||||
userId: string, The ID of the user whose counters will be listed. Can be me to refer to caller. (required)<br>
|
||||
|
||||
@@ -47,7 +47,7 @@ Args:<br>
|
||||
"community": { # The community which is related with this activity, e.g. a joined community.<br>
|
||||
"category": "A String", # The category of the community.<br>
|
||||
"kind": "orkut#community", # Identifies this resource as a community. Value: "orkut#community"<br>
|
||||
"member_count": 42, # The count of members on the community.<br>
|
||||
"member_count": 42, # The number of users who are part of the community. This number may be approximate, so do not rely on it for iteration.<br>
|
||||
"description": "A String", # The description of the community.<br>
|
||||
"language": "A String", # The official language of the community.<br>
|
||||
"links": [ # List of resources for the community.<br>
|
||||
@@ -61,16 +61,16 @@ Args:<br>
|
||||
"creation_date": "A String", # The time the community was created, in <a href="http://www.rfc-editor.org/rfc/rfc3339.txt">RFC 3339</a> format.<br>
|
||||
"owner": { # The person who owns the community.<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
"id": "A String", # Unique identifier of the person who posted the comment. This is the person's OpenSocial ID.<br>
|
||||
},<br>
|
||||
"moderators": [ # The moderator of the community.<br>
|
||||
"moderators": [ # The list of moderators of the community.<br>
|
||||
{<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
@@ -81,7 +81,7 @@ Args:<br>
|
||||
"co_owners": [ # The co-owners of the community.<br>
|
||||
{<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
@@ -131,7 +131,7 @@ Args:<br>
|
||||
],<br>
|
||||
"actor": { # The person who posted the comment.<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
@@ -149,7 +149,7 @@ Args:<br>
|
||||
"updated": "A String", # The time at which the activity was last updated.<br>
|
||||
"actor": { # The person who performed the activity.<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
@@ -207,7 +207,7 @@ Returns:<br>
|
||||
"community": { # The community which is related with this activity, e.g. a joined community.<br>
|
||||
"category": "A String", # The category of the community.<br>
|
||||
"kind": "orkut#community", # Identifies this resource as a community. Value: "orkut#community"<br>
|
||||
"member_count": 42, # The count of members on the community.<br>
|
||||
"member_count": 42, # The number of users who are part of the community. This number may be approximate, so do not rely on it for iteration.<br>
|
||||
"description": "A String", # The description of the community.<br>
|
||||
"language": "A String", # The official language of the community.<br>
|
||||
"links": [ # List of resources for the community.<br>
|
||||
@@ -221,16 +221,16 @@ Returns:<br>
|
||||
"creation_date": "A String", # The time the community was created, in <a href="http://www.rfc-editor.org/rfc/rfc3339.txt">RFC 3339</a> format.<br>
|
||||
"owner": { # The person who owns the community.<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
"id": "A String", # Unique identifier of the person who posted the comment. This is the person's OpenSocial ID.<br>
|
||||
},<br>
|
||||
"moderators": [ # The moderator of the community.<br>
|
||||
"moderators": [ # The list of moderators of the community.<br>
|
||||
{<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
@@ -241,7 +241,7 @@ Returns:<br>
|
||||
"co_owners": [ # The co-owners of the community.<br>
|
||||
{<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
@@ -291,7 +291,7 @@ Returns:<br>
|
||||
],<br>
|
||||
"actor": { # The person who posted the comment.<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
@@ -309,7 +309,7 @@ Returns:<br>
|
||||
"updated": "A String", # The time at which the activity was last updated.<br>
|
||||
"actor": { # The person who performed the activity.<br>
|
||||
"url": "A String", # The URL of the author who posted the comment [not yet implemented]<br>
|
||||
"image": { # Image data about the actor.<br>
|
||||
"image": { # Image data about the author.<br>
|
||||
"url": "A String", # A URL that points to a thumbnail photo of the author.<br>
|
||||
},<br>
|
||||
"displayName": "A String", # The name of the author, suitable for display.<br>
|
||||
|
||||
@@ -17,26 +17,23 @@
|
||||
<dl><dt><a name="Resource-get"><strong>get</strong></a> = method(self, **kwargs)</dt><dd><tt>Returns a single product<br>
|
||||
<br>
|
||||
Args:<br>
|
||||
debug_searchResponse: boolean, Google Internal<br>
|
||||
taxonomy: string, Merchant taxonomy<br>
|
||||
recommendations_useGcsConfig: boolean, This parameter is currently ignored<br>
|
||||
productFields: string, Google Internal<br>
|
||||
accountId: integer, Merchant center account id (required)<br>
|
||||
source: string, Query source (required)<br>
|
||||
plusOne_enabled: boolean, Whether to return +1 button code<br>
|
||||
plusOne_options: string, +1 button rendering specification<br>
|
||||
recommendations_include: string, Recommendation specification<br>
|
||||
debug_enabled: boolean, Google Internal<br>
|
||||
source: string, Query source (required)<br>
|
||||
location: string, Location used to determine tax and shipping<br>
|
||||
debug_searchRequest: boolean, Google Internal<br>
|
||||
productId: string, Id of product (required)<br>
|
||||
productIdType: string, Type of productId (required)<br>
|
||||
debug_enableLogging: boolean, Google Internal<br>
|
||||
recommendations_enabled: boolean, Whether to return recommendation information<br>
|
||||
categories_enabled: boolean, Whether to return category information<br>
|
||||
attributeFilter: string, Comma separated list of attributes to return<br>
|
||||
categories_useGcsConfig: boolean, This parameter is currently ignored<br>
|
||||
thumbnails: string, Thumbnail specification<br>
|
||||
categories_include: string, Category specification<br>
|
||||
plusOne: string, +1 rendering specification.<br>
|
||||
plusOne_useGcsConfig: boolean, Whether to use +1 button styles configured in the GCS account<br>
|
||||
<br>
|
||||
Returns:<br>
|
||||
An object of the form<br>
|
||||
@@ -93,13 +90,16 @@ Returns:<br>
|
||||
"internal3": "A String", # Google Internal.<br>
|
||||
"internal4": [ # Google Internal.<br>
|
||||
{<br>
|
||||
"node": 42,<br>
|
||||
"confidence": 3.14,<br>
|
||||
"node": 42, # Google Internal.<br>
|
||||
"confidence": 3.14, # Google Internal.<br>
|
||||
},<br>
|
||||
],<br>
|
||||
"internal6": "A String", # Google Internal.<br>
|
||||
"internal7": True or False, # Google Internal.<br>
|
||||
"link": "A String", # Link to product.<br>
|
||||
"mpns": [ # List of all the product's MPNs.<br>
|
||||
"A String",<br>
|
||||
],<br>
|
||||
"attributes": [ # Attributes of product (available only with a cx source).<br>
|
||||
{<br>
|
||||
"type": "A String", # Type of product attribute (one of: text, bool, int, float, dateRange, url).<br>
|
||||
@@ -187,13 +187,16 @@ Returns:<br>
|
||||
"internal3": "A String", # Google Internal.<br>
|
||||
"internal4": [ # Google Internal.<br>
|
||||
{<br>
|
||||
"node": 42,<br>
|
||||
"confidence": 3.14,<br>
|
||||
"node": 42, # Google Internal.<br>
|
||||
"confidence": 3.14, # Google Internal.<br>
|
||||
},<br>
|
||||
],<br>
|
||||
"internal6": "A String", # Google Internal.<br>
|
||||
"internal7": True or False, # Google Internal.<br>
|
||||
"link": "A String", # Link to product.<br>
|
||||
"mpns": [ # List of all the product's MPNs.<br>
|
||||
"A String",<br>
|
||||
],<br>
|
||||
"attributes": [ # Attributes of product (available only with a cx source).<br>
|
||||
{<br>
|
||||
"type": "A String", # Type of product attribute (one of: text, bool, int, float, dateRange, url).<br>
|
||||
@@ -229,13 +232,16 @@ Returns:<br>
|
||||
},<br>
|
||||
},<br>
|
||||
],<br>
|
||||
"type": "A String", # Type of recommendation list (one of: all, purchaseToPurchase, visitToVisit, visitToPurchase).<br>
|
||||
"type": "A String", # Type of recommendation list (for offer-based recommendations, one of: all, purchaseToPurchase, visitToVisit, visitToPurchase, relatedItems; for category-based recommendations, one of: all, categoryMostVisited, categoryBestSeller).<br>
|
||||
},<br>
|
||||
],<br>
|
||||
"debug": { # Google internal.<br>
|
||||
"searchResponse": "A String", # Google internal.<br>
|
||||
"searchRequest": "A String", # Google internal.<br>
|
||||
"rdcResponse": "A String", # Google internal.<br>
|
||||
"facetsRequest": "A String", # Google internal.<br>
|
||||
"searchResponse": "A String", # Google internal.<br>
|
||||
"elapsedMillis": "A String", # Google internal.<br>
|
||||
"facetsResponse": "A String", # Google internal.<br>
|
||||
"backendTimes": [ # Google internal<br>
|
||||
{<br>
|
||||
"serverMillis": "A String", # Google internal<br>
|
||||
@@ -244,7 +250,6 @@ Returns:<br>
|
||||
"elapsedMillis": "A String", # Google internal<br>
|
||||
},<br>
|
||||
],<br>
|
||||
"elapsedMillis": "A String", # Google internal.<br>
|
||||
},<br>
|
||||
"id": "A String", # Id of product.<br>
|
||||
"categories": [ # List of categories for product.<br>
|
||||
@@ -263,57 +268,47 @@ Returns:<br>
|
||||
<br>
|
||||
Args:<br>
|
||||
facets_enabled: boolean, Whether to return facet information<br>
|
||||
debug_geocodeRequest: boolean, Google Internal<br>
|
||||
debug_searchResponse: boolean, Google Internal<br>
|
||||
debug_rdcRequest: boolean, Google Internal<br>
|
||||
rankBy: string, Ranking specification<br>
|
||||
taxonomy: string, Taxonomy name<br>
|
||||
promotions_enabled: boolean, Whether to return promotion information<br>
|
||||
debug_rdcResponse: boolean, Google Internal<br>
|
||||
productFields: string, Google Internal<br>
|
||||
channels: string, Channels specification<br>
|
||||
facets_discover: string, Facets to discover<br>
|
||||
currency: string, Currency restriction (ISO 4217)<br>
|
||||
startIndex: integer, Index (1-based) of first product to return<br>
|
||||
availability: string, Comma separated list of availabilities (outOfStock, limited, inStock, backOrder, preOrder, onDisplayToOrder) to return<br>
|
||||
crowdBy: string, Crowding specification<br>
|
||||
spelling_enabled: boolean, Whether to return spelling suggestions<br>
|
||||
debug_enabled: boolean, Google Internal<br>
|
||||
spelling_useGcsConfig: boolean, This parameter is currently ignored<br>
|
||||
categoryRecommendations_category: string, Category for which to retrieve recommendations<br>
|
||||
source: string, Query source (required)<br>
|
||||
categories_useGcsConfig: boolean, This parameter is currently ignored<br>
|
||||
categoryRecommendations_enabled: boolean, Whether to return category recommendation information<br>
|
||||
spelling_useGcsConfig: boolean, This parameter is currently ignored<br>
|
||||
plusOne_enabled: boolean, Whether to return +1 button code<br>
|
||||
useCase: string, One of CommerceSearchUseCase, ShoppingApiUseCase<br>
|
||||
debug_geocodeResponse: boolean, Google Internal<br>
|
||||
location: string, Location used to determine tax and shipping<br>
|
||||
maxVariants: integer, Maximum number of variant results to return per result<br>
|
||||
debug_searchRequest: boolean, Google Internal<br>
|
||||
relatedQueries_enabled: boolean, Whether to return related queries<br>
|
||||
facets_useGcsConfig: boolean, Whether to return facet information as configured in the GCS account<br>
|
||||
safe: boolean, Whether safe search is enabled. Default: true<br>
|
||||
categoryRecommendations_useGcsConfig: boolean, This parameter is currently ignored<br>
|
||||
boostBy: string, Boosting specification<br>
|
||||
debug_enableLogging: boolean, Google Internal<br>
|
||||
safe: boolean, Whether safe search is enabled. Default: true<br>
|
||||
maxResults: integer, Maximum number of results to return<br>
|
||||
categories_enabled: boolean, Whether to return category information<br>
|
||||
attributeFilter: string, Comma separated list of attributes to return<br>
|
||||
categories_useGcsConfig: boolean, This parameter is currently ignored<br>
|
||||
minAvailability: string, A parameter<br>
|
||||
Allowed values<br>
|
||||
inStock - Only in stcok prodicts will be returned<br>
|
||||
limited - Limited availability and in stock products will be returned<br>
|
||||
outOfStock - Out of stock, limited availability and in stock products will be returned<br>
|
||||
unknown - All products will be returned<br>
|
||||
categoryRecommendations_include: string, Category recommendation specification<br>
|
||||
plusOne_options: string, +1 button rendering specification<br>
|
||||
facets_include: string, Facets to include (applies when useGcsConfig == false)<br>
|
||||
categories_include: string, Category specification<br>
|
||||
thumbnails: string, Image thumbnails specification<br>
|
||||
language: string, Language restriction (BCP 47)<br>
|
||||
currency: string, Currency restriction (ISO 4217)<br>
|
||||
sayt_enabled: boolean, Google Internal<br>
|
||||
rankBy: string, Ranking specification<br>
|
||||
facets_discover: string, Facets to discover<br>
|
||||
categories_include: string, Category specification<br>
|
||||
redirects_enabled: boolean, Whether to return redirect information<br>
|
||||
restrictBy: string, Restriction specification<br>
|
||||
q: string, Search query<br>
|
||||
redirects_useGcsConfig: boolean, Whether to return redirect information as configured in the GCS account<br>
|
||||
sayt_useGcsConfig: boolean, Google Internal<br>
|
||||
country: string, Country restriction (ISO 3166)<br>
|
||||
plusOne_useGcsConfig: boolean, Whether to use +1 button styles configured in the GCS account<br>
|
||||
relatedQueries_useGcsConfig: boolean, This parameter is currently ignored<br>
|
||||
promotions_useGcsConfig: boolean, Whether to return promotion information as configured in the GCS account<br>
|
||||
plusOne: string, +1 rendering specification.<br>
|
||||
thumbnails: string, Image thumbnails specification<br>
|
||||
country: string, Country restriction (ISO 3166)<br>
|
||||
<br>
|
||||
Returns:<br>
|
||||
An object of the form<br>
|
||||
@@ -370,13 +365,16 @@ Returns:<br>
|
||||
"internal3": "A String", # Google Internal.<br>
|
||||
"internal4": [ # Google Internal.<br>
|
||||
{<br>
|
||||
"node": 42,<br>
|
||||
"confidence": 3.14,<br>
|
||||
"node": 42, # Google Internal.<br>
|
||||
"confidence": 3.14, # Google Internal.<br>
|
||||
},<br>
|
||||
],<br>
|
||||
"internal6": "A String", # Google Internal.<br>
|
||||
"internal7": True or False, # Google Internal.<br>
|
||||
"link": "A String", # Link to product.<br>
|
||||
"mpns": [ # List of all the product's MPNs.<br>
|
||||
"A String",<br>
|
||||
],<br>
|
||||
"attributes": [ # Attributes of product (available only with a cx source).<br>
|
||||
{<br>
|
||||
"type": "A String", # Type of product attribute (one of: text, bool, int, float, dateRange, url).<br>
|
||||
@@ -430,7 +428,8 @@ Returns:<br>
|
||||
"stores": [ # List of returned stores.<br>
|
||||
{<br>
|
||||
"storeCode": "A String", # Merchant-supplied store code.<br>
|
||||
"name": "A String", # Name of store.<br>
|
||||
"name": "A String", # Name of merchant.<br>
|
||||
"storeName": "A String", # Name of store.<br>
|
||||
"storeId": "A String", # Id of store.<br>
|
||||
"telephone": "A String", # Telephone number of store.<br>
|
||||
"location": "A String", # Location of store.<br>
|
||||
@@ -491,13 +490,16 @@ Returns:<br>
|
||||
"internal3": "A String", # Google Internal.<br>
|
||||
"internal4": [ # Google Internal.<br>
|
||||
{<br>
|
||||
"node": 42,<br>
|
||||
"confidence": 3.14,<br>
|
||||
"node": 42, # Google Internal.<br>
|
||||
"confidence": 3.14, # Google Internal.<br>
|
||||
},<br>
|
||||
],<br>
|
||||
"internal6": "A String", # Google Internal.<br>
|
||||
"internal7": True or False, # Google Internal.<br>
|
||||
"link": "A String", # Link to product.<br>
|
||||
"mpns": [ # List of all the product's MPNs.<br>
|
||||
"A String",<br>
|
||||
],<br>
|
||||
"attributes": [ # Attributes of product (available only with a cx source).<br>
|
||||
{<br>
|
||||
"type": "A String", # Type of product attribute (one of: text, bool, int, float, dateRange, url).<br>
|
||||
@@ -585,13 +587,16 @@ Returns:<br>
|
||||
"internal3": "A String", # Google Internal.<br>
|
||||
"internal4": [ # Google Internal.<br>
|
||||
{<br>
|
||||
"node": 42,<br>
|
||||
"confidence": 3.14,<br>
|
||||
"node": 42, # Google Internal.<br>
|
||||
"confidence": 3.14, # Google Internal.<br>
|
||||
},<br>
|
||||
],<br>
|
||||
"internal6": "A String", # Google Internal.<br>
|
||||
"internal7": True or False, # Google Internal.<br>
|
||||
"link": "A String", # Link to product.<br>
|
||||
"mpns": [ # List of all the product's MPNs.<br>
|
||||
"A String",<br>
|
||||
],<br>
|
||||
"attributes": [ # Attributes of product (available only with a cx source).<br>
|
||||
{<br>
|
||||
"type": "A String", # Type of product attribute (one of: text, bool, int, float, dateRange, url).<br>
|
||||
@@ -627,13 +632,16 @@ Returns:<br>
|
||||
},<br>
|
||||
},<br>
|
||||
],<br>
|
||||
"type": "A String", # Type of recommendation list (one of: all, purchaseToPurchase, visitToVisit, visitToPurchase).<br>
|
||||
"type": "A String", # Type of recommendation list (for offer-based recommendations, one of: all, purchaseToPurchase, visitToVisit, visitToPurchase, relatedItems; for category-based recommendations, one of: all, categoryMostVisited, categoryBestSeller).<br>
|
||||
},<br>
|
||||
],<br>
|
||||
"debug": { # Google internal.<br>
|
||||
"searchResponse": "A String", # Google internal.<br>
|
||||
"searchRequest": "A String", # Google internal.<br>
|
||||
"rdcResponse": "A String", # Google internal.<br>
|
||||
"facetsRequest": "A String", # Google internal.<br>
|
||||
"searchResponse": "A String", # Google internal.<br>
|
||||
"elapsedMillis": "A String", # Google internal.<br>
|
||||
"facetsResponse": "A String", # Google internal.<br>
|
||||
"backendTimes": [ # Google internal<br>
|
||||
{<br>
|
||||
"serverMillis": "A String", # Google internal<br>
|
||||
@@ -642,7 +650,6 @@ Returns:<br>
|
||||
"elapsedMillis": "A String", # Google internal<br>
|
||||
},<br>
|
||||
],<br>
|
||||
"elapsedMillis": "A String", # Google internal.<br>
|
||||
},<br>
|
||||
"id": "A String", # Id of product.<br>
|
||||
"categories": [ # List of categories for product.<br>
|
||||
@@ -682,17 +689,121 @@ Returns:<br>
|
||||
"A String",<br>
|
||||
],<br>
|
||||
"nextLink": "A String", # Next link of feed.<br>
|
||||
"relatedQueries": [ # Related queries.<br>
|
||||
"A String",<br>
|
||||
],<br>
|
||||
"totalItems": 42, # Total number of search results.<br>
|
||||
"startIndex": 42, # 1-based index of the first item in the search results.<br>
|
||||
"etag": "A String", # Etag of feed.<br>
|
||||
"requestId": "A String", # Unique identifier for this request.<br>
|
||||
"relatedQueries": [ # Related queries.<br>
|
||||
"A String",<br>
|
||||
"categoryRecommendations": [ # Recommendations for category.<br>
|
||||
{<br>
|
||||
"recommendationList": [ # List of recommendations.<br>
|
||||
{<br>
|
||||
"product": { # Recommended product.<br>
|
||||
"queryMatched": True or False, # Whether this product matched the user query. Only set for the variant offers (if any) attached to a product offer.<br>
|
||||
"gtin": "A String", # The first GTIN of the product. Deprecated in favor of "gtins".<br>
|
||||
"images": [ # Images of product.<br>
|
||||
{<br>
|
||||
"link": "A String", # Link to product image.<br>
|
||||
"thumbnails": [ # Thumbnails of product image.<br>
|
||||
{<br>
|
||||
"content": "A String", # Content of thumbnail (only available for the first thumbnail of the top results if SAYT is enabled).<br>
|
||||
"width": 42, # Width of thumbnail (omitted if not specified in the request).<br>
|
||||
"link": "A String", # Link to thumbnail.<br>
|
||||
"height": 42, # Height of thumbnail (omitted if not specified in the request).<br>
|
||||
},<br>
|
||||
],<br>
|
||||
},<br>
|
||||
],<br>
|
||||
"inventories": [ # Inventories of product.<br>
|
||||
{<br>
|
||||
"distance": 3.14, # Distance of product inventory.<br>
|
||||
"price": 3.14, # Price of product inventory.<br>
|
||||
"storeId": "A String", # Store ID of product inventory.<br>
|
||||
"tax": 3.14, # Tax of product inventory.<br>
|
||||
"shipping": 3.14, # Shipping cost of product inventory.<br>
|
||||
"currency": "A String", # Currency of product inventory (an ISO 4217 alphabetic code).<br>
|
||||
"distanceUnit": "A String", # Distance unit of product inventory.<br>
|
||||
"availability": "A String", # Availability of product inventory.<br>
|
||||
"channel": "A String", # Channel of product inventory (one of: online, local).<br>
|
||||
},<br>
|
||||
],<br>
|
||||
"author": { # Author of product.<br>
|
||||
"name": "A String", # Name of product author.<br>
|
||||
"accountId": "A String", # Account id of product author.<br>
|
||||
},<br>
|
||||
"condition": "A String", # Condition of product (one of: new, refurbished, used).<br>
|
||||
"providedId": "A String", # Merchant-provided id of product (available only with a cx source).<br>
|
||||
"internal8": [ # Google Internal.<br>
|
||||
"A String",<br>
|
||||
],<br>
|
||||
"description": "A String", # Description of product.<br>
|
||||
"gtins": [ # List of all the product's GTINs (in GTIN-14 format).<br>
|
||||
"A String",<br>
|
||||
],<br>
|
||||
"internal1": [ # Google Internal.<br>
|
||||
"A String",<br>
|
||||
],<br>
|
||||
"brand": "A String", # Brand of product.<br>
|
||||
"internal3": "A String", # Google Internal.<br>
|
||||
"internal4": [ # Google Internal.<br>
|
||||
{<br>
|
||||
"node": 42, # Google Internal.<br>
|
||||
"confidence": 3.14, # Google Internal.<br>
|
||||
},<br>
|
||||
],<br>
|
||||
"internal6": "A String", # Google Internal.<br>
|
||||
"internal7": True or False, # Google Internal.<br>
|
||||
"link": "A String", # Link to product.<br>
|
||||
"mpns": [ # List of all the product's MPNs.<br>
|
||||
"A String",<br>
|
||||
],<br>
|
||||
"attributes": [ # Attributes of product (available only with a cx source).<br>
|
||||
{<br>
|
||||
"type": "A String", # Type of product attribute (one of: text, bool, int, float, dateRange, url).<br>
|
||||
"value": "", # Value of product attribute.<br>
|
||||
"displayName": "A String", # Display Name of prodct attribute.<br>
|
||||
"name": "A String", # Name of product attribute.<br>
|
||||
"unit": "A String", # Unit of product attribute.<br>
|
||||
},<br>
|
||||
],<br>
|
||||
"totalMatchingVariants": 42, # The number of variant offers returned that matched the query.<br>
|
||||
"variants": [ # A list of variant offers associated with this product.<br>
|
||||
{<br>
|
||||
"variant": # Object with schema name: ShoppingModelProductJsonV1 # The detailed offer data for a particular variant offer.<br>
|
||||
},<br>
|
||||
],<br>
|
||||
"modificationTime": "A String", # <a href="http://www.rfc-editor.org/rfc/rfc3339.txt">RFC 3339</a> formatted modification time and date of product.<br>
|
||||
"categories": [ # Categories of product according to the selected taxonomy, omitted if no taxonomy is selected.<br>
|
||||
"A String",<br>
|
||||
],<br>
|
||||
"language": "A String", # BCP 47 language tag of language of product.<br>
|
||||
"country": "A String", # ISO 3166 code of target country of product.<br>
|
||||
"title": "A String", # Title of product.<br>
|
||||
"creationTime": "A String", # <a href="http://www.rfc-editor.org/rfc/rfc3339.txt">RFC 3339</a> formatted creation time and date of product.<br>
|
||||
"internal14": 3.14, # Google Internal.<br>
|
||||
"internal12": "A String", # Google Internal.<br>
|
||||
"internal13": 3.14, # Google Internal.<br>
|
||||
"internal10": [ # Google Internal.<br>
|
||||
"A String",<br>
|
||||
],<br>
|
||||
"plusOne": "A String", # Code to add to the page to render the +1 content.<br>
|
||||
"googleId": "A String", # Google id of product.<br>
|
||||
"internal15": 3.14, # Google Internal.<br>
|
||||
},<br>
|
||||
},<br>
|
||||
],<br>
|
||||
"type": "A String", # Type of recommendation list (for offer-based recommendations, one of: all, purchaseToPurchase, visitToVisit, visitToPurchase, relatedItems; for category-based recommendations, one of: all, categoryMostVisited, categoryBestSeller).<br>
|
||||
},<br>
|
||||
],<br>
|
||||
"debug": { # Google internal.<br>
|
||||
"searchResponse": "A String", # Google internal.<br>
|
||||
"searchRequest": "A String", # Google internal.<br>
|
||||
"rdcResponse": "A String", # Google internal.<br>
|
||||
"facetsRequest": "A String", # Google internal.<br>
|
||||
"searchResponse": "A String", # Google internal.<br>
|
||||
"elapsedMillis": "A String", # Google internal.<br>
|
||||
"facetsResponse": "A String", # Google internal.<br>
|
||||
"backendTimes": [ # Google internal<br>
|
||||
{<br>
|
||||
"serverMillis": "A String", # Google internal<br>
|
||||
@@ -701,7 +812,6 @@ Returns:<br>
|
||||
"elapsedMillis": "A String", # Google internal<br>
|
||||
},<br>
|
||||
],<br>
|
||||
"elapsedMillis": "A String", # Google internal.<br>
|
||||
},<br>
|
||||
"spelling": { # Spelling.<br>
|
||||
"suggestion": "A String", # Suggestion for spelling.<br>
|
||||
|
||||
@@ -15,7 +15,6 @@ $1 runtests.py tests/test_oauth2client_django_orm.py
|
||||
$1 runtests.py tests/test_oauth2client_file.py
|
||||
$1 runtests.py tests/test_oauth2client_jwt.py
|
||||
$1 runtests.py tests/test_oauth2client.py
|
||||
$1 runtests.py tests/test_oauth.py
|
||||
$1 runtests.py tests/test_protobuf_model.py
|
||||
$1 runtests.py tests/test_schema.py
|
||||
$1 runtests.py tests/test_oauth2client_appengine.py
|
||||
|
||||
1
setup.py
1
setup.py
@@ -31,7 +31,6 @@ packages = [
|
||||
|
||||
install_requires = [
|
||||
'httplib2>=0.7.4',
|
||||
'oauth2',
|
||||
'python-gflags',
|
||||
]
|
||||
|
||||
|
||||
@@ -1,78 +0,0 @@
|
||||
#!/usr/bin/python2.4
|
||||
#
|
||||
# Copyright 2010 Google Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
|
||||
"""Oauth tests
|
||||
|
||||
Unit tests for apiclient.oauth.
|
||||
"""
|
||||
|
||||
__author__ = 'jcgregorio@google.com (Joe Gregorio)'
|
||||
|
||||
# Do not remove the httplib2 import
|
||||
import httplib2
|
||||
import unittest
|
||||
|
||||
from apiclient.http import HttpMockSequence
|
||||
from apiclient.oauth import CredentialsInvalidError
|
||||
from apiclient.oauth import MissingParameter
|
||||
from apiclient.oauth import TwoLeggedOAuthCredentials
|
||||
|
||||
|
||||
class TwoLeggedOAuthCredentialsTests(unittest.TestCase):
|
||||
|
||||
def setUp(self):
|
||||
client_id = "some_client_id"
|
||||
client_secret = "cOuDdkfjxxnv+"
|
||||
user_agent = "sample/1.0"
|
||||
self.credentials = TwoLeggedOAuthCredentials(client_id, client_secret,
|
||||
user_agent)
|
||||
self.credentials.requestor = 'test@example.org'
|
||||
|
||||
def test_invalid_token(self):
|
||||
http = HttpMockSequence([
|
||||
({'status': '401'}, ''),
|
||||
])
|
||||
http = self.credentials.authorize(http)
|
||||
try:
|
||||
resp, content = http.request("http://example.com")
|
||||
self.fail('should raise CredentialsInvalidError')
|
||||
except CredentialsInvalidError:
|
||||
pass
|
||||
|
||||
def test_no_requestor(self):
|
||||
self.credentials.requestor = None
|
||||
http = HttpMockSequence([
|
||||
({'status': '401'}, ''),
|
||||
])
|
||||
http = self.credentials.authorize(http)
|
||||
try:
|
||||
resp, content = http.request("http://example.com")
|
||||
self.fail('should raise MissingParameter')
|
||||
except MissingParameter:
|
||||
pass
|
||||
|
||||
def test_add_requestor_to_uri(self):
|
||||
http = HttpMockSequence([
|
||||
({'status': '200'}, 'echo_request_uri'),
|
||||
])
|
||||
http = self.credentials.authorize(http)
|
||||
resp, content = http.request("http://example.com")
|
||||
self.assertEqual('http://example.com?xoauth_requestor_id=test%40example.org',
|
||||
content)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user