APIConstants.py 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. # coding=utf-8
  2. class Constants(object):
  3. def __init__(self):
  4. pass
  5. def enum(**self):
  6. return type('Enum', (), self)
  7. __VERSION__ = '1.0'
  8. __HTTP_GET__ = 0
  9. __HTTP_POST__ = 1
  10. _METHOD_MAP = {'GET': __HTTP_GET__, 'POST': __HTTP_POST__}
  11. http_server = "https://api-push.vivo.com.cn"
  12. '''
  13. targetMessage parameter name
  14. '''
  15. http_param_reg_ids = "regIds"
  16. http_param_aliases = "aliases"
  17. http_param_task_id = "taskId"
  18. '''
  19. pushMessage parameter name
  20. '''
  21. http_param_tag_expression = "tagExpression"
  22. http_param_or_tags = "orTags"
  23. http_param_and_tags = "andTags"
  24. http_param_not_tags = "notTags"
  25. http_param_segment_name = "segmentName"
  26. http_param_reg_id = "regId"
  27. http_param_content = "content"
  28. http_param_title = "title"
  29. http_param_ali_as = "alias"
  30. http_param_notify_type = "notifyType"
  31. http_param_time_to_live = "timeToLive"
  32. http_param_skip_type = "skipType"
  33. http_param_skip_content = "skipContent"
  34. http_param_network_type = "networkType"
  35. http_param_client_custom_map = "clientCustomMap"
  36. http_param_extra = "extra"
  37. http_param_callback = "callback"
  38. http_param_callback_param = "callback.param"
  39. http_param_request_id = "requestId"
  40. http_param_classification = "classification"
  41. http_param_push_mode = "pushMode"
  42. http_param_task_ids = "taskIds"
  43. '''
  44. tagMessage parameter name
  45. '''
  46. http_param_name = "name"
  47. http_param_old_name = "oldName"
  48. http_param_new_name = "newName"
  49. http_param_desc = "desc"
  50. http_param_group = "group"
  51. http_param_type = "type"
  52. http_param_ids = "ids"
  53. http_param_tag_list = "tagList"
  54. http_param_expression = "expression"
  55. request_path = enum(
  56. GET_TOKEN=["/message/auth"],
  57. PUSH_TO_SINGLE=['/message/send'],
  58. SAVE_LIST_PAYLOAD=['/message/saveListPayload '],
  59. PUSH_TO_LIST=['/message/pushToList'],
  60. PUSH_TO_ALL=['/message/all'],
  61. PUSH_TO_TAG=['/message/tagPush'],
  62. GET_STATISTICS=['/report/getStatistics'],
  63. ADD_TAG=['/tag/add'],
  64. UPDATE_TAG=['/tag/update'],
  65. ADD_MEMBERS=['/tag/addMembers'],
  66. REMOVE_MEMBERS=['/tag/removeMembers'],
  67. ADD_TAG_GROUP=['/tagGroup/add'],
  68. UPDATE_TAG_GROUP=['/tagGroup/update'],
  69. ADD_TAG_TO_GROUP=['/tagGroup/addToGroup'],
  70. ADD_TAG_SEGMENT=['/tagSegment/add'],
  71. UPDATE_TAG_SEGMENT=['/tagSegment/update'],
  72. )