notifo-io-easierlife 1.0.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.
Files changed (166) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +9 -0
  3. data/README.md +167 -0
  4. data/Rakefile +10 -0
  5. data/docs/AddAllowedTopicDto.md +18 -0
  6. data/docs/AddContributorDto.md +20 -0
  7. data/docs/AppContributorDto.md +22 -0
  8. data/docs/AppDetailsDto.md +48 -0
  9. data/docs/AppDto.md +28 -0
  10. data/docs/AppsApi.md +646 -0
  11. data/docs/ConfigsApi.md +127 -0
  12. data/docs/ConfirmMode.md +15 -0
  13. data/docs/CreateEmailTemplateDto.md +18 -0
  14. data/docs/EmailTemplateDto.md +22 -0
  15. data/docs/EmailVerificationStatus.md +15 -0
  16. data/docs/ErrorDto.md +26 -0
  17. data/docs/EventDto.md +40 -0
  18. data/docs/EventsApi.md +142 -0
  19. data/docs/IsoDayOfWeek.md +15 -0
  20. data/docs/ListResponseDtoOfEventDto.md +20 -0
  21. data/docs/ListResponseDtoOfLogEntryDto.md +20 -0
  22. data/docs/ListResponseDtoOfMediaDto.md +20 -0
  23. data/docs/ListResponseDtoOfSubscriptionDto.md +20 -0
  24. data/docs/ListResponseDtoOfTemplateDto.md +20 -0
  25. data/docs/ListResponseDtoOfTopicDto.md +20 -0
  26. data/docs/ListResponseDtoOfUserDto.md +20 -0
  27. data/docs/LogEntryDto.md +24 -0
  28. data/docs/LogsApi.md +78 -0
  29. data/docs/MediaApi.md +382 -0
  30. data/docs/MediaDto.md +30 -0
  31. data/docs/MediaType.md +15 -0
  32. data/docs/NotificationFormattingDto.md +32 -0
  33. data/docs/NotificationSend.md +15 -0
  34. data/docs/NotificationSettingDto.md +20 -0
  35. data/docs/ProfileDto.md +32 -0
  36. data/docs/PublishDto.md +36 -0
  37. data/docs/PublishManyDto.md +18 -0
  38. data/docs/ResizeMode.md +15 -0
  39. data/docs/SchedulingDto.md +24 -0
  40. data/docs/SchedulingType.md +15 -0
  41. data/docs/SubscriptionDto.md +20 -0
  42. data/docs/TemplateDto.md +22 -0
  43. data/docs/TemplatesApi.md +208 -0
  44. data/docs/TopicDto.md +22 -0
  45. data/docs/TopicsApi.md +78 -0
  46. data/docs/UpdateProfileDto.md +28 -0
  47. data/docs/UpsertAppDto.md +36 -0
  48. data/docs/UpsertTemplateDto.md +22 -0
  49. data/docs/UpsertTemplatesDto.md +18 -0
  50. data/docs/UpsertUserDto.md +32 -0
  51. data/docs/UpsertUsersDto.md +18 -0
  52. data/docs/UserApi.md +323 -0
  53. data/docs/UserDto.md +36 -0
  54. data/docs/UsersApi.md +610 -0
  55. data/git_push.sh +58 -0
  56. data/lib/notifo.rb +89 -0
  57. data/lib/notifo/api/apps_api.rb +678 -0
  58. data/lib/notifo/api/configs_api.rb +132 -0
  59. data/lib/notifo/api/events_api.rb +161 -0
  60. data/lib/notifo/api/logs_api.rb +92 -0
  61. data/lib/notifo/api/media_api.rb +419 -0
  62. data/lib/notifo/api/templates_api.rb +228 -0
  63. data/lib/notifo/api/topics_api.rb +92 -0
  64. data/lib/notifo/api/user_api.rb +331 -0
  65. data/lib/notifo/api/users_api.rb +667 -0
  66. data/lib/notifo/api_client.rb +389 -0
  67. data/lib/notifo/api_error.rb +57 -0
  68. data/lib/notifo/configuration.rb +270 -0
  69. data/lib/notifo/models/add_allowed_topic_dto.rb +243 -0
  70. data/lib/notifo/models/add_contributor_dto.rb +277 -0
  71. data/lib/notifo/models/app_contributor_dto.rb +311 -0
  72. data/lib/notifo/models/app_details_dto.rb +489 -0
  73. data/lib/notifo/models/app_dto.rb +362 -0
  74. data/lib/notifo/models/confirm_mode.rb +38 -0
  75. data/lib/notifo/models/create_email_template_dto.rb +243 -0
  76. data/lib/notifo/models/email_template_dto.rb +288 -0
  77. data/lib/notifo/models/email_verification_status.rb +39 -0
  78. data/lib/notifo/models/error_dto.rb +265 -0
  79. data/lib/notifo/models/event_dto.rb +456 -0
  80. data/lib/notifo/models/iso_day_of_week.rb +43 -0
  81. data/lib/notifo/models/list_response_dto_of_event_dto.rb +241 -0
  82. data/lib/notifo/models/list_response_dto_of_log_entry_dto.rb +241 -0
  83. data/lib/notifo/models/list_response_dto_of_media_dto.rb +241 -0
  84. data/lib/notifo/models/list_response_dto_of_subscription_dto.rb +241 -0
  85. data/lib/notifo/models/list_response_dto_of_template_dto.rb +241 -0
  86. data/lib/notifo/models/list_response_dto_of_topic_dto.rb +241 -0
  87. data/lib/notifo/models/list_response_dto_of_user_dto.rb +241 -0
  88. data/lib/notifo/models/log_entry_dto.rb +326 -0
  89. data/lib/notifo/models/media_dto.rb +390 -0
  90. data/lib/notifo/models/media_type.rb +39 -0
  91. data/lib/notifo/models/notification_formatting_dto.rb +305 -0
  92. data/lib/notifo/models/notification_send.rb +39 -0
  93. data/lib/notifo/models/notification_setting_dto.rb +234 -0
  94. data/lib/notifo/models/profile_dto.rb +361 -0
  95. data/lib/notifo/models/publish_dto.rb +338 -0
  96. data/lib/notifo/models/publish_many_dto.rb +226 -0
  97. data/lib/notifo/models/resize_mode.rb +42 -0
  98. data/lib/notifo/models/scheduling_dto.rb +248 -0
  99. data/lib/notifo/models/scheduling_type.rb +37 -0
  100. data/lib/notifo/models/subscription_dto.rb +256 -0
  101. data/lib/notifo/models/template_dto.rb +274 -0
  102. data/lib/notifo/models/topic_dto.rb +294 -0
  103. data/lib/notifo/models/update_profile_dto.rb +277 -0
  104. data/lib/notifo/models/upsert_app_dto.rb +321 -0
  105. data/lib/notifo/models/upsert_template_dto.rb +270 -0
  106. data/lib/notifo/models/upsert_templates_dto.rb +226 -0
  107. data/lib/notifo/models/upsert_user_dto.rb +299 -0
  108. data/lib/notifo/models/upsert_users_dto.rb +226 -0
  109. data/lib/notifo/models/user_dto.rb +381 -0
  110. data/lib/notifo/version.rb +15 -0
  111. data/notifo-io-1.0.0.gem +0 -0
  112. data/notifo.gemspec +38 -0
  113. data/spec/api/apps_api_spec.rb +151 -0
  114. data/spec/api/configs_api_spec.rb +55 -0
  115. data/spec/api/events_api_spec.rb +61 -0
  116. data/spec/api/logs_api_spec.rb +49 -0
  117. data/spec/api/media_api_spec.rb +117 -0
  118. data/spec/api/templates_api_spec.rb +73 -0
  119. data/spec/api/topics_api_spec.rb +49 -0
  120. data/spec/api/user_api_spec.rb +92 -0
  121. data/spec/api/users_api_spec.rb +152 -0
  122. data/spec/api_client_spec.rb +226 -0
  123. data/spec/configuration_spec.rb +42 -0
  124. data/spec/models/add_allowed_topic_dto_spec.rb +34 -0
  125. data/spec/models/add_contributor_dto_spec.rb +40 -0
  126. data/spec/models/app_contributor_dto_spec.rb +46 -0
  127. data/spec/models/app_details_dto_spec.rb +124 -0
  128. data/spec/models/app_dto_spec.rb +64 -0
  129. data/spec/models/confirm_mode_spec.rb +28 -0
  130. data/spec/models/create_email_template_dto_spec.rb +34 -0
  131. data/spec/models/email_template_dto_spec.rb +46 -0
  132. data/spec/models/email_verification_status_spec.rb +28 -0
  133. data/spec/models/error_dto_spec.rb +58 -0
  134. data/spec/models/event_dto_spec.rb +100 -0
  135. data/spec/models/iso_day_of_week_spec.rb +28 -0
  136. data/spec/models/list_response_dto_of_event_dto_spec.rb +40 -0
  137. data/spec/models/list_response_dto_of_log_entry_dto_spec.rb +40 -0
  138. data/spec/models/list_response_dto_of_media_dto_spec.rb +40 -0
  139. data/spec/models/list_response_dto_of_subscription_dto_spec.rb +40 -0
  140. data/spec/models/list_response_dto_of_template_dto_spec.rb +40 -0
  141. data/spec/models/list_response_dto_of_topic_dto_spec.rb +40 -0
  142. data/spec/models/list_response_dto_of_user_dto_spec.rb +40 -0
  143. data/spec/models/log_entry_dto_spec.rb +52 -0
  144. data/spec/models/media_dto_spec.rb +70 -0
  145. data/spec/models/media_type_spec.rb +28 -0
  146. data/spec/models/notification_formatting_dto_spec.rb +76 -0
  147. data/spec/models/notification_send_spec.rb +28 -0
  148. data/spec/models/notification_setting_dto_spec.rb +40 -0
  149. data/spec/models/profile_dto_spec.rb +76 -0
  150. data/spec/models/publish_dto_spec.rb +88 -0
  151. data/spec/models/publish_many_dto_spec.rb +34 -0
  152. data/spec/models/resize_mode_spec.rb +28 -0
  153. data/spec/models/scheduling_dto_spec.rb +52 -0
  154. data/spec/models/scheduling_type_spec.rb +28 -0
  155. data/spec/models/subscription_dto_spec.rb +40 -0
  156. data/spec/models/template_dto_spec.rb +46 -0
  157. data/spec/models/topic_dto_spec.rb +46 -0
  158. data/spec/models/update_profile_dto_spec.rb +64 -0
  159. data/spec/models/upsert_app_dto_spec.rb +88 -0
  160. data/spec/models/upsert_template_dto_spec.rb +46 -0
  161. data/spec/models/upsert_templates_dto_spec.rb +34 -0
  162. data/spec/models/upsert_user_dto_spec.rb +76 -0
  163. data/spec/models/upsert_users_dto_spec.rb +34 -0
  164. data/spec/models/user_dto_spec.rb +88 -0
  165. data/spec/spec_helper.rb +111 -0
  166. metadata +301 -0
