View source on GitHub
|
A stub for the AppIdentityService API for offline development.
Inherits From: AppIdentityServiceStubBase, APIProxyStub, expected_type
google.appengine.api.app_identity.app_identity_defaultcredentialsbased_stub.DefaultCredentialsBasedAppIdentityServiceStub(
service_name='app_identity_service'
)
Provides stub functions which allow a developer to test integration before deployment.
Methods
Clear
Clear()
Resets the state on the App Identity stub.
Create
@staticmethodCreate( email_address=None, private_key_path=None, oauth_url=None )
CreateRPC
CreateRPC()
Creates RPC object instance.
| Returns | |
|---|---|
| An instance of RPC. |
MakeSyncCall
MakeSyncCall(
service, call, request, response, request_id=None
)
The main RPC entry point.
| Args | |
|---|---|
service
|
Must be name as provided to service_name of constructor.
|
call
|
A string representing the rpc to make. Must be part of
the underlying services methods and impemented by _Dynamic_<call>.
|
request
|
A protocol buffer of the type corresponding to call.
|
response
|
A protocol buffer of the type corresponding to call.
|
request_id
|
A unique string identifying the request associated with the API call. |
SetDefaultGcsBucketName
SetDefaultGcsBucketName(
default_gcs_bucket_name
)
SetError
SetError(
error, method=None, error_rate=1
)
Set an error condition that may be raised when calls made to stub.
If a method is specified, the error will only apply to that call. The error rate is applied to the method specified or all calls if method is not set.
| Args | |
|---|---|
error
|
An instance of apiproxy_errors.Error or None for no error.
|
method
|
A string representing the method that the error will affect. |
error_rate
|
a number from [0, 1] that sets the chance of the error,
defaults to 1.
|
get_service_account_name
get_service_account_name()
get_service_account_token
get_service_account_token(
scopes, service_account=None
)
Implementation of AppIdentityService::GetAccessToken.
This API requires internet access.
| Args | |
|---|---|
scopes
|
a list of oauth2 scopes. |
service_account
|
the service account to get the token for |
| Returns | |
|---|---|
| Tuple of access token and expiration time in epoch |
| Raises | |
|---|---|
RuntimeError
|
If unexpected response from Google server. |
Class Variables | |
|---|---|
| THREADSAFE |
True
|
View source on GitHub