jpsclient 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/bin/jpsclient +28 -0
- data/lib/jpsclient/api/app_level.rb +138 -0
- data/lib/jpsclient/api/app_resource.rb +164 -0
- data/lib/jpsclient/api/app_resource_version.rb +52 -0
- data/lib/jpsclient/api/apple_account.rb +140 -0
- data/lib/jpsclient/api/application.rb +268 -0
- data/lib/jpsclient/api/application_category.rb +120 -0
- data/lib/jpsclient/api/application_design.rb +118 -0
- data/lib/jpsclient/api/application_income.rb +54 -0
- data/lib/jpsclient/api/application_sales.rb +52 -0
- data/lib/jpsclient/api/application_version.rb +77 -0
- data/lib/jpsclient/api/assets_category.rb +120 -0
- data/lib/jpsclient/api/bug.rb +140 -0
- data/lib/jpsclient/api/cert.rb +27 -0
- data/lib/jpsclient/api/client.rb +268 -0
- data/lib/jpsclient/api/collect.rb +52 -0
- data/lib/jpsclient/api/collection.rb +162 -0
- data/lib/jpsclient/api/commit_log.rb +104 -0
- data/lib/jpsclient/api/creative.rb +52 -0
- data/lib/jpsclient/api/custom_application.rb +230 -0
- data/lib/jpsclient/api/custom_application_web.rb +52 -0
- data/lib/jpsclient/api/document_text.rb +30 -0
- data/lib/jpsclient/api/experience.rb +143 -0
- data/lib/jpsclient/api/experience_category.rb +97 -0
- data/lib/jpsclient/api/fgui_export.rb +52 -0
- data/lib/jpsclient/api/file.rb +84 -0
- data/lib/jpsclient/api/game_assets.rb +140 -0
- data/lib/jpsclient/api/healthy.rb +30 -0
- data/lib/jpsclient/api/icon_and_snapshot.rb +54 -0
- data/lib/jpsclient/api/idea.rb +121 -0
- data/lib/jpsclient/api/jssdk.rb +30 -0
- data/lib/jpsclient/api/lark_bitable.rb +30 -0
- data/lib/jpsclient/api/lark_chat_group.rb +30 -0
- data/lib/jpsclient/api/lark_comment.rb +118 -0
- data/lib/jpsclient/api/lark_task.rb +140 -0
- data/lib/jpsclient/api/lark_task_list.rb +118 -0
- data/lib/jpsclient/api/lark_task_section.rb +74 -0
- data/lib/jpsclient/api/lark_user.rb +30 -0
- data/lib/jpsclient/api/lark_wiki_node.rb +30 -0
- data/lib/jpsclient/api/lark_wiki_space.rb +30 -0
- data/lib/jpsclient/api/lazy_client.rb +290 -0
- data/lib/jpsclient/api/login.rb +96 -0
- data/lib/jpsclient/api/m3u8.rb +30 -0
- data/lib/jpsclient/api/menu.rb +143 -0
- data/lib/jpsclient/api/modular_client.rb +228 -0
- data/lib/jpsclient/api/project.rb +46 -0
- data/lib/jpsclient/api/project_package.rb +249 -0
- data/lib/jpsclient/api/publisher.rb +165 -0
- data/lib/jpsclient/api/publisher_category.rb +142 -0
- data/lib/jpsclient/api/publisher_group.rb +118 -0
- data/lib/jpsclient/api/publisher_group_category.rb +120 -0
- data/lib/jpsclient/api/requirements.rb +143 -0
- data/lib/jpsclient/api/requirements_category.rb +97 -0
- data/lib/jpsclient/api/resource_category.rb +120 -0
- data/lib/jpsclient/api/role.rb +165 -0
- data/lib/jpsclient/api/simple_search.rb +162 -0
- data/lib/jpsclient/api/sketch.rb +74 -0
- data/lib/jpsclient/api/sketch_category.rb +97 -0
- data/lib/jpsclient/api/sov.rb +30 -0
- data/lib/jpsclient/api/statistics.rb +30 -0
- data/lib/jpsclient/api/store.rb +30 -0
- data/lib/jpsclient/api/survey.rb +143 -0
- data/lib/jpsclient/api/survey_category.rb +97 -0
- data/lib/jpsclient/api/tag.rb +142 -0
- data/lib/jpsclient/api/tool.rb +121 -0
- data/lib/jpsclient/api/tool_category.rb +120 -0
- data/lib/jpsclient/api/trending.rb +30 -0
- data/lib/jpsclient/api/ud_id.rb +118 -0
- data/lib/jpsclient/api/user.rb +99 -0
- data/lib/jpsclient/api/util.rb +30 -0
- data/lib/jpsclient/api/video_cover.rb +30 -0
- data/lib/jpsclient/api/webhook.rb +118 -0
- data/lib/jpsclient/api/workflow.rb +118 -0
- data/lib/jpsclient/auth/auth.rb +676 -0
- data/lib/jpsclient/auth/token.rb +209 -0
- data/lib/jpsclient/base/api_config.rb +225 -0
- data/lib/jpsclient/base/exception.rb +5 -0
- data/lib/jpsclient/http/http_client.rb +148 -0
- data/lib/jpsclient/upload/upload_client.rb +334 -0
- data/lib/jpsclient/upload/upload_config.rb +128 -0
- data/lib/jpsclient/upload/upload_progress.rb +73 -0
- data/lib/jpsclient/utils/aes.rb +49 -0
- data/lib/jpsclient/utils/logger.rb +38 -0
- data/lib/jpsclient/version.rb +3 -0
- data/lib/jpsclient.rb +34 -0
- metadata +269 -0
@@ -0,0 +1,118 @@
|
|
1
|
+
module JPSClient
|
2
|
+
module API
|
3
|
+
# UdId 相关 API
|
4
|
+
# 自动生成的模块,处理 ud_id 相关接口
|
5
|
+
module UdId
|
6
|
+
|
7
|
+
# Create Update
|
8
|
+
#
|
9
|
+
# @param params [Hash] 请求参数
|
10
|
+
# @return [Hash] API响应
|
11
|
+
def create_update(params: {})
|
12
|
+
config = @request_config && @request_config["ud_id_update"]
|
13
|
+
raise JPSClient::ExceptionError, "Missing config for ud_id_update" unless config && config["url"]
|
14
|
+
|
15
|
+
path = config["url"]
|
16
|
+
|
17
|
+
response = @http_client.post(path, body: params)
|
18
|
+
result = JPSClient::Response.new(response)
|
19
|
+
|
20
|
+
if result.need_login?
|
21
|
+
do_login(force_login: true)
|
22
|
+
response = @http_client.post(path, body: params)
|
23
|
+
result = JPSClient::Response.new(response)
|
24
|
+
end
|
25
|
+
|
26
|
+
return result.to_h
|
27
|
+
end
|
28
|
+
|
29
|
+
# Create Delete
|
30
|
+
#
|
31
|
+
# @param params [Hash] 请求参数
|
32
|
+
# @return [Hash] API响应
|
33
|
+
def create_delete(params: {})
|
34
|
+
config = @request_config && @request_config["ud_id_delete"]
|
35
|
+
raise JPSClient::ExceptionError, "Missing config for ud_id_delete" unless config && config["url"]
|
36
|
+
|
37
|
+
path = config["url"]
|
38
|
+
|
39
|
+
response = @http_client.post(path, body: params)
|
40
|
+
result = JPSClient::Response.new(response)
|
41
|
+
|
42
|
+
if result.need_login?
|
43
|
+
do_login(force_login: true)
|
44
|
+
response = @http_client.post(path, body: params)
|
45
|
+
result = JPSClient::Response.new(response)
|
46
|
+
end
|
47
|
+
|
48
|
+
return result.to_h
|
49
|
+
end
|
50
|
+
|
51
|
+
# Create Create
|
52
|
+
#
|
53
|
+
# @param params [Hash] 请求参数
|
54
|
+
# @return [Hash] API响应
|
55
|
+
def create_create(params: {})
|
56
|
+
config = @request_config && @request_config["ud_id_create"]
|
57
|
+
raise JPSClient::ExceptionError, "Missing config for ud_id_create" unless config && config["url"]
|
58
|
+
|
59
|
+
path = config["url"]
|
60
|
+
|
61
|
+
response = @http_client.post(path, body: params)
|
62
|
+
result = JPSClient::Response.new(response)
|
63
|
+
|
64
|
+
if result.need_login?
|
65
|
+
do_login(force_login: true)
|
66
|
+
response = @http_client.post(path, body: params)
|
67
|
+
result = JPSClient::Response.new(response)
|
68
|
+
end
|
69
|
+
|
70
|
+
return result.to_h
|
71
|
+
end
|
72
|
+
|
73
|
+
# Get List
|
74
|
+
#
|
75
|
+
# @param params [Hash] 请求参数
|
76
|
+
# @return [Hash] API响应
|
77
|
+
def get_list(params: {})
|
78
|
+
config = @request_config && @request_config["ud_id_list"]
|
79
|
+
raise JPSClient::ExceptionError, "Missing config for ud_id_list" unless config && config["url"]
|
80
|
+
|
81
|
+
path = config["url"]
|
82
|
+
|
83
|
+
response = @http_client.get(path, params: params)
|
84
|
+
result = JPSClient::Response.new(response)
|
85
|
+
|
86
|
+
if result.need_login?
|
87
|
+
do_login(force_login: true)
|
88
|
+
response = @http_client.get(path, params: params)
|
89
|
+
result = JPSClient::Response.new(response)
|
90
|
+
end
|
91
|
+
|
92
|
+
return result.to_h
|
93
|
+
end
|
94
|
+
|
95
|
+
# Get Detail
|
96
|
+
#
|
97
|
+
# @param params [Hash] 请求参数
|
98
|
+
# @return [Hash] API响应
|
99
|
+
def get_detail(params: {})
|
100
|
+
config = @request_config && @request_config["ud_id_detail"]
|
101
|
+
raise JPSClient::ExceptionError, "Missing config for ud_id_detail" unless config && config["url"]
|
102
|
+
|
103
|
+
path = config["url"]
|
104
|
+
|
105
|
+
response = @http_client.get(path, params: params)
|
106
|
+
result = JPSClient::Response.new(response)
|
107
|
+
|
108
|
+
if result.need_login?
|
109
|
+
do_login(force_login: true)
|
110
|
+
response = @http_client.get(path, params: params)
|
111
|
+
result = JPSClient::Response.new(response)
|
112
|
+
end
|
113
|
+
|
114
|
+
return result.to_h
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
@@ -0,0 +1,99 @@
|
|
1
|
+
module JPSClient
|
2
|
+
module API
|
3
|
+
# User 相关 API
|
4
|
+
# 自动生成的模块,处理 user 相关接口
|
5
|
+
module User
|
6
|
+
|
7
|
+
# Get User Detail
|
8
|
+
#
|
9
|
+
# @param params [Hash] 请求参数
|
10
|
+
# @return [Hash] API响应
|
11
|
+
def get_user_detail(userId:, params: {})
|
12
|
+
config = @request_config && @request_config["user_user_detail"]
|
13
|
+
raise JPSClient::ExceptionError, "Missing config for user_user_detail" unless config && config["url"]
|
14
|
+
|
15
|
+
path = config["url"]
|
16
|
+
path = path.gsub("{userId}", userId.to_s)
|
17
|
+
|
18
|
+
response = @http_client.get(path, params: params)
|
19
|
+
result = JPSClient::Response.new(response)
|
20
|
+
|
21
|
+
if result.need_login?
|
22
|
+
do_login(force_login: true)
|
23
|
+
response = @http_client.get(path, params: params)
|
24
|
+
result = JPSClient::Response.new(response)
|
25
|
+
end
|
26
|
+
|
27
|
+
return result.to_h
|
28
|
+
end
|
29
|
+
|
30
|
+
# Update User
|
31
|
+
#
|
32
|
+
# @param params [Hash] 请求参数
|
33
|
+
# @return [Hash] API响应
|
34
|
+
def update_user(userId:, params: {})
|
35
|
+
config = @request_config && @request_config["user_user"]
|
36
|
+
raise JPSClient::ExceptionError, "Missing config for user_user" unless config && config["url"]
|
37
|
+
|
38
|
+
path = config["url"]
|
39
|
+
path = path.gsub("{userId}", userId.to_s)
|
40
|
+
|
41
|
+
response = @http_client.put(path, body: params)
|
42
|
+
result = JPSClient::Response.new(response)
|
43
|
+
|
44
|
+
if result.need_login?
|
45
|
+
do_login(force_login: true)
|
46
|
+
response = @http_client.put(path, body: params)
|
47
|
+
result = JPSClient::Response.new(response)
|
48
|
+
end
|
49
|
+
|
50
|
+
return result.to_h
|
51
|
+
end
|
52
|
+
|
53
|
+
# Delete User
|
54
|
+
#
|
55
|
+
# @param params [Hash] 请求参数
|
56
|
+
# @return [Hash] API响应
|
57
|
+
def delete_user(userId:, params: {})
|
58
|
+
config = @request_config && @request_config["user_user"]
|
59
|
+
raise JPSClient::ExceptionError, "Missing config for user_user" unless config && config["url"]
|
60
|
+
|
61
|
+
path = config["url"]
|
62
|
+
path = path.gsub("{userId}", userId.to_s)
|
63
|
+
|
64
|
+
response = @http_client.delete(path)
|
65
|
+
result = JPSClient::Response.new(response)
|
66
|
+
|
67
|
+
if result.need_login?
|
68
|
+
do_login(force_login: true)
|
69
|
+
response = @http_client.delete(path)
|
70
|
+
result = JPSClient::Response.new(response)
|
71
|
+
end
|
72
|
+
|
73
|
+
return result.to_h
|
74
|
+
end
|
75
|
+
|
76
|
+
# Get Users
|
77
|
+
#
|
78
|
+
# @param params [Hash] 请求参数
|
79
|
+
# @return [Hash] API响应
|
80
|
+
def get_users(params: {})
|
81
|
+
config = @request_config && @request_config["user_users"]
|
82
|
+
raise JPSClient::ExceptionError, "Missing config for user_users" unless config && config["url"]
|
83
|
+
|
84
|
+
path = config["url"]
|
85
|
+
|
86
|
+
response = @http_client.get(path, params: params)
|
87
|
+
result = JPSClient::Response.new(response)
|
88
|
+
|
89
|
+
if result.need_login?
|
90
|
+
do_login(force_login: true)
|
91
|
+
response = @http_client.get(path, params: params)
|
92
|
+
result = JPSClient::Response.new(response)
|
93
|
+
end
|
94
|
+
|
95
|
+
return result.to_h
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module JPSClient
|
2
|
+
module API
|
3
|
+
# Util 相关 API
|
4
|
+
# 自动生成的模块,处理 util 相关接口
|
5
|
+
module Util
|
6
|
+
|
7
|
+
# Create Translate
|
8
|
+
#
|
9
|
+
# @param params [Hash] 请求参数
|
10
|
+
# @return [Hash] API响应
|
11
|
+
def create_translate(params: {})
|
12
|
+
config = @request_config && @request_config["util_translate"]
|
13
|
+
raise JPSClient::ExceptionError, "Missing config for util_translate" unless config && config["url"]
|
14
|
+
|
15
|
+
path = config["url"]
|
16
|
+
|
17
|
+
response = @http_client.post(path, body: params)
|
18
|
+
result = JPSClient::Response.new(response)
|
19
|
+
|
20
|
+
if result.need_login?
|
21
|
+
do_login(force_login: true)
|
22
|
+
response = @http_client.post(path, body: params)
|
23
|
+
result = JPSClient::Response.new(response)
|
24
|
+
end
|
25
|
+
|
26
|
+
return result.to_h
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
module JPSClient
|
2
|
+
module API
|
3
|
+
# VideoCover 相关 API
|
4
|
+
# 自动生成的模块,处理 video_cover 相关接口
|
5
|
+
module VideoCover
|
6
|
+
|
7
|
+
# Create Insert Cover
|
8
|
+
#
|
9
|
+
# @param params [Hash] 请求参数
|
10
|
+
# @return [Hash] API响应
|
11
|
+
def create_insert_cover(params: {})
|
12
|
+
config = @request_config && @request_config["video_cover_insert_cover"]
|
13
|
+
raise JPSClient::ExceptionError, "Missing config for video_cover_insert_cover" unless config && config["url"]
|
14
|
+
|
15
|
+
path = config["url"]
|
16
|
+
|
17
|
+
response = @http_client.post(path, body: params)
|
18
|
+
result = JPSClient::Response.new(response)
|
19
|
+
|
20
|
+
if result.need_login?
|
21
|
+
do_login(force_login: true)
|
22
|
+
response = @http_client.post(path, body: params)
|
23
|
+
result = JPSClient::Response.new(response)
|
24
|
+
end
|
25
|
+
|
26
|
+
return result.to_h
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,118 @@
|
|
1
|
+
module JPSClient
|
2
|
+
module API
|
3
|
+
# Webhook 相关 API
|
4
|
+
# 自动生成的模块,处理 webhook 相关接口
|
5
|
+
module Webhook
|
6
|
+
|
7
|
+
# Create Callback
|
8
|
+
#
|
9
|
+
# @param params [Hash] 请求参数
|
10
|
+
# @return [Hash] API响应
|
11
|
+
def create_callback(params: {})
|
12
|
+
config = @request_config && @request_config["webhook_callback"]
|
13
|
+
raise JPSClient::ExceptionError, "Missing config for webhook_callback" unless config && config["url"]
|
14
|
+
|
15
|
+
path = config["url"]
|
16
|
+
|
17
|
+
response = @http_client.post(path, body: params)
|
18
|
+
result = JPSClient::Response.new(response)
|
19
|
+
|
20
|
+
if result.need_login?
|
21
|
+
do_login(force_login: true)
|
22
|
+
response = @http_client.post(path, body: params)
|
23
|
+
result = JPSClient::Response.new(response)
|
24
|
+
end
|
25
|
+
|
26
|
+
return result.to_h
|
27
|
+
end
|
28
|
+
|
29
|
+
# Create Event
|
30
|
+
#
|
31
|
+
# @param params [Hash] 请求参数
|
32
|
+
# @return [Hash] API响应
|
33
|
+
def create_event(params: {})
|
34
|
+
config = @request_config && @request_config["webhook_event"]
|
35
|
+
raise JPSClient::ExceptionError, "Missing config for webhook_event" unless config && config["url"]
|
36
|
+
|
37
|
+
path = config["url"]
|
38
|
+
|
39
|
+
response = @http_client.post(path, body: params)
|
40
|
+
result = JPSClient::Response.new(response)
|
41
|
+
|
42
|
+
if result.need_login?
|
43
|
+
do_login(force_login: true)
|
44
|
+
response = @http_client.post(path, body: params)
|
45
|
+
result = JPSClient::Response.new(response)
|
46
|
+
end
|
47
|
+
|
48
|
+
return result.to_h
|
49
|
+
end
|
50
|
+
|
51
|
+
# Create Callback
|
52
|
+
#
|
53
|
+
# @param params [Hash] 请求参数
|
54
|
+
# @return [Hash] API响应
|
55
|
+
def create_callback(params: {})
|
56
|
+
config = @request_config && @request_config["webhook_callback"]
|
57
|
+
raise JPSClient::ExceptionError, "Missing config for webhook_callback" unless config && config["url"]
|
58
|
+
|
59
|
+
path = config["url"]
|
60
|
+
|
61
|
+
response = @http_client.post(path, body: params)
|
62
|
+
result = JPSClient::Response.new(response)
|
63
|
+
|
64
|
+
if result.need_login?
|
65
|
+
do_login(force_login: true)
|
66
|
+
response = @http_client.post(path, body: params)
|
67
|
+
result = JPSClient::Response.new(response)
|
68
|
+
end
|
69
|
+
|
70
|
+
return result.to_h
|
71
|
+
end
|
72
|
+
|
73
|
+
# Create Callback
|
74
|
+
#
|
75
|
+
# @param params [Hash] 请求参数
|
76
|
+
# @return [Hash] API响应
|
77
|
+
def create_callback(params: {})
|
78
|
+
config = @request_config && @request_config["webhook_callback"]
|
79
|
+
raise JPSClient::ExceptionError, "Missing config for webhook_callback" unless config && config["url"]
|
80
|
+
|
81
|
+
path = config["url"]
|
82
|
+
|
83
|
+
response = @http_client.post(path, body: params)
|
84
|
+
result = JPSClient::Response.new(response)
|
85
|
+
|
86
|
+
if result.need_login?
|
87
|
+
do_login(force_login: true)
|
88
|
+
response = @http_client.post(path, body: params)
|
89
|
+
result = JPSClient::Response.new(response)
|
90
|
+
end
|
91
|
+
|
92
|
+
return result.to_h
|
93
|
+
end
|
94
|
+
|
95
|
+
# Create Callback
|
96
|
+
#
|
97
|
+
# @param params [Hash] 请求参数
|
98
|
+
# @return [Hash] API响应
|
99
|
+
def create_callback(params: {})
|
100
|
+
config = @request_config && @request_config["webhook_callback"]
|
101
|
+
raise JPSClient::ExceptionError, "Missing config for webhook_callback" unless config && config["url"]
|
102
|
+
|
103
|
+
path = config["url"]
|
104
|
+
|
105
|
+
response = @http_client.post(path, body: params)
|
106
|
+
result = JPSClient::Response.new(response)
|
107
|
+
|
108
|
+
if result.need_login?
|
109
|
+
do_login(force_login: true)
|
110
|
+
response = @http_client.post(path, body: params)
|
111
|
+
result = JPSClient::Response.new(response)
|
112
|
+
end
|
113
|
+
|
114
|
+
return result.to_h
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
@@ -0,0 +1,118 @@
|
|
1
|
+
module JPSClient
|
2
|
+
module API
|
3
|
+
# Workflow 相关 API
|
4
|
+
# 自动生成的模块,处理 workflow 相关接口
|
5
|
+
module Workflow
|
6
|
+
|
7
|
+
# Create Update
|
8
|
+
#
|
9
|
+
# @param params [Hash] 请求参数
|
10
|
+
# @return [Hash] API响应
|
11
|
+
def create_update(params: {})
|
12
|
+
config = @request_config && @request_config["workflow_update"]
|
13
|
+
raise JPSClient::ExceptionError, "Missing config for workflow_update" unless config && config["url"]
|
14
|
+
|
15
|
+
path = config["url"]
|
16
|
+
|
17
|
+
response = @http_client.post(path, body: params)
|
18
|
+
result = JPSClient::Response.new(response)
|
19
|
+
|
20
|
+
if result.need_login?
|
21
|
+
do_login(force_login: true)
|
22
|
+
response = @http_client.post(path, body: params)
|
23
|
+
result = JPSClient::Response.new(response)
|
24
|
+
end
|
25
|
+
|
26
|
+
return result.to_h
|
27
|
+
end
|
28
|
+
|
29
|
+
# Create Sort
|
30
|
+
#
|
31
|
+
# @param params [Hash] 请求参数
|
32
|
+
# @return [Hash] API响应
|
33
|
+
def create_sort(params: {})
|
34
|
+
config = @request_config && @request_config["workflow_sort"]
|
35
|
+
raise JPSClient::ExceptionError, "Missing config for workflow_sort" unless config && config["url"]
|
36
|
+
|
37
|
+
path = config["url"]
|
38
|
+
|
39
|
+
response = @http_client.post(path, body: params)
|
40
|
+
result = JPSClient::Response.new(response)
|
41
|
+
|
42
|
+
if result.need_login?
|
43
|
+
do_login(force_login: true)
|
44
|
+
response = @http_client.post(path, body: params)
|
45
|
+
result = JPSClient::Response.new(response)
|
46
|
+
end
|
47
|
+
|
48
|
+
return result.to_h
|
49
|
+
end
|
50
|
+
|
51
|
+
# Create Delete
|
52
|
+
#
|
53
|
+
# @param params [Hash] 请求参数
|
54
|
+
# @return [Hash] API响应
|
55
|
+
def create_delete(params: {})
|
56
|
+
config = @request_config && @request_config["workflow_delete"]
|
57
|
+
raise JPSClient::ExceptionError, "Missing config for workflow_delete" unless config && config["url"]
|
58
|
+
|
59
|
+
path = config["url"]
|
60
|
+
|
61
|
+
response = @http_client.post(path, body: params)
|
62
|
+
result = JPSClient::Response.new(response)
|
63
|
+
|
64
|
+
if result.need_login?
|
65
|
+
do_login(force_login: true)
|
66
|
+
response = @http_client.post(path, body: params)
|
67
|
+
result = JPSClient::Response.new(response)
|
68
|
+
end
|
69
|
+
|
70
|
+
return result.to_h
|
71
|
+
end
|
72
|
+
|
73
|
+
# Create Create
|
74
|
+
#
|
75
|
+
# @param params [Hash] 请求参数
|
76
|
+
# @return [Hash] API响应
|
77
|
+
def create_create(params: {})
|
78
|
+
config = @request_config && @request_config["workflow_create"]
|
79
|
+
raise JPSClient::ExceptionError, "Missing config for workflow_create" unless config && config["url"]
|
80
|
+
|
81
|
+
path = config["url"]
|
82
|
+
|
83
|
+
response = @http_client.post(path, body: params)
|
84
|
+
result = JPSClient::Response.new(response)
|
85
|
+
|
86
|
+
if result.need_login?
|
87
|
+
do_login(force_login: true)
|
88
|
+
response = @http_client.post(path, body: params)
|
89
|
+
result = JPSClient::Response.new(response)
|
90
|
+
end
|
91
|
+
|
92
|
+
return result.to_h
|
93
|
+
end
|
94
|
+
|
95
|
+
# Get List
|
96
|
+
#
|
97
|
+
# @param params [Hash] 请求参数
|
98
|
+
# @return [Hash] API响应
|
99
|
+
def get_list(params: {})
|
100
|
+
config = @request_config && @request_config["workflow_list"]
|
101
|
+
raise JPSClient::ExceptionError, "Missing config for workflow_list" unless config && config["url"]
|
102
|
+
|
103
|
+
path = config["url"]
|
104
|
+
|
105
|
+
response = @http_client.get(path, params: params)
|
106
|
+
result = JPSClient::Response.new(response)
|
107
|
+
|
108
|
+
if result.need_login?
|
109
|
+
do_login(force_login: true)
|
110
|
+
response = @http_client.get(path, params: params)
|
111
|
+
result = JPSClient::Response.new(response)
|
112
|
+
end
|
113
|
+
|
114
|
+
return result.to_h
|
115
|
+
end
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|