smooch-api 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (121) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +7 -0
  3. data/README.md +181 -0
  4. data/Rakefile +8 -0
  5. data/docs/Action.md +16 -0
  6. data/docs/App.md +10 -0
  7. data/docs/AppApi.md +609 -0
  8. data/docs/AppCreate.md +8 -0
  9. data/docs/AppResponse.md +8 -0
  10. data/docs/AppUser.md +18 -0
  11. data/docs/AppUserApi.md +561 -0
  12. data/docs/AppUserLink.md +9 -0
  13. data/docs/AppUserPreCreate.md +14 -0
  14. data/docs/AppUserResponse.md +8 -0
  15. data/docs/AppUserUpdate.md +12 -0
  16. data/docs/Client.md +14 -0
  17. data/docs/ClientInfo.md +15 -0
  18. data/docs/Conversation.md +9 -0
  19. data/docs/ConversationApi.md +282 -0
  20. data/docs/Destination.md +9 -0
  21. data/docs/DeviceInit.md +12 -0
  22. data/docs/DeviceResponse.md +8 -0
  23. data/docs/DeviceUpdate.md +10 -0
  24. data/docs/DisplaySettings.md +8 -0
  25. data/docs/Event.md +8 -0
  26. data/docs/GetMessagesResponse.md +10 -0
  27. data/docs/Init.md +9 -0
  28. data/docs/InitApi.md +61 -0
  29. data/docs/InitResponse.md +9 -0
  30. data/docs/Integration.md +24 -0
  31. data/docs/IntegrationApi.md +121 -0
  32. data/docs/IntegrationCreate.md +23 -0
  33. data/docs/IntegrationResponse.md +8 -0
  34. data/docs/JwtResponse.md +8 -0
  35. data/docs/ListAppsResponse.md +10 -0
  36. data/docs/ListIntegrationsResponse.md +8 -0
  37. data/docs/ListSecretKeysResponse.md +8 -0
  38. data/docs/ListWebhooksResponse.md +8 -0
  39. data/docs/Menu.md +9 -0
  40. data/docs/MenuApi.md +155 -0
  41. data/docs/MenuItem.md +11 -0
  42. data/docs/MenuResponse.md +8 -0
  43. data/docs/Message.md +23 -0
  44. data/docs/MessageItem.md +13 -0
  45. data/docs/MessagePost.md +20 -0
  46. data/docs/MessageResponse.md +9 -0
  47. data/docs/PostMessagesResponse.md +9 -0
  48. data/docs/SecretKey.md +10 -0
  49. data/docs/SecretKeyCreate.md +8 -0
  50. data/docs/SecretKeyResponse.md +8 -0
  51. data/docs/TrackEventResponse.md +8 -0
  52. data/docs/TypingActivityTrigger.md +11 -0
  53. data/docs/Webhook.md +11 -0
  54. data/docs/WebhookApi.md +287 -0
  55. data/docs/WebhookCreate.md +9 -0
  56. data/docs/WebhookResponse.md +8 -0
  57. data/docs/WebhookUpdate.md +9 -0
  58. data/git_push.sh +55 -0
  59. data/lib/smooch-api.rb +91 -0
  60. data/lib/smooch-api/api/app_api.rb +628 -0
  61. data/lib/smooch-api/api/app_user_api.rb +585 -0
  62. data/lib/smooch-api/api/conversation_api.rb +298 -0
  63. data/lib/smooch-api/api/init_api.rb +75 -0
  64. data/lib/smooch-api/api/integration_api.rb +135 -0
  65. data/lib/smooch-api/api/menu_api.rb +173 -0
  66. data/lib/smooch-api/api/webhook_api.rb +306 -0
  67. data/lib/smooch-api/api_client.rb +376 -0
  68. data/lib/smooch-api/api_error.rb +37 -0
  69. data/lib/smooch-api/configuration.rb +202 -0
  70. data/lib/smooch-api/models/action.rb +311 -0
  71. data/lib/smooch-api/models/app.rb +223 -0
  72. data/lib/smooch-api/models/app_create.rb +193 -0
  73. data/lib/smooch-api/models/app_response.rb +188 -0
  74. data/lib/smooch-api/models/app_user.rb +307 -0
  75. data/lib/smooch-api/models/app_user_link.rb +236 -0
  76. data/lib/smooch-api/models/app_user_pre_create.rb +253 -0
  77. data/lib/smooch-api/models/app_user_response.rb +193 -0
  78. data/lib/smooch-api/models/app_user_update.rb +228 -0
  79. data/lib/smooch-api/models/client.rb +290 -0
  80. data/lib/smooch-api/models/client_info.rb +258 -0
  81. data/lib/smooch-api/models/conversation.rb +208 -0
  82. data/lib/smooch-api/models/destination.rb +208 -0
  83. data/lib/smooch-api/models/device_init.rb +270 -0
  84. data/lib/smooch-api/models/device_response.rb +188 -0
  85. data/lib/smooch-api/models/device_update.rb +207 -0
  86. data/lib/smooch-api/models/display_settings.rb +188 -0
  87. data/lib/smooch-api/models/event.rb +193 -0
  88. data/lib/smooch-api/models/get_messages_response.rb +210 -0
  89. data/lib/smooch-api/models/init.rb +202 -0
  90. data/lib/smooch-api/models/init_response.rb +208 -0
  91. data/lib/smooch-api/models/integration.rb +358 -0
  92. data/lib/smooch-api/models/integration_create.rb +343 -0
  93. data/lib/smooch-api/models/integration_response.rb +188 -0
  94. data/lib/smooch-api/models/jwt_response.rb +188 -0
  95. data/lib/smooch-api/models/list_apps_response.rb +210 -0
  96. data/lib/smooch-api/models/list_integrations_response.rb +190 -0
  97. data/lib/smooch-api/models/list_secret_keys_response.rb +190 -0
  98. data/lib/smooch-api/models/list_webhooks_response.rb +195 -0
  99. data/lib/smooch-api/models/menu.rb +205 -0
  100. data/lib/smooch-api/models/menu_item.rb +228 -0
  101. data/lib/smooch-api/models/menu_response.rb +193 -0
  102. data/lib/smooch-api/models/message.rb +415 -0
  103. data/lib/smooch-api/models/message_item.rb +250 -0
  104. data/lib/smooch-api/models/message_post.rb +355 -0
  105. data/lib/smooch-api/models/message_response.rb +208 -0
  106. data/lib/smooch-api/models/post_messages_response.rb +200 -0
  107. data/lib/smooch-api/models/secret_key.rb +223 -0
  108. data/lib/smooch-api/models/secret_key_create.rb +193 -0
  109. data/lib/smooch-api/models/secret_key_response.rb +188 -0
  110. data/lib/smooch-api/models/track_event_response.rb +188 -0
  111. data/lib/smooch-api/models/typing_activity_trigger.rb +228 -0
  112. data/lib/smooch-api/models/webhook.rb +261 -0
  113. data/lib/smooch-api/models/webhook_create.rb +226 -0
  114. data/lib/smooch-api/models/webhook_response.rb +193 -0
  115. data/lib/smooch-api/models/webhook_update.rb +221 -0
  116. data/lib/smooch-api/version.rb +14 -0
  117. data/smooch-api.gemspec +44 -0
  118. data/spec/api_client_spec.rb +225 -0
  119. data/spec/configuration_spec.rb +41 -0
  120. data/spec/spec_helper.rb +110 -0
  121. metadata +349 -0
