def _processSendAs(user, i, count, entityType, emailAddress, j, jcount, gmail, function, formatSig, **kwargs):
userDefined = True
try:
result = callGAPI(gmail.users().settings().sendAs(), function,
throw_reasons=GAPI.GMAIL_THROW_REASONS+[GAPI.NOT_FOUND, GAPI.ALREADY_EXISTS, GAPI.DUPLICATE, GAPI.CANNOT_DELETE_PRIMARY_SENDAS, GAPI.INVALID_ARGUMENT],
userId=u'me', **kwargs)
if function == u'get':
_showSendAs(result, j, jcount, formatSig)
else:
entityActionPerformed([Ent.USER, user, entityType, emailAddress], j, jcount)
except (GAPI.notFound, GAPI.alreadyExists, GAPI.duplicate, GAPI.cannotDeletePrimarySendAs, GAPI.invalidArgument) as e:
entityActionFailedWarning([Ent.USER, user, entityType, emailAddress], str(e), j, jcount)
except (GAPI.serviceNotAvailable, GAPI.badRequest):
entityServiceNotApplicableWarning(Ent.USER, user, i, count)
userDefined = False
return userDefined
评论列表
文章目录