@@ -0,0 +1,667 @@
1
+ =begin
2
+ #Notifo API
3
+
4
+ #No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
5
+
6
+ The version of the OpenAPI document: 1.0.0
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.1.0-SNAPSHOT
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Notifo
16
+ class UsersApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Remove an allowed topic.
23
+ # @param app_id [String] The app where the users belong to.
24
+ # @param id [String] The user id.
25
+ # @param prefix [String] The topic prefix.
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [nil]
28
+ def users_delete_allowed_topic(app_id, id, prefix, opts = {})
29
+ users_delete_allowed_topic_with_http_info(app_id, id, prefix, opts)
30
+ nil
31
+ end
32
+
33
+ # Remove an allowed topic.
34
+ # @param app_id [String] The app where the users belong to.
35
+ # @param id [String] The user id.
36
+ # @param prefix [String] The topic prefix.
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
39
+ def users_delete_allowed_topic_with_http_info(app_id, id, prefix, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: UsersApi.users_delete_allowed_topic ...'
42
+ end
43
+ # verify the required parameter 'app_id' is set
44
+ if @api_client.config.client_side_validation && app_id.nil?
45
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling UsersApi.users_delete_allowed_topic"
46
+ end
47
+ # verify the required parameter 'id' is set
48
+ if @api_client.config.client_side_validation && id.nil?
49
+ fail ArgumentError, "Missing the required parameter 'id' when calling UsersApi.users_delete_allowed_topic"
50
+ end
51
+ # verify the required parameter 'prefix' is set
52
+ if @api_client.config.client_side_validation && prefix.nil?
53
+ fail ArgumentError, "Missing the required parameter 'prefix' when calling UsersApi.users_delete_allowed_topic"
54
+ end
55
+ # resource path
56
+ local_var_path = '/api/apps/{appId}/users/{id}/allowed-topics/{prefix}'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'prefix' + '}', CGI.escape(prefix.to_s))
57
+
58
+ # query parameters
59
+ query_params = opts[:query_params] || {}
60
+
61
+ # header parameters
62
+ header_params = opts[:header_params] || {}
63
+ # HTTP header 'Accept' (if needed)
64
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
65
+
66
+ # form parameters
67
+ form_params = opts[:form_params] || {}
68
+
69
+ # http body (model)
70
+ post_body = opts[:debug_body]
71
+
72
+ # return_type
73
+ return_type = opts[:debug_return_type]
74
+
75
+ # auth_names
76
+ auth_names = opts[:debug_auth_names] || []
77
+
78
+ new_options = opts.merge(
79
+ :operation => :"UsersApi.users_delete_allowed_topic",
80
+ :header_params => header_params,
81
+ :query_params => query_params,
82
+ :form_params => form_params,
83
+ :body => post_body,
84
+ :auth_names => auth_names,
85
+ :return_type => return_type
86
+ )
87
+
88
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
89
+ if @api_client.config.debugging
90
+ @api_client.config.logger.debug "API called: UsersApi#users_delete_allowed_topic\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
91
+ end
92
+ return data, status_code, headers
93
+ end
94
+
95
+ # Remove a user subscriptions.
96
+ # @param app_id [String] The app where the user belongs to.
97
+ # @param id [String] The user id.
98
+ # @param prefix [String] The topic prefix.
99
+ # @param [Hash] opts the optional parameters
100
+ # @return [nil]
101
+ def users_delete_subscription(app_id, id, prefix, opts = {})
102
+ users_delete_subscription_with_http_info(app_id, id, prefix, opts)
103
+ nil
104
+ end
105
+
106
+ # Remove a user subscriptions.
107
+ # @param app_id [String] The app where the user belongs to.
108
+ # @param id [String] The user id.
109
+ # @param prefix [String] The topic prefix.
110
+ # @param [Hash] opts the optional parameters
111
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
112
+ def users_delete_subscription_with_http_info(app_id, id, prefix, opts = {})
113
+ if @api_client.config.debugging
114
+ @api_client.config.logger.debug 'Calling API: UsersApi.users_delete_subscription ...'
115
+ end
116
+ # verify the required parameter 'app_id' is set
117
+ if @api_client.config.client_side_validation && app_id.nil?
118
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling UsersApi.users_delete_subscription"
119
+ end
120
+ # verify the required parameter 'id' is set
121
+ if @api_client.config.client_side_validation && id.nil?
122
+ fail ArgumentError, "Missing the required parameter 'id' when calling UsersApi.users_delete_subscription"
123
+ end
124
+ # verify the required parameter 'prefix' is set
125
+ if @api_client.config.client_side_validation && prefix.nil?
126
+ fail ArgumentError, "Missing the required parameter 'prefix' when calling UsersApi.users_delete_subscription"
127
+ end
128
+ # resource path
129
+ local_var_path = '/api/apps/{appId}/users/{id}/subscriptions/{prefix}'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s)).sub('{' + 'prefix' + '}', CGI.escape(prefix.to_s))
130
+
131
+ # query parameters
132
+ query_params = opts[:query_params] || {}
133
+
134
+ # header parameters
135
+ header_params = opts[:header_params] || {}
136
+ # HTTP header 'Accept' (if needed)
137
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
138
+
139
+ # form parameters
140
+ form_params = opts[:form_params] || {}
141
+
142
+ # http body (model)
143
+ post_body = opts[:debug_body]
144
+
145
+ # return_type
146
+ return_type = opts[:debug_return_type]
147
+
148
+ # auth_names
149
+ auth_names = opts[:debug_auth_names] || []
150
+
151
+ new_options = opts.merge(
152
+ :operation => :"UsersApi.users_delete_subscription",
153
+ :header_params => header_params,
154
+ :query_params => query_params,
155
+ :form_params => form_params,
156
+ :body => post_body,
157
+ :auth_names => auth_names,
158
+ :return_type => return_type
159
+ )
160
+
161
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
162
+ if @api_client.config.debugging
163
+ @api_client.config.logger.debug "API called: UsersApi#users_delete_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
164
+ end
165
+ return data, status_code, headers
166
+ end
167
+
168
+ # Delete a user.
169
+ # @param app_id [String] The app where the users belongs to.
170
+ # @param id [String] The user id to delete.
171
+ # @param [Hash] opts the optional parameters
172
+ # @return [ListResponseDtoOfUserDto]
173
+ def users_delete_user(app_id, id, opts = {})
174
+ data, _status_code, _headers = users_delete_user_with_http_info(app_id, id, opts)
175
+ data
176
+ end
177
+
178
+ # Delete a user.
179
+ # @param app_id [String] The app where the users belongs to.
180
+ # @param id [String] The user id to delete.
181
+ # @param [Hash] opts the optional parameters
182
+ # @return [Array<(ListResponseDtoOfUserDto, Integer, Hash)>] ListResponseDtoOfUserDto data, response status code and response headers
183
+ def users_delete_user_with_http_info(app_id, id, opts = {})
184
+ if @api_client.config.debugging
185
+ @api_client.config.logger.debug 'Calling API: UsersApi.users_delete_user ...'
186
+ end
187
+ # verify the required parameter 'app_id' is set
188
+ if @api_client.config.client_side_validation && app_id.nil?
189
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling UsersApi.users_delete_user"
190
+ end
191
+ # verify the required parameter 'id' is set
192
+ if @api_client.config.client_side_validation && id.nil?
193
+ fail ArgumentError, "Missing the required parameter 'id' when calling UsersApi.users_delete_user"
194
+ end
195
+ # resource path
196
+ local_var_path = '/api/apps/{appId}/users/{id}'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
197
+
198
+ # query parameters
199
+ query_params = opts[:query_params] || {}
200
+
201
+ # header parameters
202
+ header_params = opts[:header_params] || {}
203
+ # HTTP header 'Accept' (if needed)
204
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
205
+
206
+ # form parameters
207
+ form_params = opts[:form_params] || {}
208
+
209
+ # http body (model)
210
+ post_body = opts[:debug_body]
211
+
212
+ # return_type
213
+ return_type = opts[:debug_return_type] || 'ListResponseDtoOfUserDto'
214
+
215
+ # auth_names
216
+ auth_names = opts[:debug_auth_names] || []
217
+
218
+ new_options = opts.merge(
219
+ :operation => :"UsersApi.users_delete_user",
220
+ :header_params => header_params,
221
+ :query_params => query_params,
222
+ :form_params => form_params,
223
+ :body => post_body,
224
+ :auth_names => auth_names,
225
+ :return_type => return_type
226
+ )
227
+
228
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
229
+ if @api_client.config.debugging
230
+ @api_client.config.logger.debug "API called: UsersApi#users_delete_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
231
+ end
232
+ return data, status_code, headers
233
+ end
234
+
235
+ # Query user subscriptions.
236
+ # @param app_id [String] The app where the user belongs to.
237
+ # @param id [String] The user id.
238
+ # @param [Hash] opts the optional parameters
239
+ # @option opts [String] :query The optional query to search for items.
240
+ # @option opts [Integer] :take The number of items to return.
241
+ # @option opts [Integer] :skip The number of items to skip.
242
+ # @return [ListResponseDtoOfSubscriptionDto]
243
+ def users_get_subscriptions(app_id, id, opts = {})
244
+ data, _status_code, _headers = users_get_subscriptions_with_http_info(app_id, id, opts)
245
+ data
246
+ end
247
+
248
+ # Query user subscriptions.
249
+ # @param app_id [String] The app where the user belongs to.
250
+ # @param id [String] The user id.
251
+ # @param [Hash] opts the optional parameters
252
+ # @option opts [String] :query The optional query to search for items.
253
+ # @option opts [Integer] :take The number of items to return.
254
+ # @option opts [Integer] :skip The number of items to skip.
255
+ # @return [Array<(ListResponseDtoOfSubscriptionDto, Integer, Hash)>] ListResponseDtoOfSubscriptionDto data, response status code and response headers
256
+ def users_get_subscriptions_with_http_info(app_id, id, opts = {})
257
+ if @api_client.config.debugging
258
+ @api_client.config.logger.debug 'Calling API: UsersApi.users_get_subscriptions ...'
259
+ end
260
+ # verify the required parameter 'app_id' is set
261
+ if @api_client.config.client_side_validation && app_id.nil?
262
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling UsersApi.users_get_subscriptions"
263
+ end
264
+ # verify the required parameter 'id' is set
265
+ if @api_client.config.client_side_validation && id.nil?
266
+ fail ArgumentError, "Missing the required parameter 'id' when calling UsersApi.users_get_subscriptions"
267
+ end
268
+ # resource path
269
+ local_var_path = '/api/apps/{appId}/users/{id}/subscriptions'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
270
+
271
+ # query parameters
272
+ query_params = opts[:query_params] || {}
273
+ query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?
274
+ query_params[:'take'] = opts[:'take'] if !opts[:'take'].nil?
275
+ query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil?
276
+
277
+ # header parameters
278
+ header_params = opts[:header_params] || {}
279
+ # HTTP header 'Accept' (if needed)
280
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
281
+
282
+ # form parameters
283
+ form_params = opts[:form_params] || {}
284
+
285
+ # http body (model)
286
+ post_body = opts[:debug_body]
287
+
288
+ # return_type
289
+ return_type = opts[:debug_return_type] || 'ListResponseDtoOfSubscriptionDto'
290
+
291
+ # auth_names
292
+ auth_names = opts[:debug_auth_names] || []
293
+
294
+ new_options = opts.merge(
295
+ :operation => :"UsersApi.users_get_subscriptions",
296
+ :header_params => header_params,
297
+ :query_params => query_params,
298
+ :form_params => form_params,
299
+ :body => post_body,
300
+ :auth_names => auth_names,
301
+ :return_type => return_type
302
+ )
303
+
304
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
305
+ if @api_client.config.debugging
306
+ @api_client.config.logger.debug "API called: UsersApi#users_get_subscriptions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
307
+ end
308
+ return data, status_code, headers
309
+ end
310
+
311
+ # Get a user.
312
+ # @param app_id [String] The app where the user belongs to.
313
+ # @param id [String] The user id.
314
+ # @param [Hash] opts the optional parameters
315
+ # @return [ListResponseDtoOfUserDto]
316
+ def users_get_user(app_id, id, opts = {})
317
+ data, _status_code, _headers = users_get_user_with_http_info(app_id, id, opts)
318
+ data
319
+ end
320
+
321
+ # Get a user.
322
+ # @param app_id [String] The app where the user belongs to.
323
+ # @param id [String] The user id.
324
+ # @param [Hash] opts the optional parameters
325
+ # @return [Array<(ListResponseDtoOfUserDto, Integer, Hash)>] ListResponseDtoOfUserDto data, response status code and response headers
326
+ def users_get_user_with_http_info(app_id, id, opts = {})
327
+ if @api_client.config.debugging
328
+ @api_client.config.logger.debug 'Calling API: UsersApi.users_get_user ...'
329
+ end
330
+ # verify the required parameter 'app_id' is set
331
+ if @api_client.config.client_side_validation && app_id.nil?
332
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling UsersApi.users_get_user"
333
+ end
334
+ # verify the required parameter 'id' is set
335
+ if @api_client.config.client_side_validation && id.nil?
336
+ fail ArgumentError, "Missing the required parameter 'id' when calling UsersApi.users_get_user"
337
+ end
338
+ # resource path
339
+ local_var_path = '/api/apps/{appId}/users/{id}'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
340
+
341
+ # query parameters
342
+ query_params = opts[:query_params] || {}
343
+
344
+ # header parameters
345
+ header_params = opts[:header_params] || {}
346
+ # HTTP header 'Accept' (if needed)
347
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
348
+
349
+ # form parameters
350
+ form_params = opts[:form_params] || {}
351
+
352
+ # http body (model)
353
+ post_body = opts[:debug_body]
354
+
355
+ # return_type
356
+ return_type = opts[:debug_return_type] || 'ListResponseDtoOfUserDto'
357
+
358
+ # auth_names
359
+ auth_names = opts[:debug_auth_names] || []
360
+
361
+ new_options = opts.merge(
362
+ :operation => :"UsersApi.users_get_user",
363
+ :header_params => header_params,
364
+ :query_params => query_params,
365
+ :form_params => form_params,
366
+ :body => post_body,
367
+ :auth_names => auth_names,
368
+ :return_type => return_type
369
+ )
370
+
371
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
372
+ if @api_client.config.debugging
373
+ @api_client.config.logger.debug "API called: UsersApi#users_get_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
374
+ end
375
+ return data, status_code, headers
376
+ end
377
+
378
+ # Query users.
379
+ # @param app_id [String] The app where the users belongs to.
380
+ # @param [Hash] opts the optional parameters
381
+ # @option opts [String] :query The optional query to search for items.
382
+ # @option opts [Integer] :take The number of items to return.
383
+ # @option opts [Integer] :skip The number of items to skip.
384
+ # @return [ListResponseDtoOfUserDto]
385
+ def users_get_users(app_id, opts = {})
386
+ data, _status_code, _headers = users_get_users_with_http_info(app_id, opts)
387
+ data
388
+ end
389
+
390
+ # Query users.
391
+ # @param app_id [String] The app where the users belongs to.
392
+ # @param [Hash] opts the optional parameters
393
+ # @option opts [String] :query The optional query to search for items.
394
+ # @option opts [Integer] :take The number of items to return.
395
+ # @option opts [Integer] :skip The number of items to skip.
396
+ # @return [Array<(ListResponseDtoOfUserDto, Integer, Hash)>] ListResponseDtoOfUserDto data, response status code and response headers
397
+ def users_get_users_with_http_info(app_id, opts = {})
398
+ if @api_client.config.debugging
399
+ @api_client.config.logger.debug 'Calling API: UsersApi.users_get_users ...'
400
+ end
401
+ # verify the required parameter 'app_id' is set
402
+ if @api_client.config.client_side_validation && app_id.nil?
403
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling UsersApi.users_get_users"
404
+ end
405
+ # resource path
406
+ local_var_path = '/api/apps/{appId}/users'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s))
407
+
408
+ # query parameters
409
+ query_params = opts[:query_params] || {}
410
+ query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?
411
+ query_params[:'take'] = opts[:'take'] if !opts[:'take'].nil?
412
+ query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil?
413
+
414
+ # header parameters
415
+ header_params = opts[:header_params] || {}
416
+ # HTTP header 'Accept' (if needed)
417
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
418
+
419
+ # form parameters
420
+ form_params = opts[:form_params] || {}
421
+
422
+ # http body (model)
423
+ post_body = opts[:debug_body]
424
+
425
+ # return_type
426
+ return_type = opts[:debug_return_type] || 'ListResponseDtoOfUserDto'
427
+
428
+ # auth_names
429
+ auth_names = opts[:debug_auth_names] || []
430
+
431
+ new_options = opts.merge(
432
+ :operation => :"UsersApi.users_get_users",
433
+ :header_params => header_params,
434
+ :query_params => query_params,
435
+ :form_params => form_params,
436
+ :body => post_body,
437
+ :auth_names => auth_names,
438
+ :return_type => return_type
439
+ )
440
+
441
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
442
+ if @api_client.config.debugging
443
+ @api_client.config.logger.debug "API called: UsersApi#users_get_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
444
+ end
445
+ return data, status_code, headers
446
+ end
447
+
448
+ # Add an allowed topic.
449
+ # @param app_id [String] The app where the users belong to.
450
+ # @param id [String] The user id.
451
+ # @param add_allowed_topic_dto [AddAllowedTopicDto] The upsert request.
452
+ # @param [Hash] opts the optional parameters
453
+ # @return [nil]
454
+ def users_post_allowed_topic(app_id, id, add_allowed_topic_dto, opts = {})
455
+ users_post_allowed_topic_with_http_info(app_id, id, add_allowed_topic_dto, opts)
456
+ nil
457
+ end
458
+
459
+ # Add an allowed topic.
460
+ # @param app_id [String] The app where the users belong to.
461
+ # @param id [String] The user id.
462
+ # @param add_allowed_topic_dto [AddAllowedTopicDto] The upsert request.
463
+ # @param [Hash] opts the optional parameters
464
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
465
+ def users_post_allowed_topic_with_http_info(app_id, id, add_allowed_topic_dto, opts = {})
466
+ if @api_client.config.debugging
467
+ @api_client.config.logger.debug 'Calling API: UsersApi.users_post_allowed_topic ...'
468
+ end
469
+ # verify the required parameter 'app_id' is set
470
+ if @api_client.config.client_side_validation && app_id.nil?
471
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling UsersApi.users_post_allowed_topic"
472
+ end
473
+ # verify the required parameter 'id' is set
474
+ if @api_client.config.client_side_validation && id.nil?
475
+ fail ArgumentError, "Missing the required parameter 'id' when calling UsersApi.users_post_allowed_topic"
476
+ end
477
+ # verify the required parameter 'add_allowed_topic_dto' is set
478
+ if @api_client.config.client_side_validation && add_allowed_topic_dto.nil?
479
+ fail ArgumentError, "Missing the required parameter 'add_allowed_topic_dto' when calling UsersApi.users_post_allowed_topic"
480
+ end
481
+ # resource path
482
+ local_var_path = '/api/apps/{appId}/users/{id}/allowed-topics'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
483
+
484
+ # query parameters
485
+ query_params = opts[:query_params] || {}
486
+
487
+ # header parameters
488
+ header_params = opts[:header_params] || {}
489
+ # HTTP header 'Accept' (if needed)
490
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
491
+ # HTTP header 'Content-Type'
492
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
493
+
494
+ # form parameters
495
+ form_params = opts[:form_params] || {}
496
+
497
+ # http body (model)
498
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(add_allowed_topic_dto)
499
+
500
+ # return_type
501
+ return_type = opts[:debug_return_type]
502
+
503
+ # auth_names
504
+ auth_names = opts[:debug_auth_names] || []
505
+
506
+ new_options = opts.merge(
507
+ :operation => :"UsersApi.users_post_allowed_topic",
508
+ :header_params => header_params,
509
+ :query_params => query_params,
510
+ :form_params => form_params,
511
+ :body => post_body,
512
+ :auth_names => auth_names,
513
+ :return_type => return_type
514
+ )
515
+
516
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
517
+ if @api_client.config.debugging
518
+ @api_client.config.logger.debug "API called: UsersApi#users_post_allowed_topic\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
519
+ end
520
+ return data, status_code, headers
521
+ end
522
+
523
+ # Upsert a user subscriptions.
524
+ # @param app_id [String] The app where the user belongs to.
525
+ # @param id [String] The user id.
526
+ # @param subscription_dto [SubscriptionDto] The subscription object.
527
+ # @param [Hash] opts the optional parameters
528
+ # @return [nil]
529
+ def users_post_subscription(app_id, id, subscription_dto, opts = {})
530
+ users_post_subscription_with_http_info(app_id, id, subscription_dto, opts)
531
+ nil
532
+ end
533
+
534
+ # Upsert a user subscriptions.
535
+ # @param app_id [String] The app where the user belongs to.
536
+ # @param id [String] The user id.
537
+ # @param subscription_dto [SubscriptionDto] The subscription object.
538
+ # @param [Hash] opts the optional parameters
539
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
540
+ def users_post_subscription_with_http_info(app_id, id, subscription_dto, opts = {})
541
+ if @api_client.config.debugging
542
+ @api_client.config.logger.debug 'Calling API: UsersApi.users_post_subscription ...'
543
+ end
544
+ # verify the required parameter 'app_id' is set
545
+ if @api_client.config.client_side_validation && app_id.nil?
546
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling UsersApi.users_post_subscription"
547
+ end
548
+ # verify the required parameter 'id' is set
549
+ if @api_client.config.client_side_validation && id.nil?
550
+ fail ArgumentError, "Missing the required parameter 'id' when calling UsersApi.users_post_subscription"
551
+ end
552
+ # verify the required parameter 'subscription_dto' is set
553
+ if @api_client.config.client_side_validation && subscription_dto.nil?
554
+ fail ArgumentError, "Missing the required parameter 'subscription_dto' when calling UsersApi.users_post_subscription"
555
+ end
556
+ # resource path
557
+ local_var_path = '/api/apps/{appId}/users/{id}/subscriptions'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s)).sub('{' + 'id' + '}', CGI.escape(id.to_s))
558
+
559
+ # query parameters
560
+ query_params = opts[:query_params] || {}
561
+
562
+ # header parameters
563
+ header_params = opts[:header_params] || {}
564
+ # HTTP header 'Accept' (if needed)
565
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
566
+ # HTTP header 'Content-Type'
567
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
568
+
569
+ # form parameters
570
+ form_params = opts[:form_params] || {}
571
+
572
+ # http body (model)
573
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(subscription_dto)
574
+
575
+ # return_type
576
+ return_type = opts[:debug_return_type]
577
+
578
+ # auth_names
579
+ auth_names = opts[:debug_auth_names] || []
580
+
581
+ new_options = opts.merge(
582
+ :operation => :"UsersApi.users_post_subscription",
583
+ :header_params => header_params,
584
+ :query_params => query_params,
585
+ :form_params => form_params,
586
+ :body => post_body,
587
+ :auth_names => auth_names,
588
+ :return_type => return_type
589
+ )
590
+
591
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
592
+ if @api_client.config.debugging
593
+ @api_client.config.logger.debug "API called: UsersApi#users_post_subscription\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
594
+ end
595
+ return data, status_code, headers
596
+ end
597
+
598
+ # Upsert users.
599
+ # @param app_id [String] The app where the users belong to.
600
+ # @param upsert_users_dto [UpsertUsersDto] The upsert request.
601
+ # @param [Hash] opts the optional parameters
602
+ # @return [Array<UserDto>]
603
+ def users_post_users(app_id, upsert_users_dto, opts = {})
604
+ data, _status_code, _headers = users_post_users_with_http_info(app_id, upsert_users_dto, opts)
605
+ data
606
+ end
607
+
608
+ # Upsert users.
609
+ # @param app_id [String] The app where the users belong to.
610
+ # @param upsert_users_dto [UpsertUsersDto] The upsert request.
611
+ # @param [Hash] opts the optional parameters
612
+ # @return [Array<(Array<UserDto>, Integer, Hash)>] Array<UserDto> data, response status code and response headers
613
+ def users_post_users_with_http_info(app_id, upsert_users_dto, opts = {})
614
+ if @api_client.config.debugging
615
+ @api_client.config.logger.debug 'Calling API: UsersApi.users_post_users ...'
616
+ end
617
+ # verify the required parameter 'app_id' is set
618
+ if @api_client.config.client_side_validation && app_id.nil?
619
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling UsersApi.users_post_users"
620
+ end
621
+ # verify the required parameter 'upsert_users_dto' is set
622
+ if @api_client.config.client_side_validation && upsert_users_dto.nil?
623
+ fail ArgumentError, "Missing the required parameter 'upsert_users_dto' when calling UsersApi.users_post_users"
624
+ end
625
+ # resource path
626
+ local_var_path = '/api/apps/{appId}/users'.sub('{' + 'appId' + '}', CGI.escape(app_id.to_s))
627
+
628
+ # query parameters
629
+ query_params = opts[:query_params] || {}
630
+
631
+ # header parameters
632
+ header_params = opts[:header_params] || {}
633
+ # HTTP header 'Accept' (if needed)
634
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
635
+ # HTTP header 'Content-Type'
636
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
637
+
638
+ # form parameters
639
+ form_params = opts[:form_params] || {}
640
+
641
+ # http body (model)
642
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(upsert_users_dto)
643
+
644
+ # return_type
645
+ return_type = opts[:debug_return_type] || 'Array<UserDto>'
646
+
647
+ # auth_names
648
+ auth_names = opts[:debug_auth_names] || []
649
+
650
+ new_options = opts.merge(
651
+ :operation => :"UsersApi.users_post_users",
652
+ :header_params => header_params,
653
+ :query_params => query_params,
654
+ :form_params => form_params,
655
+ :body => post_body,
656
+ :auth_names => auth_names,
657
+ :return_type => return_type
658
+ )
659
+
660
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
661
+ if @api_client.config.debugging
662
+ @api_client.config.logger.debug "API called: UsersApi#users_post_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
663
+ end
664
+ return data, status_code, headers
665
+ end
666
+ end
667
+ end