def __init__(self, id_type=IdentityTypes.adobeID, email=None, username=None, domain=None, **kwargs):
if id_type in IdentityTypes.__members__:<EOL><INDENT>id_type = IdentityTypes[id_type]<EOL><DEDENT>if id_type not in IdentityTypes:<EOL><INDENT>raise ArgumentError("<STR_LIT>" % (id_type, [i.name for i in IdentityTypes]))<EOL><DEDENT>self.id_type = id_type<EOL>self.email = None<EOL>self.domain = None<EOL>if username is not None:<EOL><INDENT>if email and username.lower() == email.lower():<EOL><INDENT>username = None<EOL><DEDENT>elif id_type is not IdentityTypes.federatedID:<EOL><INDENT>raise ArgumentError("<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>if domain:<EOL><INDENT>self.domain = domain<EOL><DEDENT><DEDENT><DEDENT>if email is not None:<EOL><INDENT>if '<STR_LIT:@>' not in email:<EOL><INDENT>raise ArgumentError("<STR_LIT>" % email)<EOL><DEDENT>self.email = email<EOL>if not self.domain:<EOL><INDENT>atpos = email.index('<STR_LIT:@>')<EOL>self.domain = email[atpos + <NUM_LIT:1>:]<EOL><DEDENT><DEDENT>elif not username:<EOL><INDENT>raise ArgumentError("<STR_LIT>")<EOL><DEDENT>elif not domain:<EOL><INDENT>raise ArgumentError("<STR_LIT>")<EOL><DEDENT>if username:<EOL><INDENT>Action.__init__(self, user=username, domain=self.domain, **kwargs)<EOL><DEDENT>elif id_type == IdentityTypes.adobeID:<EOL><INDENT>Action.__init__(self, user=email, useAdobeID=True, **kwargs)<EOL><DEDENT>else:<EOL><INDENT>Action.__init__(self, user=email, **kwargs)<EOL><DEDENT>
Create an Action for a user identified either by email or by username and domain.
You should pretty much always use just email, unless the user has a Federated ID and his
username is different from his email.  In that case you can give either username and email
(and we'll get the domain from his email) or the username and domain (in case you don't
know or don't care about the user's email).
Note that the identity type determines what you can do with this user.  For example,
create will create a user of the specified identity type.  Similarly, each identity type restricts
what fields can be updated.  If you are specifying an existing user by email, and you are not
sure what identity type the existing user is, and you are doing something (such as add_to_groups)
that can be done with any identity type, then you can specify any type, and the type you specify
will be used to break ties if there is both an AdobeID and an EnterpriseID or FederatedID user
with that same email.  Normally, we choose Enterprise ID or Federated ID *over* Adobe ID, but
if you specify the type as Adobe ID then we will act on the Adobe ID user instead.
:param id_type: IdentityTypes enum value (or the name of one), defaults to adobeID
:param email: The user's email.  Typically this is also the user's username.
:param username: The username on the Adobe side.  If it's the same as email, it's ignored.
:param domain: string, needed only if you specified a username but NOT an email.
:param kwargs: other key/value pairs for the action, such as requestID