@@ -0,0 +1,298 @@
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 ConversationApi
16
+ attr_accessor :api_client
17
+
18
+ def initialize(api_client = ApiClient.default)
19
+ @api_client = api_client
20
+ end
21
+
22
+ #
23
+ # Clears the message history for a user, permanently deleting all messages, but leaving any connections to Messaging Channels and Business Systems intact. These connections allow for the conversation to continue in the future, while still being associated to the same appUser.
24
+ # @param user_id Identifies the user. Can be either the smoochId or the userId.
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [nil]
27
+ def delete_messages(user_id, opts = {})
28
+ delete_messages_with_http_info(user_id, opts)
29
+ return nil
30
+ end
31
+
32
+ #
33
+ # Clears the message history for a user, permanently deleting all messages, but leaving any connections to Messaging Channels and Business Systems intact. These connections allow for the conversation to continue in the future, while still being associated to the same appUser.
34
+ # @param user_id Identifies the user. Can be either the smoochId or the userId.
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
37
+ def delete_messages_with_http_info(user_id, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug "Calling API: ConversationApi.delete_messages ..."
40
+ end
41
+ # verify the required parameter 'user_id' is set
42
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling ConversationApi.delete_messages" if user_id.nil?
43
+ # resource path
44
+ local_var_path = "/appusers/{userId}/messages".sub('{' + 'userId' + '}', user_id.to_s)
45
+
46
+ # query parameters
47
+ query_params = {}
48
+
49
+ # header parameters
50
+ header_params = {}
51
+ # HTTP header 'Accept' (if needed)
52
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
53
+ # HTTP header 'Content-Type'
54
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
55
+
56
+ # form parameters
57
+ form_params = {}
58
+
59
+ # http body (model)
60
+ post_body = nil
61
+ auth_names = ['jwt']
62
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
63
+ :header_params => header_params,
64
+ :query_params => query_params,
65
+ :form_params => form_params,
66
+ :body => post_body,
67
+ :auth_names => auth_names)
68
+ if @api_client.config.debugging
69
+ @api_client.config.logger.debug "API called: ConversationApi#delete_messages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
70
+ end
71
+ return data, status_code, headers
72
+ end
73
+
74
+ #
75
+ # Get the specified app user's messages.
76
+ # @param user_id Identifies the user. Can be either the smoochId or the userId.
77
+ # @param [Hash] opts the optional parameters
78
+ # @option opts [String] :before Timestamp of message. The API will return 100 messages before the specified timestamp (excluding any messages with the provided timestamp).
79
+ # @option opts [String] :after Timestamp of message. The API will return 100 messages after the specified timestamp (excluding any messages with the provided timestamp).
80
+ # @return [GetMessagesResponse]
81
+ def get_messages(user_id, opts = {})
82
+ data, _status_code, _headers = get_messages_with_http_info(user_id, opts)
83
+ return data
84
+ end
85
+
86
+ #
87
+ # Get the specified app user&#39;s messages.
88
+ # @param user_id Identifies the user. Can be either the smoochId or the userId.
89
+ # @param [Hash] opts the optional parameters
90
+ # @option opts [String] :before Timestamp of message. The API will return 100 messages before the specified timestamp (excluding any messages with the provided timestamp).
91
+ # @option opts [String] :after Timestamp of message. The API will return 100 messages after the specified timestamp (excluding any messages with the provided timestamp).
92
+ # @return [Array<(GetMessagesResponse, Fixnum, Hash)>] GetMessagesResponse data, response status code and response headers
93
+ def get_messages_with_http_info(user_id, opts = {})
94
+ if @api_client.config.debugging
95
+ @api_client.config.logger.debug "Calling API: ConversationApi.get_messages ..."
96
+ end
97
+ # verify the required parameter 'user_id' is set
98
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling ConversationApi.get_messages" if user_id.nil?
99
+ # resource path
100
+ local_var_path = "/appusers/{userId}/messages".sub('{' + 'userId' + '}', user_id.to_s)
101
+
102
+ # query parameters
103
+ query_params = {}
104
+ query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
105
+ query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
106
+
107
+ # header parameters
108
+ header_params = {}
109
+ # HTTP header 'Accept' (if needed)
110
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
111
+ # HTTP header 'Content-Type'
112
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
113
+
114
+ # form parameters
115
+ form_params = {}
116
+
117
+ # http body (model)
118
+ post_body = nil
119
+ auth_names = ['jwt']
120
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
121
+ :header_params => header_params,
122
+ :query_params => query_params,
123
+ :form_params => form_params,
124
+ :body => post_body,
125
+ :auth_names => auth_names,
126
+ :return_type => 'GetMessagesResponse')
127
+ if @api_client.config.debugging
128
+ @api_client.config.logger.debug "API called: ConversationApi#get_messages\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
129
+ end
130
+ return data, status_code, headers
131
+ end
132
+
133
+ #
134
+ # Post a message to or from the app user.
135
+ # @param user_id Identifies the user. Can be either the smoochId or the userId.
136
+ # @param message_post_body Body for a postMessage request. Additional arguments are necessary based on message type ([text](https://docs.smooch.io/rest#text-message), [image](https://docs.smooch.io/rest#image-message), [carousel](https://docs.smooch.io/rest#carousel-message), [list](https://docs.smooch.io/rest#list-message))
137
+ # @param [Hash] opts the optional parameters
138
+ # @return [PostMessagesResponse]
139
+ def post_message(user_id, message_post_body, opts = {})
140
+ data, _status_code, _headers = post_message_with_http_info(user_id, message_post_body, opts)
141
+ return data
142
+ end
143
+
144
+ #
145
+ # Post a message to or from the app user.
146
+ # @param user_id Identifies the user. Can be either the smoochId or the userId.
147
+ # @param message_post_body Body for a postMessage request. Additional arguments are necessary based on message type ([text](https://docs.smooch.io/rest#text-message), [image](https://docs.smooch.io/rest#image-message), [carousel](https://docs.smooch.io/rest#carousel-message), [list](https://docs.smooch.io/rest#list-message))
148
+ # @param [Hash] opts the optional parameters
149
+ # @return [Array<(PostMessagesResponse, Fixnum, Hash)>] PostMessagesResponse data, response status code and response headers
150
+ def post_message_with_http_info(user_id, message_post_body, opts = {})
151
+ if @api_client.config.debugging
152
+ @api_client.config.logger.debug "Calling API: ConversationApi.post_message ..."
153
+ end
154
+ # verify the required parameter 'user_id' is set
155
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling ConversationApi.post_message" if user_id.nil?
156
+ # verify the required parameter 'message_post_body' is set
157
+ fail ArgumentError, "Missing the required parameter 'message_post_body' when calling ConversationApi.post_message" if message_post_body.nil?
158
+ # resource path
159
+ local_var_path = "/appusers/{userId}/messages".sub('{' + 'userId' + '}', user_id.to_s)
160
+
161
+ # query parameters
162
+ query_params = {}
163
+
164
+ # header parameters
165
+ header_params = {}
166
+ # HTTP header 'Accept' (if needed)
167
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
168
+ # HTTP header 'Content-Type'
169
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
170
+
171
+ # form parameters
172
+ form_params = {}
173
+
174
+ # http body (model)
175
+ post_body = @api_client.object_to_http_body(message_post_body)
176
+ auth_names = ['jwt']
177
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
178
+ :header_params => header_params,
179
+ :query_params => query_params,
180
+ :form_params => form_params,
181
+ :body => post_body,
182
+ :auth_names => auth_names,
183
+ :return_type => 'PostMessagesResponse')
184
+ if @api_client.config.debugging
185
+ @api_client.config.logger.debug "API called: ConversationApi#post_message\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
186
+ end
187
+ return data, status_code, headers
188
+ end
189
+
190
+ #
191
+ # Reset the unread count of the conversation to 0.
192
+ # @param user_id Identifies the user. Can be either the smoochId or the userId.
193
+ # @param [Hash] opts the optional parameters
194
+ # @return [nil]
195
+ def reset_unread_count(user_id, opts = {})
196
+ reset_unread_count_with_http_info(user_id, opts)
197
+ return nil
198
+ end
199
+
200
+ #
201
+ # Reset the unread count of the conversation to 0.
202
+ # @param user_id Identifies the user. Can be either the smoochId or the userId.
203
+ # @param [Hash] opts the optional parameters
204
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
205
+ def reset_unread_count_with_http_info(user_id, opts = {})
206
+ if @api_client.config.debugging
207
+ @api_client.config.logger.debug "Calling API: ConversationApi.reset_unread_count ..."
208
+ end
209
+ # verify the required parameter 'user_id' is set
210
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling ConversationApi.reset_unread_count" if user_id.nil?
211
+ # resource path
212
+ local_var_path = "/appusers/{userId}/conversation/read".sub('{' + 'userId' + '}', user_id.to_s)
213
+
214
+ # query parameters
215
+ query_params = {}
216
+
217
+ # header parameters
218
+ header_params = {}
219
+ # HTTP header 'Accept' (if needed)
220
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
221
+ # HTTP header 'Content-Type'
222
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
223
+
224
+ # form parameters
225
+ form_params = {}
226
+
227
+ # http body (model)
228
+ post_body = nil
229
+ auth_names = ['jwt']
230
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
231
+ :header_params => header_params,
232
+ :query_params => query_params,
233
+ :form_params => form_params,
234
+ :body => post_body,
235
+ :auth_names => auth_names)
236
+ if @api_client.config.debugging
237
+ @api_client.config.logger.debug "API called: ConversationApi#reset_unread_count\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
238
+ end
239
+ return data, status_code, headers
240
+ end
241
+
242
+ #
243
+ # Notify Smooch when an app maker starts or stops typing a response.
244
+ # @param user_id Identifies the user. Can be either the smoochId or the userId.
245
+ # @param typing_activity_trigger_body Body for a triggerTypingActivity request.
246
+ # @param [Hash] opts the optional parameters
247
+ # @return [nil]
248
+ def trigger_typing_activity(user_id, typing_activity_trigger_body, opts = {})
249
+ trigger_typing_activity_with_http_info(user_id, typing_activity_trigger_body, opts)
250
+ return nil
251
+ end
252
+
253
+ #
254
+ # Notify Smooch when an app maker starts or stops typing a response.
255
+ # @param user_id Identifies the user. Can be either the smoochId or the userId.
256
+ # @param typing_activity_trigger_body Body for a triggerTypingActivity request.
257
+ # @param [Hash] opts the optional parameters
258
+ # @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
259
+ def trigger_typing_activity_with_http_info(user_id, typing_activity_trigger_body, opts = {})
260
+ if @api_client.config.debugging
261
+ @api_client.config.logger.debug "Calling API: ConversationApi.trigger_typing_activity ..."
262
+ end
263
+ # verify the required parameter 'user_id' is set
264
+ fail ArgumentError, "Missing the required parameter 'user_id' when calling ConversationApi.trigger_typing_activity" if user_id.nil?
265
+ # verify the required parameter 'typing_activity_trigger_body' is set
266
+ fail ArgumentError, "Missing the required parameter 'typing_activity_trigger_body' when calling ConversationApi.trigger_typing_activity" if typing_activity_trigger_body.nil?
267
+ # resource path
268
+ local_var_path = "/appusers/{userId}/conversation/activity".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(typing_activity_trigger_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
+ if @api_client.config.debugging
293
+ @api_client.config.logger.debug "API called: ConversationApi#trigger_typing_activity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
294
+ end
295
+ return data, status_code, headers
296
+ end
297
+ end
298
+ end
@@ -0,0 +1,75 @@
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 InitApi
16
+ attr_accessor :api_client
17
+
18
+ def initialize(api_client = ApiClient.default)
19
+ @api_client = api_client
20
+ end
21
+
22
+ #
23
+ # This API is called by an iOS, Android, or browser client when the app is first loaded. It serves a number of purposes. 1. Initializes a new *appUser* and *client* if they don’t yet exist. 2. Updates an existing app user’s profile and client information. 3. Authenticates the *appUser* if *jwt* credentials are provided.
24
+ # @param init_body Body for an init request.
25
+ # @param [Hash] opts the optional parameters
26
+ # @return [InitResponse]
27
+ def init(init_body, opts = {})
28
+ data, _status_code, _headers = init_with_http_info(init_body, opts)
29
+ return data
30
+ end
31
+
32
+ #
33
+ # This API is called by an iOS, Android, or browser client when the app is first loaded. It serves a number of purposes. 1. Initializes a new *appUser* and *client* if they don’t yet exist. 2. Updates an existing app user’s profile and client information. 3. Authenticates the *appUser* if *jwt* credentials are provided.
34
+ # @param init_body Body for an init request.
35
+ # @param [Hash] opts the optional parameters
36
+ # @return [Array<(InitResponse, Fixnum, Hash)>] InitResponse data, response status code and response headers
37
+ def init_with_http_info(init_body, opts = {})
38
+ if @api_client.config.debugging
39
+ @api_client.config.logger.debug "Calling API: InitApi.init ..."
40
+ end
41
+ # verify the required parameter 'init_body' is set
42
+ fail ArgumentError, "Missing the required parameter 'init_body' when calling InitApi.init" if init_body.nil?
43
+ # resource path
44
+ local_var_path = "/init"
45
+
46
+ # query parameters
47
+ query_params = {}
48
+
49
+ # header parameters
50
+ header_params = {}
51
+ # HTTP header 'Accept' (if needed)
52
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
53
+ # HTTP header 'Content-Type'
54
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
55
+
56
+ # form parameters
57
+ form_params = {}
58
+
59
+ # http body (model)
60
+ post_body = @api_client.object_to_http_body(init_body)
61
+ auth_names = ['jwt']
62
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
63
+ :header_params => header_params,
64
+ :query_params => query_params,
65
+ :form_params => form_params,
66
+ :body => post_body,
67
+ :auth_names => auth_names,
68
+ :return_type => 'InitResponse')
69
+ if @api_client.config.debugging
70
+ @api_client.config.logger.debug "API called: InitApi#init\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
71
+ end
72
+ return data, status_code, headers
73
+ end
74
+ end
75
+ end
@@ -0,0 +1,135 @@
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 IntegrationApi
16
+ attr_accessor :api_client
17
+
18
+ def initialize(api_client = ApiClient.default)
19
+ @api_client = api_client
20
+ end
21
+
22
+ #
23
+ # Create an integration for the specified app.
24
+ # @param app_id Identifies the app.
25
+ # @param integration_create_body Body for a createIntegration request. Additional arguments are necessary based on integration type. For detailed instructions, visit our [official docs](https://docs.smooch.io/rest/#create-integration)
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [IntegrationResponse]
28
+ def create_integration(app_id, integration_create_body, opts = {})
29
+ data, _status_code, _headers = create_integration_with_http_info(app_id, integration_create_body, opts)
30
+ return data
31
+ end
32
+
33
+ #
34
+ # Create an integration for the specified app.
35
+ # @param app_id Identifies the app.
36
+ # @param integration_create_body Body for a createIntegration request. Additional arguments are necessary based on integration type. For detailed instructions, visit our [official docs](https://docs.smooch.io/rest/#create-integration)
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(IntegrationResponse, Fixnum, Hash)>] IntegrationResponse data, response status code and response headers
39
+ def create_integration_with_http_info(app_id, integration_create_body, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug "Calling API: IntegrationApi.create_integration ..."
42
+ end
43
+ # verify the required parameter 'app_id' is set
44
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling IntegrationApi.create_integration" if app_id.nil?
45
+ # verify the required parameter 'integration_create_body' is set
46
+ fail ArgumentError, "Missing the required parameter 'integration_create_body' when calling IntegrationApi.create_integration" if integration_create_body.nil?
47
+ # resource path
48
+ local_var_path = "/apps/{appId}/integrations".sub('{' + 'appId' + '}', app_id.to_s)
49
+
50
+ # query parameters
51
+ query_params = {}
52
+
53
+ # header parameters
54
+ header_params = {}
55
+ # HTTP header 'Accept' (if needed)
56
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
57
+ # HTTP header 'Content-Type'
58
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
59
+
60
+ # form parameters
61
+ form_params = {}
62
+
63
+ # http body (model)
64
+ post_body = @api_client.object_to_http_body(integration_create_body)
65
+ auth_names = ['jwt']
66
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path,
67
+ :header_params => header_params,
68
+ :query_params => query_params,
69
+ :form_params => form_params,
70
+ :body => post_body,
71
+ :auth_names => auth_names,
72
+ :return_type => 'IntegrationResponse')
73
+ if @api_client.config.debugging
74
+ @api_client.config.logger.debug "API called: IntegrationApi#create_integration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
75
+ end
76
+ return data, status_code, headers
77
+ end
78
+
79
+ #
80
+ # List integrations for the specified app.
81
+ # @param app_id Identifies the app.
82
+ # @param [Hash] opts the optional parameters
83
+ # @option opts [String] :types List of types to filter the query by. More than one value can be specified through comma separation e.g. ?types&#x3D;*twilio*,*line*.
84
+ # @return [ListIntegrationsResponse]
85
+ def list_integrations(app_id, opts = {})
86
+ data, _status_code, _headers = list_integrations_with_http_info(app_id, opts)
87
+ return data
88
+ end
89
+
90
+ #
91
+ # List integrations for the specified app.
92
+ # @param app_id Identifies the app.
93
+ # @param [Hash] opts the optional parameters
94
+ # @option opts [String] :types List of types to filter the query by. More than one value can be specified through comma separation e.g. ?types&#x3D;*twilio*,*line*.
95
+ # @return [Array<(ListIntegrationsResponse, Fixnum, Hash)>] ListIntegrationsResponse data, response status code and response headers
96
+ def list_integrations_with_http_info(app_id, opts = {})
97
+ if @api_client.config.debugging
98
+ @api_client.config.logger.debug "Calling API: IntegrationApi.list_integrations ..."
99
+ end
100
+ # verify the required parameter 'app_id' is set
101
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling IntegrationApi.list_integrations" if app_id.nil?
102
+ # resource path
103
+ local_var_path = "/apps/{appId}/integrations".sub('{' + 'appId' + '}', app_id.to_s)
104
+
105
+ # query parameters
106
+ query_params = {}
107
+ query_params[:'types'] = opts[:'types'] if !opts[:'types'].nil?
108
+
109
+ # header parameters
110
+ header_params = {}
111
+ # HTTP header 'Accept' (if needed)
112
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
113
+ # HTTP header 'Content-Type'
114
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
115
+
116
+ # form parameters
117
+ form_params = {}
118
+
119
+ # http body (model)
120
+ post_body = nil
121
+ auth_names = ['jwt']
122
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path,
123
+ :header_params => header_params,
124
+ :query_params => query_params,
125
+ :form_params => form_params,
126
+ :body => post_body,
127
+ :auth_names => auth_names,
128
+ :return_type => 'ListIntegrationsResponse')
129
+ if @api_client.config.debugging
130
+ @api_client.config.logger.debug "API called: IntegrationApi#list_integrations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
131
+ end
132
+ return data, status_code, headers
133
+ end
134
+ end
135
+ end