smooch-api 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +7 -0
- data/README.md +181 -0
- data/Rakefile +8 -0
- data/docs/Action.md +16 -0
- data/docs/App.md +10 -0
- data/docs/AppApi.md +609 -0
- data/docs/AppCreate.md +8 -0
- data/docs/AppResponse.md +8 -0
- data/docs/AppUser.md +18 -0
- data/docs/AppUserApi.md +561 -0
- data/docs/AppUserLink.md +9 -0
- data/docs/AppUserPreCreate.md +14 -0
- data/docs/AppUserResponse.md +8 -0
- data/docs/AppUserUpdate.md +12 -0
- data/docs/Client.md +14 -0
- data/docs/ClientInfo.md +15 -0
- data/docs/Conversation.md +9 -0
- data/docs/ConversationApi.md +282 -0
- data/docs/Destination.md +9 -0
- data/docs/DeviceInit.md +12 -0
- data/docs/DeviceResponse.md +8 -0
- data/docs/DeviceUpdate.md +10 -0
- data/docs/DisplaySettings.md +8 -0
- data/docs/Event.md +8 -0
- data/docs/GetMessagesResponse.md +10 -0
- data/docs/Init.md +9 -0
- data/docs/InitApi.md +61 -0
- data/docs/InitResponse.md +9 -0
- data/docs/Integration.md +24 -0
- data/docs/IntegrationApi.md +121 -0
- data/docs/IntegrationCreate.md +23 -0
- data/docs/IntegrationResponse.md +8 -0
- data/docs/JwtResponse.md +8 -0
- data/docs/ListAppsResponse.md +10 -0
- data/docs/ListIntegrationsResponse.md +8 -0
- data/docs/ListSecretKeysResponse.md +8 -0
- data/docs/ListWebhooksResponse.md +8 -0
- data/docs/Menu.md +9 -0
- data/docs/MenuApi.md +155 -0
- data/docs/MenuItem.md +11 -0
- data/docs/MenuResponse.md +8 -0
- data/docs/Message.md +23 -0
- data/docs/MessageItem.md +13 -0
- data/docs/MessagePost.md +20 -0
- data/docs/MessageResponse.md +9 -0
- data/docs/PostMessagesResponse.md +9 -0
- data/docs/SecretKey.md +10 -0
- data/docs/SecretKeyCreate.md +8 -0
- data/docs/SecretKeyResponse.md +8 -0
- data/docs/TrackEventResponse.md +8 -0
- data/docs/TypingActivityTrigger.md +11 -0
- data/docs/Webhook.md +11 -0
- data/docs/WebhookApi.md +287 -0
- data/docs/WebhookCreate.md +9 -0
- data/docs/WebhookResponse.md +8 -0
- data/docs/WebhookUpdate.md +9 -0
- data/git_push.sh +55 -0
- data/lib/smooch-api.rb +91 -0
- data/lib/smooch-api/api/app_api.rb +628 -0
- data/lib/smooch-api/api/app_user_api.rb +585 -0
- data/lib/smooch-api/api/conversation_api.rb +298 -0
- data/lib/smooch-api/api/init_api.rb +75 -0
- data/lib/smooch-api/api/integration_api.rb +135 -0
- data/lib/smooch-api/api/menu_api.rb +173 -0
- data/lib/smooch-api/api/webhook_api.rb +306 -0
- data/lib/smooch-api/api_client.rb +376 -0
- data/lib/smooch-api/api_error.rb +37 -0
- data/lib/smooch-api/configuration.rb +202 -0
- data/lib/smooch-api/models/action.rb +311 -0
- data/lib/smooch-api/models/app.rb +223 -0
- data/lib/smooch-api/models/app_create.rb +193 -0
- data/lib/smooch-api/models/app_response.rb +188 -0
- data/lib/smooch-api/models/app_user.rb +307 -0
- data/lib/smooch-api/models/app_user_link.rb +236 -0
- data/lib/smooch-api/models/app_user_pre_create.rb +253 -0
- data/lib/smooch-api/models/app_user_response.rb +193 -0
- data/lib/smooch-api/models/app_user_update.rb +228 -0
- data/lib/smooch-api/models/client.rb +290 -0
- data/lib/smooch-api/models/client_info.rb +258 -0
- data/lib/smooch-api/models/conversation.rb +208 -0
- data/lib/smooch-api/models/destination.rb +208 -0
- data/lib/smooch-api/models/device_init.rb +270 -0
- data/lib/smooch-api/models/device_response.rb +188 -0
- data/lib/smooch-api/models/device_update.rb +207 -0
- data/lib/smooch-api/models/display_settings.rb +188 -0
- data/lib/smooch-api/models/event.rb +193 -0
- data/lib/smooch-api/models/get_messages_response.rb +210 -0
- data/lib/smooch-api/models/init.rb +202 -0
- data/lib/smooch-api/models/init_response.rb +208 -0
- data/lib/smooch-api/models/integration.rb +358 -0
- data/lib/smooch-api/models/integration_create.rb +343 -0
- data/lib/smooch-api/models/integration_response.rb +188 -0
- data/lib/smooch-api/models/jwt_response.rb +188 -0
- data/lib/smooch-api/models/list_apps_response.rb +210 -0
- data/lib/smooch-api/models/list_integrations_response.rb +190 -0
- data/lib/smooch-api/models/list_secret_keys_response.rb +190 -0
- data/lib/smooch-api/models/list_webhooks_response.rb +195 -0
- data/lib/smooch-api/models/menu.rb +205 -0
- data/lib/smooch-api/models/menu_item.rb +228 -0
- data/lib/smooch-api/models/menu_response.rb +193 -0
- data/lib/smooch-api/models/message.rb +415 -0
- data/lib/smooch-api/models/message_item.rb +250 -0
- data/lib/smooch-api/models/message_post.rb +355 -0
- data/lib/smooch-api/models/message_response.rb +208 -0
- data/lib/smooch-api/models/post_messages_response.rb +200 -0
- data/lib/smooch-api/models/secret_key.rb +223 -0
- data/lib/smooch-api/models/secret_key_create.rb +193 -0
- data/lib/smooch-api/models/secret_key_response.rb +188 -0
- data/lib/smooch-api/models/track_event_response.rb +188 -0
- data/lib/smooch-api/models/typing_activity_trigger.rb +228 -0
- data/lib/smooch-api/models/webhook.rb +261 -0
- data/lib/smooch-api/models/webhook_create.rb +226 -0
- data/lib/smooch-api/models/webhook_response.rb +193 -0
- data/lib/smooch-api/models/webhook_update.rb +221 -0
- data/lib/smooch-api/version.rb +14 -0
- data/smooch-api.gemspec +44 -0
- data/spec/api_client_spec.rb +225 -0
- data/spec/configuration_spec.rb +41 -0
- data/spec/spec_helper.rb +110 -0
- metadata +349 -0
@@ -0,0 +1,585 @@
|
|
1
|
+
=begin
|
2
|
+
#Smooch
|
3
|
+
|
4
|
+
#The Smooch API is a unified interface for powering messaging in your customer experiences across every channel. Our API speeds access to new markets, reduces time to ship, eliminates complexity, and helps you build the best experiences for your customers. For more information, visit our [official documentation](https://docs.smooch.io).
|
5
|
+
|
6
|
+
OpenAPI spec version: 1
|
7
|
+
|
8
|
+
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
9
|
+
|
10
|
+
=end
|
11
|
+
|
12
|
+
require "uri"
|
13
|
+
|
14
|
+
module SmoochApi
|
15
|
+
class AppUserApi
|
16
|
+
attr_accessor :api_client
|
17
|
+
|
18
|
+
def initialize(api_client = ApiClient.default)
|
19
|
+
@api_client = api_client
|
20
|
+
end
|
21
|
+
|
22
|
+
#
|
23
|
+
# Update specified device information.
|
24
|
+
# @param user_id Identifies the user. Can be either the smoochId or the userId.
|
25
|
+
# @param device_id Identifies the device.
|
26
|
+
# @param app_user_device_update_body Body for an updateAppUserDevice request.
|
27
|
+
# @param [Hash] opts the optional parameters
|
28
|
+
# @return [DeviceResponse]
|
29
|
+
def app_user_device_update(user_id, device_id, app_user_device_update_body, opts = {})
|
30
|
+
data, _status_code, _headers = app_user_device_update_with_http_info(user_id, device_id, app_user_device_update_body, opts)
|
31
|
+
return data
|
32
|
+
end
|
33
|
+
|
34
|
+
#
|
35
|
+
# Update specified device information.
|
36
|
+
# @param user_id Identifies the user. Can be either the smoochId or the userId.
|
37
|
+
# @param device_id Identifies the device.
|
38
|
+
# @param app_user_device_update_body Body for an updateAppUserDevice request.
|
39
|
+
# @param [Hash] opts the optional parameters
|
40
|
+
# @return [Array<(DeviceResponse, Fixnum, Hash)>] DeviceResponse data, response status code and response headers
|
41
|
+
def app_user_device_update_with_http_info(user_id, device_id, app_user_device_update_body, opts = {})
|
42
|
+
if @api_client.config.debugging
|
43
|
+
@api_client.config.logger.debug "Calling API: AppUserApi.app_user_device_update ..."
|
44
|
+
end
|
45
|
+
# verify the required parameter 'user_id' is set
|
46
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling AppUserApi.app_user_device_update" if user_id.nil?
|
47
|
+
# verify the required parameter 'device_id' is set
|
48
|
+
fail ArgumentError, "Missing the required parameter 'device_id' when calling AppUserApi.app_user_device_update" if device_id.nil?
|
49
|
+
# verify the required parameter 'app_user_device_update_body' is set
|
50
|
+
fail ArgumentError, "Missing the required parameter 'app_user_device_update_body' when calling AppUserApi.app_user_device_update" if app_user_device_update_body.nil?
|
51
|
+
# resource path
|
52
|
+
local_var_path = "/appusers/{userId}/devices/{deviceId}".sub('{' + 'userId' + '}', user_id.to_s).sub('{' + 'deviceId' + '}', device_id.to_s)
|
53
|
+
|
54
|
+
# query parameters
|
55
|
+
query_params = {}
|
56
|
+
|
57
|
+
# header parameters
|
58
|
+
header_params = {}
|
59
|
+
# HTTP header 'Accept' (if needed)
|
60
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
61
|
+
# HTTP header 'Content-Type'
|
62
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
63
|
+
|
64
|
+
# form parameters
|
65
|
+
form_params = {}
|
66
|
+
|
67
|
+
# http body (model)
|
68
|
+
post_body = @api_client.object_to_http_body(app_user_device_update_body)
|
69
|
+
auth_names = ['jwt']
|
70
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
71
|
+
:header_params => header_params,
|
72
|
+
:query_params => query_params,
|
73
|
+
:form_params => form_params,
|
74
|
+
:body => post_body,
|
75
|
+
:auth_names => auth_names,
|
76
|
+
:return_type => 'DeviceResponse')
|
77
|
+
if @api_client.config.debugging
|
78
|
+
@api_client.config.logger.debug "API called: AppUserApi#app_user_device_update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
79
|
+
end
|
80
|
+
return data, status_code, headers
|
81
|
+
end
|
82
|
+
|
83
|
+
#
|
84
|
+
# Delete specified app user's profile.
|
85
|
+
# @param user_id Identifies the user. Can be either the smoochId or the userId.
|
86
|
+
# @param [Hash] opts the optional parameters
|
87
|
+
# @return [AppUserResponse]
|
88
|
+
def delete_app_user_profile(user_id, opts = {})
|
89
|
+
data, _status_code, _headers = delete_app_user_profile_with_http_info(user_id, opts)
|
90
|
+
return data
|
91
|
+
end
|
92
|
+
|
93
|
+
#
|
94
|
+
# Delete specified app user's profile.
|
95
|
+
# @param user_id Identifies the user. Can be either the smoochId or the userId.
|
96
|
+
# @param [Hash] opts the optional parameters
|
97
|
+
# @return [Array<(AppUserResponse, Fixnum, Hash)>] AppUserResponse data, response status code and response headers
|
98
|
+
def delete_app_user_profile_with_http_info(user_id, opts = {})
|
99
|
+
if @api_client.config.debugging
|
100
|
+
@api_client.config.logger.debug "Calling API: AppUserApi.delete_app_user_profile ..."
|
101
|
+
end
|
102
|
+
# verify the required parameter 'user_id' is set
|
103
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling AppUserApi.delete_app_user_profile" if user_id.nil?
|
104
|
+
# resource path
|
105
|
+
local_var_path = "/appusers/{userId}/profile".sub('{' + 'userId' + '}', user_id.to_s)
|
106
|
+
|
107
|
+
# query parameters
|
108
|
+
query_params = {}
|
109
|
+
|
110
|
+
# header parameters
|
111
|
+
header_params = {}
|
112
|
+
# HTTP header 'Accept' (if needed)
|
113
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
114
|
+
# HTTP header 'Content-Type'
|
115
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
116
|
+
|
117
|
+
# form parameters
|
118
|
+
form_params = {}
|
119
|
+
|
120
|
+
# http body (model)
|
121
|
+
post_body = nil
|
122
|
+
auth_names = ['jwt']
|
123
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
124
|
+
:header_params => header_params,
|
125
|
+
:query_params => query_params,
|
126
|
+
:form_params => form_params,
|
127
|
+
:body => post_body,
|
128
|
+
:auth_names => auth_names,
|
129
|
+
:return_type => 'AppUserResponse')
|
130
|
+
if @api_client.config.debugging
|
131
|
+
@api_client.config.logger.debug "API called: AppUserApi#delete_app_user_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
132
|
+
end
|
133
|
+
return data, status_code, headers
|
134
|
+
end
|
135
|
+
|
136
|
+
#
|
137
|
+
# Get the specified app user.
|
138
|
+
# @param user_id Identifies the user. Can be either the smoochId or the userId.
|
139
|
+
# @param [Hash] opts the optional parameters
|
140
|
+
# @return [AppUserResponse]
|
141
|
+
def get_app_user(user_id, opts = {})
|
142
|
+
data, _status_code, _headers = get_app_user_with_http_info(user_id, opts)
|
143
|
+
return data
|
144
|
+
end
|
145
|
+
|
146
|
+
#
|
147
|
+
# Get the specified app user.
|
148
|
+
# @param user_id Identifies the user. Can be either the smoochId or the userId.
|
149
|
+
# @param [Hash] opts the optional parameters
|
150
|
+
# @return [Array<(AppUserResponse, Fixnum, Hash)>] AppUserResponse data, response status code and response headers
|
151
|
+
def get_app_user_with_http_info(user_id, opts = {})
|
152
|
+
if @api_client.config.debugging
|
153
|
+
@api_client.config.logger.debug "Calling API: AppUserApi.get_app_user ..."
|
154
|
+
end
|
155
|
+
# verify the required parameter 'user_id' is set
|
156
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling AppUserApi.get_app_user" if user_id.nil?
|
157
|
+
# resource path
|
158
|
+
local_var_path = "/appusers/{userId}".sub('{' + 'userId' + '}', user_id.to_s)
|
159
|
+
|
160
|
+
# query parameters
|
161
|
+
query_params = {}
|
162
|
+
|
163
|
+
# header parameters
|
164
|
+
header_params = {}
|
165
|
+
# HTTP header 'Accept' (if needed)
|
166
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
167
|
+
# HTTP header 'Content-Type'
|
168
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
169
|
+
|
170
|
+
# form parameters
|
171
|
+
form_params = {}
|
172
|
+
|
173
|
+
# http body (model)
|
174
|
+
post_body = nil
|
175
|
+
auth_names = ['jwt']
|
176
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
177
|
+
:header_params => header_params,
|
178
|
+
:query_params => query_params,
|
179
|
+
:form_params => form_params,
|
180
|
+
:body => post_body,
|
181
|
+
:auth_names => auth_names,
|
182
|
+
:return_type => 'AppUserResponse')
|
183
|
+
if @api_client.config.debugging
|
184
|
+
@api_client.config.logger.debug "API called: AppUserApi#get_app_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
185
|
+
end
|
186
|
+
return data, status_code, headers
|
187
|
+
end
|
188
|
+
|
189
|
+
#
|
190
|
+
# Get specified app user's channel entity IDs.
|
191
|
+
# @param user_id Identifies the user. Can be either the smoochId or the userId.
|
192
|
+
# @param [Hash] opts the optional parameters
|
193
|
+
# @return [AppUserResponse]
|
194
|
+
def get_app_user_entity_ids(user_id, opts = {})
|
195
|
+
data, _status_code, _headers = get_app_user_entity_ids_with_http_info(user_id, opts)
|
196
|
+
return data
|
197
|
+
end
|
198
|
+
|
199
|
+
#
|
200
|
+
# Get specified app user's channel entity IDs.
|
201
|
+
# @param user_id Identifies the user. Can be either the smoochId or the userId.
|
202
|
+
# @param [Hash] opts the optional parameters
|
203
|
+
# @return [Array<(AppUserResponse, Fixnum, Hash)>] AppUserResponse data, response status code and response headers
|
204
|
+
def get_app_user_entity_ids_with_http_info(user_id, opts = {})
|
205
|
+
if @api_client.config.debugging
|
206
|
+
@api_client.config.logger.debug "Calling API: AppUserApi.get_app_user_entity_ids ..."
|
207
|
+
end
|
208
|
+
# verify the required parameter 'user_id' is set
|
209
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling AppUserApi.get_app_user_entity_ids" if user_id.nil?
|
210
|
+
# resource path
|
211
|
+
local_var_path = "/appusers/{userId}/channels".sub('{' + 'userId' + '}', user_id.to_s)
|
212
|
+
|
213
|
+
# query parameters
|
214
|
+
query_params = {}
|
215
|
+
|
216
|
+
# header parameters
|
217
|
+
header_params = {}
|
218
|
+
# HTTP header 'Accept' (if needed)
|
219
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
220
|
+
# HTTP header 'Content-Type'
|
221
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
222
|
+
|
223
|
+
# form parameters
|
224
|
+
form_params = {}
|
225
|
+
|
226
|
+
# http body (model)
|
227
|
+
post_body = nil
|
228
|
+
auth_names = ['jwt']
|
229
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path,
|
230
|
+
:header_params => header_params,
|
231
|
+
:query_params => query_params,
|
232
|
+
:form_params => form_params,
|
233
|
+
:body => post_body,
|
234
|
+
:auth_names => auth_names,
|
235
|
+
:return_type => 'AppUserResponse')
|
236
|
+
if @api_client.config.debugging
|
237
|
+
@api_client.config.logger.debug "API called: AppUserApi#get_app_user_entity_ids\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
238
|
+
end
|
239
|
+
return data, status_code, headers
|
240
|
+
end
|
241
|
+
|
242
|
+
#
|
243
|
+
# Link specified app user to given channel.
|
244
|
+
# @param user_id Identifies the user. Can be either the smoochId or the userId.
|
245
|
+
# @param app_user_link_body Body for a linkAppUser request.
|
246
|
+
# @param [Hash] opts the optional parameters
|
247
|
+
# @return [AppUserResponse]
|
248
|
+
def link_app_user(user_id, app_user_link_body, opts = {})
|
249
|
+
data, _status_code, _headers = link_app_user_with_http_info(user_id, app_user_link_body, opts)
|
250
|
+
return data
|
251
|
+
end
|
252
|
+
|
253
|
+
#
|
254
|
+
# Link specified app user to given channel.
|
255
|
+
# @param user_id Identifies the user. Can be either the smoochId or the userId.
|
256
|
+
# @param app_user_link_body Body for a linkAppUser request.
|
257
|
+
# @param [Hash] opts the optional parameters
|
258
|
+
# @return [Array<(AppUserResponse, Fixnum, Hash)>] AppUserResponse data, response status code and response headers
|
259
|
+
def link_app_user_with_http_info(user_id, app_user_link_body, opts = {})
|
260
|
+
if @api_client.config.debugging
|
261
|
+
@api_client.config.logger.debug "Calling API: AppUserApi.link_app_user ..."
|
262
|
+
end
|
263
|
+
# verify the required parameter 'user_id' is set
|
264
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling AppUserApi.link_app_user" if user_id.nil?
|
265
|
+
# verify the required parameter 'app_user_link_body' is set
|
266
|
+
fail ArgumentError, "Missing the required parameter 'app_user_link_body' when calling AppUserApi.link_app_user" if app_user_link_body.nil?
|
267
|
+
# resource path
|
268
|
+
local_var_path = "/appusers/{userId}/channels".sub('{' + 'userId' + '}', user_id.to_s)
|
269
|
+
|
270
|
+
# query parameters
|
271
|
+
query_params = {}
|
272
|
+
|
273
|
+
# header parameters
|
274
|
+
header_params = {}
|
275
|
+
# HTTP header 'Accept' (if needed)
|
276
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
277
|
+
# HTTP header 'Content-Type'
|
278
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
279
|
+
|
280
|
+
# form parameters
|
281
|
+
form_params = {}
|
282
|
+
|
283
|
+
# http body (model)
|
284
|
+
post_body = @api_client.object_to_http_body(app_user_link_body)
|
285
|
+
auth_names = ['jwt']
|
286
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
287
|
+
:header_params => header_params,
|
288
|
+
:query_params => query_params,
|
289
|
+
:form_params => form_params,
|
290
|
+
:body => post_body,
|
291
|
+
:auth_names => auth_names,
|
292
|
+
:return_type => 'AppUserResponse')
|
293
|
+
if @api_client.config.debugging
|
294
|
+
@api_client.config.logger.debug "API called: AppUserApi#link_app_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
295
|
+
end
|
296
|
+
return data, status_code, headers
|
297
|
+
end
|
298
|
+
|
299
|
+
#
|
300
|
+
# Send an image message to the conversation.
|
301
|
+
# @param user_id Identifies the user. Can be either the smoochId or the userId.
|
302
|
+
# @param source Image to be uploaded
|
303
|
+
# @param role Role of the sender
|
304
|
+
# @param [Hash] opts the optional parameters
|
305
|
+
# @return [MessageResponse]
|
306
|
+
def post_image_message(user_id, source, role, opts = {})
|
307
|
+
data, _status_code, _headers = post_image_message_with_http_info(user_id, source, role, opts)
|
308
|
+
return data
|
309
|
+
end
|
310
|
+
|
311
|
+
#
|
312
|
+
# Send an image message to the conversation.
|
313
|
+
# @param user_id Identifies the user. Can be either the smoochId or the userId.
|
314
|
+
# @param source Image to be uploaded
|
315
|
+
# @param role Role of the sender
|
316
|
+
# @param [Hash] opts the optional parameters
|
317
|
+
# @return [Array<(MessageResponse, Fixnum, Hash)>] MessageResponse data, response status code and response headers
|
318
|
+
def post_image_message_with_http_info(user_id, source, role, opts = {})
|
319
|
+
if @api_client.config.debugging
|
320
|
+
@api_client.config.logger.debug "Calling API: AppUserApi.post_image_message ..."
|
321
|
+
end
|
322
|
+
# verify the required parameter 'user_id' is set
|
323
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling AppUserApi.post_image_message" if user_id.nil?
|
324
|
+
# verify the required parameter 'source' is set
|
325
|
+
fail ArgumentError, "Missing the required parameter 'source' when calling AppUserApi.post_image_message" if source.nil?
|
326
|
+
# verify the required parameter 'role' is set
|
327
|
+
fail ArgumentError, "Missing the required parameter 'role' when calling AppUserApi.post_image_message" if role.nil?
|
328
|
+
# resource path
|
329
|
+
local_var_path = "/appusers/{userId}/images".sub('{' + 'userId' + '}', user_id.to_s)
|
330
|
+
|
331
|
+
# query parameters
|
332
|
+
query_params = {}
|
333
|
+
|
334
|
+
# header parameters
|
335
|
+
header_params = {}
|
336
|
+
# HTTP header 'Accept' (if needed)
|
337
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
338
|
+
# HTTP header 'Content-Type'
|
339
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])
|
340
|
+
|
341
|
+
# form parameters
|
342
|
+
form_params = {}
|
343
|
+
form_params["source"] = source
|
344
|
+
form_params["role"] = role
|
345
|
+
|
346
|
+
# http body (model)
|
347
|
+
post_body = nil
|
348
|
+
auth_names = ['jwt']
|
349
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
350
|
+
:header_params => header_params,
|
351
|
+
:query_params => query_params,
|
352
|
+
:form_params => form_params,
|
353
|
+
:body => post_body,
|
354
|
+
:auth_names => auth_names,
|
355
|
+
:return_type => 'MessageResponse')
|
356
|
+
if @api_client.config.debugging
|
357
|
+
@api_client.config.logger.debug "API called: AppUserApi#post_image_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
358
|
+
end
|
359
|
+
return data, status_code, headers
|
360
|
+
end
|
361
|
+
|
362
|
+
#
|
363
|
+
# Pre-create an app user.
|
364
|
+
# @param app_user_pre_create_body Body for a preCreateAppUser request.
|
365
|
+
# @param [Hash] opts the optional parameters
|
366
|
+
# @return [AppUserResponse]
|
367
|
+
def pre_create_app_user(app_user_pre_create_body, opts = {})
|
368
|
+
data, _status_code, _headers = pre_create_app_user_with_http_info(app_user_pre_create_body, opts)
|
369
|
+
return data
|
370
|
+
end
|
371
|
+
|
372
|
+
#
|
373
|
+
# Pre-create an app user.
|
374
|
+
# @param app_user_pre_create_body Body for a preCreateAppUser request.
|
375
|
+
# @param [Hash] opts the optional parameters
|
376
|
+
# @return [Array<(AppUserResponse, Fixnum, Hash)>] AppUserResponse data, response status code and response headers
|
377
|
+
def pre_create_app_user_with_http_info(app_user_pre_create_body, opts = {})
|
378
|
+
if @api_client.config.debugging
|
379
|
+
@api_client.config.logger.debug "Calling API: AppUserApi.pre_create_app_user ..."
|
380
|
+
end
|
381
|
+
# verify the required parameter 'app_user_pre_create_body' is set
|
382
|
+
fail ArgumentError, "Missing the required parameter 'app_user_pre_create_body' when calling AppUserApi.pre_create_app_user" if app_user_pre_create_body.nil?
|
383
|
+
# resource path
|
384
|
+
local_var_path = "/appusers"
|
385
|
+
|
386
|
+
# query parameters
|
387
|
+
query_params = {}
|
388
|
+
|
389
|
+
# header parameters
|
390
|
+
header_params = {}
|
391
|
+
# HTTP header 'Accept' (if needed)
|
392
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
393
|
+
# HTTP header 'Content-Type'
|
394
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
395
|
+
|
396
|
+
# form parameters
|
397
|
+
form_params = {}
|
398
|
+
|
399
|
+
# http body (model)
|
400
|
+
post_body = @api_client.object_to_http_body(app_user_pre_create_body)
|
401
|
+
auth_names = ['jwt']
|
402
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
403
|
+
:header_params => header_params,
|
404
|
+
:query_params => query_params,
|
405
|
+
:form_params => form_params,
|
406
|
+
:body => post_body,
|
407
|
+
:auth_names => auth_names,
|
408
|
+
:return_type => 'AppUserResponse')
|
409
|
+
if @api_client.config.debugging
|
410
|
+
@api_client.config.logger.debug "API called: AppUserApi#pre_create_app_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
411
|
+
end
|
412
|
+
return data, status_code, headers
|
413
|
+
end
|
414
|
+
|
415
|
+
#
|
416
|
+
# Track an event for the given app user.
|
417
|
+
# @param user_id Identifies the user. Can be either the smoochId or the userId.
|
418
|
+
# @param track_event_body Body for a trackEvent request.
|
419
|
+
# @param [Hash] opts the optional parameters
|
420
|
+
# @return [TrackEventResponse]
|
421
|
+
def track_event(user_id, track_event_body, opts = {})
|
422
|
+
data, _status_code, _headers = track_event_with_http_info(user_id, track_event_body, opts)
|
423
|
+
return data
|
424
|
+
end
|
425
|
+
|
426
|
+
#
|
427
|
+
# Track an event for the given app user.
|
428
|
+
# @param user_id Identifies the user. Can be either the smoochId or the userId.
|
429
|
+
# @param track_event_body Body for a trackEvent request.
|
430
|
+
# @param [Hash] opts the optional parameters
|
431
|
+
# @return [Array<(TrackEventResponse, Fixnum, Hash)>] TrackEventResponse data, response status code and response headers
|
432
|
+
def track_event_with_http_info(user_id, track_event_body, opts = {})
|
433
|
+
if @api_client.config.debugging
|
434
|
+
@api_client.config.logger.debug "Calling API: AppUserApi.track_event ..."
|
435
|
+
end
|
436
|
+
# verify the required parameter 'user_id' is set
|
437
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling AppUserApi.track_event" if user_id.nil?
|
438
|
+
# verify the required parameter 'track_event_body' is set
|
439
|
+
fail ArgumentError, "Missing the required parameter 'track_event_body' when calling AppUserApi.track_event" if track_event_body.nil?
|
440
|
+
# resource path
|
441
|
+
local_var_path = "/appusers/{userId}/events".sub('{' + 'userId' + '}', user_id.to_s)
|
442
|
+
|
443
|
+
# query parameters
|
444
|
+
query_params = {}
|
445
|
+
|
446
|
+
# header parameters
|
447
|
+
header_params = {}
|
448
|
+
# HTTP header 'Accept' (if needed)
|
449
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
450
|
+
# HTTP header 'Content-Type'
|
451
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
452
|
+
|
453
|
+
# form parameters
|
454
|
+
form_params = {}
|
455
|
+
|
456
|
+
# http body (model)
|
457
|
+
post_body = @api_client.object_to_http_body(track_event_body)
|
458
|
+
auth_names = ['jwt']
|
459
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path,
|
460
|
+
:header_params => header_params,
|
461
|
+
:query_params => query_params,
|
462
|
+
:form_params => form_params,
|
463
|
+
:body => post_body,
|
464
|
+
:auth_names => auth_names,
|
465
|
+
:return_type => 'TrackEventResponse')
|
466
|
+
if @api_client.config.debugging
|
467
|
+
@api_client.config.logger.debug "API called: AppUserApi#track_event\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
468
|
+
end
|
469
|
+
return data, status_code, headers
|
470
|
+
end
|
471
|
+
|
472
|
+
#
|
473
|
+
# Unlink specified app user from given channel.
|
474
|
+
# @param user_id Identifies the user. Can be either the smoochId or the userId.
|
475
|
+
# @param channel Name of the channel.
|
476
|
+
# @param [Hash] opts the optional parameters
|
477
|
+
# @return [nil]
|
478
|
+
def unlink_app_user(user_id, channel, opts = {})
|
479
|
+
unlink_app_user_with_http_info(user_id, channel, opts)
|
480
|
+
return nil
|
481
|
+
end
|
482
|
+
|
483
|
+
#
|
484
|
+
# Unlink specified app user from given channel.
|
485
|
+
# @param user_id Identifies the user. Can be either the smoochId or the userId.
|
486
|
+
# @param channel Name of the channel.
|
487
|
+
# @param [Hash] opts the optional parameters
|
488
|
+
# @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
|
489
|
+
def unlink_app_user_with_http_info(user_id, channel, opts = {})
|
490
|
+
if @api_client.config.debugging
|
491
|
+
@api_client.config.logger.debug "Calling API: AppUserApi.unlink_app_user ..."
|
492
|
+
end
|
493
|
+
# verify the required parameter 'user_id' is set
|
494
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling AppUserApi.unlink_app_user" if user_id.nil?
|
495
|
+
# verify the required parameter 'channel' is set
|
496
|
+
fail ArgumentError, "Missing the required parameter 'channel' when calling AppUserApi.unlink_app_user" if channel.nil?
|
497
|
+
# resource path
|
498
|
+
local_var_path = "/appusers/{userId}/channels/{channel}".sub('{' + 'userId' + '}', user_id.to_s).sub('{' + 'channel' + '}', channel.to_s)
|
499
|
+
|
500
|
+
# query parameters
|
501
|
+
query_params = {}
|
502
|
+
|
503
|
+
# header parameters
|
504
|
+
header_params = {}
|
505
|
+
# HTTP header 'Accept' (if needed)
|
506
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
507
|
+
# HTTP header 'Content-Type'
|
508
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
509
|
+
|
510
|
+
# form parameters
|
511
|
+
form_params = {}
|
512
|
+
|
513
|
+
# http body (model)
|
514
|
+
post_body = nil
|
515
|
+
auth_names = ['jwt']
|
516
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
|
517
|
+
:header_params => header_params,
|
518
|
+
:query_params => query_params,
|
519
|
+
:form_params => form_params,
|
520
|
+
:body => post_body,
|
521
|
+
:auth_names => auth_names)
|
522
|
+
if @api_client.config.debugging
|
523
|
+
@api_client.config.logger.debug "API called: AppUserApi#unlink_app_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
524
|
+
end
|
525
|
+
return data, status_code, headers
|
526
|
+
end
|
527
|
+
|
528
|
+
#
|
529
|
+
# Update the specified app user.
|
530
|
+
# @param user_id Identifies the user. Can be either the smoochId or the userId.
|
531
|
+
# @param app_user_update_body Body for an updateAppUser request.
|
532
|
+
# @param [Hash] opts the optional parameters
|
533
|
+
# @return [AppUserResponse]
|
534
|
+
def update_app_user(user_id, app_user_update_body, opts = {})
|
535
|
+
data, _status_code, _headers = update_app_user_with_http_info(user_id, app_user_update_body, opts)
|
536
|
+
return data
|
537
|
+
end
|
538
|
+
|
539
|
+
#
|
540
|
+
# Update the specified app user.
|
541
|
+
# @param user_id Identifies the user. Can be either the smoochId or the userId.
|
542
|
+
# @param app_user_update_body Body for an updateAppUser request.
|
543
|
+
# @param [Hash] opts the optional parameters
|
544
|
+
# @return [Array<(AppUserResponse, Fixnum, Hash)>] AppUserResponse data, response status code and response headers
|
545
|
+
def update_app_user_with_http_info(user_id, app_user_update_body, opts = {})
|
546
|
+
if @api_client.config.debugging
|
547
|
+
@api_client.config.logger.debug "Calling API: AppUserApi.update_app_user ..."
|
548
|
+
end
|
549
|
+
# verify the required parameter 'user_id' is set
|
550
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling AppUserApi.update_app_user" if user_id.nil?
|
551
|
+
# verify the required parameter 'app_user_update_body' is set
|
552
|
+
fail ArgumentError, "Missing the required parameter 'app_user_update_body' when calling AppUserApi.update_app_user" if app_user_update_body.nil?
|
553
|
+
# resource path
|
554
|
+
local_var_path = "/appusers/{userId}".sub('{' + 'userId' + '}', user_id.to_s)
|
555
|
+
|
556
|
+
# query parameters
|
557
|
+
query_params = {}
|
558
|
+
|
559
|
+
# header parameters
|
560
|
+
header_params = {}
|
561
|
+
# HTTP header 'Accept' (if needed)
|
562
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
563
|
+
# HTTP header 'Content-Type'
|
564
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
565
|
+
|
566
|
+
# form parameters
|
567
|
+
form_params = {}
|
568
|
+
|
569
|
+
# http body (model)
|
570
|
+
post_body = @api_client.object_to_http_body(app_user_update_body)
|
571
|
+
auth_names = ['jwt']
|
572
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
|
573
|
+
:header_params => header_params,
|
574
|
+
:query_params => query_params,
|
575
|
+
:form_params => form_params,
|
576
|
+
:body => post_body,
|
577
|
+
:auth_names => auth_names,
|
578
|
+
:return_type => 'AppUserResponse')
|
579
|
+
if @api_client.config.debugging
|
580
|
+
@api_client.config.logger.debug "API called: AppUserApi#update_app_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
581
|
+
end
|
582
|
+
return data, status_code, headers
|
583
|
+
end
|
584
|
+
end
|
585
|
+
end
|