google.cloud.forseti.common.gcp_type.service_account module

A Service Acccount object along with it’s USER_MANAGED keys.

See: https://cloud.google.com/iam/reference/rest/v1/projects.serviceAccounts https://cloud.google.com/iam/reference/rest/v1/projects.serviceAccounts.keys

class ServiceAccount(project_id, full_name, display_name, name, unique_id, email, oauth2_client_id, raw_json, keys=None)[source]

Bases: object

A Service Acccount object along with it’s USER_MANAGED keys.

__hash__()[source]

Return hash of properties. :returns: The hash of the class properties. :rtype: hash

__repr__()[source]

String representation. :returns: Json string. :rtype: str

classmethod from_dict(project_id, full_name, service_account, keys)[source]

Returns a new ServiceAccount object from dict.

Parameters:
  • project_id (str) – The project id.
  • full_name (str) – The full path, including ancestors
  • service_account (dict) – ServiceAccount dict
  • keys (list) – A list of dicsts of USER_MANAGED keys for the above ServiceAccount
Returns:

A new ServiceAccount object

Return type:

ServiceAccount

static from_json(project_id, full_name, service_account, service_account_keys=None)[source]

Returns a new ServiceAccount object from json data.

Parameters:
  • project_id (str) – The project id.
  • full_name (str) – The full path, including ancestors
  • service_account (str) – The json string representations of the ServiceAccount
  • service_account_keys (list) – List of json strings of keys
Returns:

A new ServiceAccount object

Return type:

ServiceAccount