def to_dict(self):
    keys = ['user_id', 'role_id', 'domain_id', 'domain_scope_id', 'project_id', 'audit_id', 'audit_chain_id']
    event = {key: self.__dict__[key] for key in keys if (self.__dict__[key] is not None)}
    if (self.trust_id is not None):
        event['OS-TRUST:trust_id'] = self.trust_id
    if (self.consumer_id is not None):
        event['OS-OAUTH1:consumer_id'] = self.consumer_id
    if (self.consumer_id is not None):
        event['OS-OAUTH1:access_token_id'] = self.access_token_id
    if (self.expires_at is not None):
        event['expires_at'] = utils.isotime(self.expires_at)
    if (self.issued_before is not None):
        event['issued_before'] = utils.isotime(self.issued_before, subsecond=True)
    return event
def to_dict(self):
    keys = ['user_id', 'role_id', 'domain_id', 'domain_scope_id', 'project_id', 'audit_id', 'audit_chain_id']
    event = {key: self.__dict__[key] for key in keys if (self.__dict__[key] is not None)}
    if (self.trust_id is not None):
        event['OS-TRUST:trust_id'] = self.trust_id
    if (self.consumer_id is not None):
        event['OS-OAUTH1:consumer_id'] = self.consumer_id
    if (self.consumer_id is not None):
        event['OS-OAUTH1:access_token_id'] = self.access_token_id
    if (self.expires_at is not None):
        event['expires_at'] = utils.isotime(self.expires_at)
    if (self.issued_before is not None):
        event['issued_before'] = utils.isotime(self.issued_before, subsecond=True)
    return event