svix 0.16.0 → 0.34.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +9 -3
  3. data/README.md +16 -3
  4. data/lib/svix/api/application_api.rb +386 -0
  5. data/lib/svix/api/authentication_api.rb +155 -0
  6. data/lib/svix/api/endpoint_api.rb +877 -0
  7. data/lib/svix/api/event_type_api.rb +454 -0
  8. data/lib/svix/api/health_api.rb +77 -0
  9. data/lib/svix/api/message_api.rb +289 -0
  10. data/lib/svix/api/message_attempt_api.rb +678 -0
  11. data/lib/svix/api_client.rb +399 -0
  12. data/lib/svix/api_error.rb +57 -0
  13. data/lib/svix/application_api.rb +29 -0
  14. data/lib/svix/authentication_api.rb +17 -0
  15. data/lib/svix/configuration.rb +277 -0
  16. data/lib/svix/endpoint_api.rb +38 -0
  17. data/{src → lib}/svix/errors.rb +4 -1
  18. data/lib/svix/event_type_api.rb +25 -0
  19. data/lib/svix/internal.rb +16 -0
  20. data/lib/svix/message_api.rb +21 -0
  21. data/lib/svix/message_attempt_api.rb +33 -0
  22. data/lib/svix/models/application_in.rb +277 -0
  23. data/lib/svix/models/application_out.rb +305 -0
  24. data/lib/svix/models/dashboard_access_out.rb +265 -0
  25. data/lib/svix/models/endpoint_created_event.rb +269 -0
  26. data/lib/svix/models/endpoint_created_event_data.rb +282 -0
  27. data/lib/svix/models/endpoint_deleted_event.rb +269 -0
  28. data/lib/svix/models/endpoint_deleted_event_data.rb +282 -0
  29. data/lib/svix/models/endpoint_disabled_event.rb +269 -0
  30. data/lib/svix/models/endpoint_disabled_event_data.rb +296 -0
  31. data/lib/svix/models/endpoint_in.rb +394 -0
  32. data/lib/svix/models/endpoint_message_out.rb +363 -0
  33. data/lib/svix/models/endpoint_out.rb +395 -0
  34. data/lib/svix/models/endpoint_secret_out.rb +245 -0
  35. data/lib/svix/models/endpoint_secret_rotate_in.rb +236 -0
  36. data/lib/svix/models/endpoint_stats.rb +265 -0
  37. data/lib/svix/models/endpoint_update.rb +367 -0
  38. data/lib/svix/models/endpoint_updated_event.rb +269 -0
  39. data/lib/svix/models/endpoint_updated_event_data.rb +282 -0
  40. data/lib/svix/models/endpointd_updated_event.rb +269 -0
  41. data/lib/svix/models/event_example_in.rb +253 -0
  42. data/lib/svix/models/event_type_example_out.rb +223 -0
  43. data/lib/svix/models/event_type_in.rb +290 -0
  44. data/lib/svix/models/event_type_out.rb +290 -0
  45. data/lib/svix/models/event_type_schema_in.rb +224 -0
  46. data/lib/svix/models/event_type_update.rb +246 -0
  47. data/lib/svix/models/http_error_out.rb +237 -0
  48. data/lib/svix/models/http_validation_error.rb +220 -0
  49. data/lib/svix/models/list_response_application_out.rb +248 -0
  50. data/lib/svix/models/list_response_endpoint_message_out.rb +248 -0
  51. data/lib/svix/models/list_response_endpoint_out.rb +248 -0
  52. data/lib/svix/models/list_response_event_type_out.rb +248 -0
  53. data/lib/svix/models/list_response_message_attempt_endpoint_out.rb +248 -0
  54. data/lib/svix/models/list_response_message_attempt_out.rb +248 -0
  55. data/lib/svix/models/list_response_message_endpoint_out.rb +248 -0
  56. data/lib/svix/models/list_response_message_out.rb +248 -0
  57. data/lib/svix/models/message_attempt_endpoint_out.rb +293 -0
  58. data/lib/svix/models/message_attempt_exhausted_event.rb +269 -0
  59. data/lib/svix/models/message_attempt_exhausted_event_data.rb +310 -0
  60. data/lib/svix/models/message_attempt_failed_event.rb +251 -0
  61. data/lib/svix/models/message_attempt_out.rb +307 -0
  62. data/lib/svix/models/message_attempt_trigger_type.rb +37 -0
  63. data/lib/svix/models/message_endpoint_out.rb +418 -0
  64. data/lib/svix/models/message_in.rb +312 -0
  65. data/lib/svix/models/message_out.rb +340 -0
  66. data/lib/svix/models/message_status.rb +39 -0
  67. data/lib/svix/models/validation_error.rb +253 -0
  68. data/lib/svix/models/webhook_types.rb +280 -0
  69. data/lib/svix/svix.rb +43 -0
  70. data/{src → lib}/svix/util.rb +1 -1
  71. data/lib/svix/version.rb +5 -0
  72. data/lib/svix/webhook.rb +75 -0
  73. data/lib/svix.rb +77 -0
  74. data/svix.gemspec +19 -9
  75. metadata +97 -13
  76. data/.gitignore +0 -9
  77. data/src/svix/version.rb +0 -3
  78. data/src/svix/webhook.rb +0 -33
  79. data/src/svix.rb +0 -8
@@ -0,0 +1,877 @@
1
+ =begin
2
+ #Svix API
3
+
4
+ #Welcome to the Svix API documentation! Useful links: [Homepage](https://www.svix.com) | [Support email](mailto:support+docs@svix.com) | [Blog](https://www.svix.com/blog/) | [Slack Community](https://www.svix.com/slack/) # Introduction This is the reference documentation and schemas for the [Svix webhook service](https://www.svix.com) API. For tutorials and other documentation please refer to [the documentation](https://docs.svix.com). ## Main concepts In Svix you have four important entities you will be interacting with: - `messages`: these are the webhooks being sent. They can have contents and a few other properties. - `application`: this is where `messages` are sent to. Usually you want to create one application for each of your users. - `endpoint`: endpoints are the URLs messages will be sent to. Each application can have multiple `endpoints` and each message sent to that application will be sent to all of them (unless they are not subscribed to the sent event type). - `event-type`: event types are identifiers denoting the type of the message being sent. Event types are primarily used to decide which events are sent to which endpoint. ## Authentication Get your authentication token (`AUTH_TOKEN`) from the [Svix dashboard](https://dashboard.svix.com) and use it as part of the `Authorization` header as such: `Authorization: Bearer ${AUTH_TOKEN}`. <SecurityDefinitions /> ## Code samples The code samples assume you already have the respective libraries installed and you know how to use them. For the latest information on how to do that, please refer to [the documentation](https://docs.svix.com/). ## Cross-Origin Resource Sharing This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). And that allows cross-domain communication from the browser. All responses have a wildcard same-origin which makes them completely public and accessible to everyone, including any code on any site.
5
+
6
+ The version of the OpenAPI document: 1.4
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ OpenAPI Generator version: 5.2.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Svix
16
+ class EndpointApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create Endpoint
23
+ # Create a new endpoint for the application. When `secret` is `null` the secret is automatically generated (recommended)
24
+ # @param app_id [String]
25
+ # @param endpoint_in [EndpointIn]
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [EndpointOut]
28
+ def create_endpoint_api_v1_app_app_id_endpoint_post(app_id, endpoint_in, opts = {})
29
+ data, _status_code, _headers = create_endpoint_api_v1_app_app_id_endpoint_post_with_http_info(app_id, endpoint_in, opts)
30
+ data
31
+ end
32
+
33
+ # Create Endpoint
34
+ # Create a new endpoint for the application. When &#x60;secret&#x60; is &#x60;null&#x60; the secret is automatically generated (recommended)
35
+ # @param app_id [String]
36
+ # @param endpoint_in [EndpointIn]
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(EndpointOut, Integer, Hash)>] EndpointOut data, response status code and response headers
39
+ def create_endpoint_api_v1_app_app_id_endpoint_post_with_http_info(app_id, endpoint_in, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: EndpointApi.create_endpoint_api_v1_app_app_id_endpoint_post ...'
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 EndpointApi.create_endpoint_api_v1_app_app_id_endpoint_post"
46
+ end
47
+ if @api_client.config.client_side_validation && app_id.to_s.length > 256
48
+ fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.create_endpoint_api_v1_app_app_id_endpoint_post, the character length must be smaller than or equal to 256.'
49
+ end
50
+
51
+ if @api_client.config.client_side_validation && app_id.to_s.length < 1
52
+ fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.create_endpoint_api_v1_app_app_id_endpoint_post, the character length must be great than or equal to 1.'
53
+ end
54
+
55
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
56
+ if @api_client.config.client_side_validation && app_id !~ pattern
57
+ fail ArgumentError, "invalid value for 'app_id' when calling EndpointApi.create_endpoint_api_v1_app_app_id_endpoint_post, must conform to the pattern #{pattern}."
58
+ end
59
+
60
+ # verify the required parameter 'endpoint_in' is set
61
+ if @api_client.config.client_side_validation && endpoint_in.nil?
62
+ fail ArgumentError, "Missing the required parameter 'endpoint_in' when calling EndpointApi.create_endpoint_api_v1_app_app_id_endpoint_post"
63
+ end
64
+ # resource path
65
+ local_var_path = '/api/v1/app/{app_id}/endpoint/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
66
+
67
+ # query parameters
68
+ query_params = opts[:query_params] || {}
69
+
70
+ # header parameters
71
+ header_params = opts[:header_params] || {}
72
+ # HTTP header 'Accept' (if needed)
73
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
74
+ # HTTP header 'Content-Type'
75
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
76
+
77
+ # form parameters
78
+ form_params = opts[:form_params] || {}
79
+
80
+ # http body (model)
81
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(endpoint_in)
82
+
83
+ # return_type
84
+ return_type = opts[:debug_return_type] || 'EndpointOut'
85
+
86
+ # auth_names
87
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
88
+
89
+ new_options = opts.merge(
90
+ :operation => :"EndpointApi.create_endpoint_api_v1_app_app_id_endpoint_post",
91
+ :header_params => header_params,
92
+ :query_params => query_params,
93
+ :form_params => form_params,
94
+ :body => post_body,
95
+ :auth_names => auth_names,
96
+ :return_type => return_type
97
+ )
98
+
99
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
100
+ if @api_client.config.debugging
101
+ @api_client.config.logger.debug "API called: EndpointApi#create_endpoint_api_v1_app_app_id_endpoint_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
102
+ end
103
+ return data, status_code, headers
104
+ end
105
+
106
+ # Delete Endpoint
107
+ # Delete an endpoint.
108
+ # @param endpoint_id [String]
109
+ # @param app_id [String]
110
+ # @param [Hash] opts the optional parameters
111
+ # @return [nil]
112
+ def delete_endpoint_api_v1_app_app_id_endpoint_endpoint_id_delete(endpoint_id, app_id, opts = {})
113
+ delete_endpoint_api_v1_app_app_id_endpoint_endpoint_id_delete_with_http_info(endpoint_id, app_id, opts)
114
+ nil
115
+ end
116
+
117
+ # Delete Endpoint
118
+ # Delete an endpoint.
119
+ # @param endpoint_id [String]
120
+ # @param app_id [String]
121
+ # @param [Hash] opts the optional parameters
122
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
123
+ def delete_endpoint_api_v1_app_app_id_endpoint_endpoint_id_delete_with_http_info(endpoint_id, app_id, opts = {})
124
+ if @api_client.config.debugging
125
+ @api_client.config.logger.debug 'Calling API: EndpointApi.delete_endpoint_api_v1_app_app_id_endpoint_endpoint_id_delete ...'
126
+ end
127
+ # verify the required parameter 'endpoint_id' is set
128
+ if @api_client.config.client_side_validation && endpoint_id.nil?
129
+ fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling EndpointApi.delete_endpoint_api_v1_app_app_id_endpoint_endpoint_id_delete"
130
+ end
131
+ if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256
132
+ fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.delete_endpoint_api_v1_app_app_id_endpoint_endpoint_id_delete, the character length must be smaller than or equal to 256.'
133
+ end
134
+
135
+ if @api_client.config.client_side_validation && endpoint_id.to_s.length < 1
136
+ fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.delete_endpoint_api_v1_app_app_id_endpoint_endpoint_id_delete, the character length must be great than or equal to 1.'
137
+ end
138
+
139
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
140
+ if @api_client.config.client_side_validation && endpoint_id !~ pattern
141
+ fail ArgumentError, "invalid value for 'endpoint_id' when calling EndpointApi.delete_endpoint_api_v1_app_app_id_endpoint_endpoint_id_delete, must conform to the pattern #{pattern}."
142
+ end
143
+
144
+ # verify the required parameter 'app_id' is set
145
+ if @api_client.config.client_side_validation && app_id.nil?
146
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling EndpointApi.delete_endpoint_api_v1_app_app_id_endpoint_endpoint_id_delete"
147
+ end
148
+ if @api_client.config.client_side_validation && app_id.to_s.length > 256
149
+ fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.delete_endpoint_api_v1_app_app_id_endpoint_endpoint_id_delete, the character length must be smaller than or equal to 256.'
150
+ end
151
+
152
+ if @api_client.config.client_side_validation && app_id.to_s.length < 1
153
+ fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.delete_endpoint_api_v1_app_app_id_endpoint_endpoint_id_delete, the character length must be great than or equal to 1.'
154
+ end
155
+
156
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
157
+ if @api_client.config.client_side_validation && app_id !~ pattern
158
+ fail ArgumentError, "invalid value for 'app_id' when calling EndpointApi.delete_endpoint_api_v1_app_app_id_endpoint_endpoint_id_delete, must conform to the pattern #{pattern}."
159
+ end
160
+
161
+ # resource path
162
+ local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/'.sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_id.to_s)).sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
163
+
164
+ # query parameters
165
+ query_params = opts[:query_params] || {}
166
+
167
+ # header parameters
168
+ header_params = opts[:header_params] || {}
169
+ # HTTP header 'Accept' (if needed)
170
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
171
+
172
+ # form parameters
173
+ form_params = opts[:form_params] || {}
174
+
175
+ # http body (model)
176
+ post_body = opts[:debug_body]
177
+
178
+ # return_type
179
+ return_type = opts[:debug_return_type]
180
+
181
+ # auth_names
182
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
183
+
184
+ new_options = opts.merge(
185
+ :operation => :"EndpointApi.delete_endpoint_api_v1_app_app_id_endpoint_endpoint_id_delete",
186
+ :header_params => header_params,
187
+ :query_params => query_params,
188
+ :form_params => form_params,
189
+ :body => post_body,
190
+ :auth_names => auth_names,
191
+ :return_type => return_type
192
+ )
193
+
194
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
195
+ if @api_client.config.debugging
196
+ @api_client.config.logger.debug "API called: EndpointApi#delete_endpoint_api_v1_app_app_id_endpoint_endpoint_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
197
+ end
198
+ return data, status_code, headers
199
+ end
200
+
201
+ # Get Endpoint
202
+ # Get an application.
203
+ # @param endpoint_id [String]
204
+ # @param app_id [String]
205
+ # @param [Hash] opts the optional parameters
206
+ # @return [EndpointOut]
207
+ def get_endpoint_api_v1_app_app_id_endpoint_endpoint_id_get(endpoint_id, app_id, opts = {})
208
+ data, _status_code, _headers = get_endpoint_api_v1_app_app_id_endpoint_endpoint_id_get_with_http_info(endpoint_id, app_id, opts)
209
+ data
210
+ end
211
+
212
+ # Get Endpoint
213
+ # Get an application.
214
+ # @param endpoint_id [String]
215
+ # @param app_id [String]
216
+ # @param [Hash] opts the optional parameters
217
+ # @return [Array<(EndpointOut, Integer, Hash)>] EndpointOut data, response status code and response headers
218
+ def get_endpoint_api_v1_app_app_id_endpoint_endpoint_id_get_with_http_info(endpoint_id, app_id, opts = {})
219
+ if @api_client.config.debugging
220
+ @api_client.config.logger.debug 'Calling API: EndpointApi.get_endpoint_api_v1_app_app_id_endpoint_endpoint_id_get ...'
221
+ end
222
+ # verify the required parameter 'endpoint_id' is set
223
+ if @api_client.config.client_side_validation && endpoint_id.nil?
224
+ fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling EndpointApi.get_endpoint_api_v1_app_app_id_endpoint_endpoint_id_get"
225
+ end
226
+ if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256
227
+ fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.get_endpoint_api_v1_app_app_id_endpoint_endpoint_id_get, the character length must be smaller than or equal to 256.'
228
+ end
229
+
230
+ if @api_client.config.client_side_validation && endpoint_id.to_s.length < 1
231
+ fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.get_endpoint_api_v1_app_app_id_endpoint_endpoint_id_get, the character length must be great than or equal to 1.'
232
+ end
233
+
234
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
235
+ if @api_client.config.client_side_validation && endpoint_id !~ pattern
236
+ fail ArgumentError, "invalid value for 'endpoint_id' when calling EndpointApi.get_endpoint_api_v1_app_app_id_endpoint_endpoint_id_get, must conform to the pattern #{pattern}."
237
+ end
238
+
239
+ # verify the required parameter 'app_id' is set
240
+ if @api_client.config.client_side_validation && app_id.nil?
241
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling EndpointApi.get_endpoint_api_v1_app_app_id_endpoint_endpoint_id_get"
242
+ end
243
+ if @api_client.config.client_side_validation && app_id.to_s.length > 256
244
+ fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.get_endpoint_api_v1_app_app_id_endpoint_endpoint_id_get, the character length must be smaller than or equal to 256.'
245
+ end
246
+
247
+ if @api_client.config.client_side_validation && app_id.to_s.length < 1
248
+ fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.get_endpoint_api_v1_app_app_id_endpoint_endpoint_id_get, the character length must be great than or equal to 1.'
249
+ end
250
+
251
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
252
+ if @api_client.config.client_side_validation && app_id !~ pattern
253
+ fail ArgumentError, "invalid value for 'app_id' when calling EndpointApi.get_endpoint_api_v1_app_app_id_endpoint_endpoint_id_get, must conform to the pattern #{pattern}."
254
+ end
255
+
256
+ # resource path
257
+ local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/'.sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_id.to_s)).sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
258
+
259
+ # query parameters
260
+ query_params = opts[:query_params] || {}
261
+
262
+ # header parameters
263
+ header_params = opts[:header_params] || {}
264
+ # HTTP header 'Accept' (if needed)
265
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
266
+
267
+ # form parameters
268
+ form_params = opts[:form_params] || {}
269
+
270
+ # http body (model)
271
+ post_body = opts[:debug_body]
272
+
273
+ # return_type
274
+ return_type = opts[:debug_return_type] || 'EndpointOut'
275
+
276
+ # auth_names
277
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
278
+
279
+ new_options = opts.merge(
280
+ :operation => :"EndpointApi.get_endpoint_api_v1_app_app_id_endpoint_endpoint_id_get",
281
+ :header_params => header_params,
282
+ :query_params => query_params,
283
+ :form_params => form_params,
284
+ :body => post_body,
285
+ :auth_names => auth_names,
286
+ :return_type => return_type
287
+ )
288
+
289
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
290
+ if @api_client.config.debugging
291
+ @api_client.config.logger.debug "API called: EndpointApi#get_endpoint_api_v1_app_app_id_endpoint_endpoint_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
292
+ end
293
+ return data, status_code, headers
294
+ end
295
+
296
+ # Get Endpoint Secret
297
+ # Get the endpoint's signing secret. This is used to verify the authenticity of the webhook. For more information please refer to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/).
298
+ # @param endpoint_id [String]
299
+ # @param app_id [String]
300
+ # @param [Hash] opts the optional parameters
301
+ # @return [EndpointSecretOut]
302
+ def get_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_get(endpoint_id, app_id, opts = {})
303
+ data, _status_code, _headers = get_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_get_with_http_info(endpoint_id, app_id, opts)
304
+ data
305
+ end
306
+
307
+ # Get Endpoint Secret
308
+ # Get the endpoint&#39;s signing secret. This is used to verify the authenticity of the webhook. For more information please refer to [the consuming webhooks docs](https://docs.svix.com/consuming-webhooks/).
309
+ # @param endpoint_id [String]
310
+ # @param app_id [String]
311
+ # @param [Hash] opts the optional parameters
312
+ # @return [Array<(EndpointSecretOut, Integer, Hash)>] EndpointSecretOut data, response status code and response headers
313
+ def get_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_get_with_http_info(endpoint_id, app_id, opts = {})
314
+ if @api_client.config.debugging
315
+ @api_client.config.logger.debug 'Calling API: EndpointApi.get_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_get ...'
316
+ end
317
+ # verify the required parameter 'endpoint_id' is set
318
+ if @api_client.config.client_side_validation && endpoint_id.nil?
319
+ fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling EndpointApi.get_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_get"
320
+ end
321
+ if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256
322
+ fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.get_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_get, the character length must be smaller than or equal to 256.'
323
+ end
324
+
325
+ if @api_client.config.client_side_validation && endpoint_id.to_s.length < 1
326
+ fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.get_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_get, the character length must be great than or equal to 1.'
327
+ end
328
+
329
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
330
+ if @api_client.config.client_side_validation && endpoint_id !~ pattern
331
+ fail ArgumentError, "invalid value for 'endpoint_id' when calling EndpointApi.get_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_get, must conform to the pattern #{pattern}."
332
+ end
333
+
334
+ # verify the required parameter 'app_id' is set
335
+ if @api_client.config.client_side_validation && app_id.nil?
336
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling EndpointApi.get_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_get"
337
+ end
338
+ if @api_client.config.client_side_validation && app_id.to_s.length > 256
339
+ fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.get_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_get, the character length must be smaller than or equal to 256.'
340
+ end
341
+
342
+ if @api_client.config.client_side_validation && app_id.to_s.length < 1
343
+ fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.get_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_get, the character length must be great than or equal to 1.'
344
+ end
345
+
346
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
347
+ if @api_client.config.client_side_validation && app_id !~ pattern
348
+ fail ArgumentError, "invalid value for 'app_id' when calling EndpointApi.get_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_get, must conform to the pattern #{pattern}."
349
+ end
350
+
351
+ # resource path
352
+ local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/'.sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_id.to_s)).sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
353
+
354
+ # query parameters
355
+ query_params = opts[:query_params] || {}
356
+
357
+ # header parameters
358
+ header_params = opts[:header_params] || {}
359
+ # HTTP header 'Accept' (if needed)
360
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
361
+
362
+ # form parameters
363
+ form_params = opts[:form_params] || {}
364
+
365
+ # http body (model)
366
+ post_body = opts[:debug_body]
367
+
368
+ # return_type
369
+ return_type = opts[:debug_return_type] || 'EndpointSecretOut'
370
+
371
+ # auth_names
372
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
373
+
374
+ new_options = opts.merge(
375
+ :operation => :"EndpointApi.get_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_get",
376
+ :header_params => header_params,
377
+ :query_params => query_params,
378
+ :form_params => form_params,
379
+ :body => post_body,
380
+ :auth_names => auth_names,
381
+ :return_type => return_type
382
+ )
383
+
384
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
385
+ if @api_client.config.debugging
386
+ @api_client.config.logger.debug "API called: EndpointApi#get_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
387
+ end
388
+ return data, status_code, headers
389
+ end
390
+
391
+ # Get Endpoint Stats
392
+ # Get basic statistics for the endpoint.
393
+ # @param endpoint_id [String]
394
+ # @param app_id [String]
395
+ # @param [Hash] opts the optional parameters
396
+ # @return [EndpointStats]
397
+ def get_endpoint_stats_api_v1_app_app_id_endpoint_endpoint_id_stats_get(endpoint_id, app_id, opts = {})
398
+ data, _status_code, _headers = get_endpoint_stats_api_v1_app_app_id_endpoint_endpoint_id_stats_get_with_http_info(endpoint_id, app_id, opts)
399
+ data
400
+ end
401
+
402
+ # Get Endpoint Stats
403
+ # Get basic statistics for the endpoint.
404
+ # @param endpoint_id [String]
405
+ # @param app_id [String]
406
+ # @param [Hash] opts the optional parameters
407
+ # @return [Array<(EndpointStats, Integer, Hash)>] EndpointStats data, response status code and response headers
408
+ def get_endpoint_stats_api_v1_app_app_id_endpoint_endpoint_id_stats_get_with_http_info(endpoint_id, app_id, opts = {})
409
+ if @api_client.config.debugging
410
+ @api_client.config.logger.debug 'Calling API: EndpointApi.get_endpoint_stats_api_v1_app_app_id_endpoint_endpoint_id_stats_get ...'
411
+ end
412
+ # verify the required parameter 'endpoint_id' is set
413
+ if @api_client.config.client_side_validation && endpoint_id.nil?
414
+ fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling EndpointApi.get_endpoint_stats_api_v1_app_app_id_endpoint_endpoint_id_stats_get"
415
+ end
416
+ if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256
417
+ fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.get_endpoint_stats_api_v1_app_app_id_endpoint_endpoint_id_stats_get, the character length must be smaller than or equal to 256.'
418
+ end
419
+
420
+ if @api_client.config.client_side_validation && endpoint_id.to_s.length < 1
421
+ fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.get_endpoint_stats_api_v1_app_app_id_endpoint_endpoint_id_stats_get, the character length must be great than or equal to 1.'
422
+ end
423
+
424
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
425
+ if @api_client.config.client_side_validation && endpoint_id !~ pattern
426
+ fail ArgumentError, "invalid value for 'endpoint_id' when calling EndpointApi.get_endpoint_stats_api_v1_app_app_id_endpoint_endpoint_id_stats_get, must conform to the pattern #{pattern}."
427
+ end
428
+
429
+ # verify the required parameter 'app_id' is set
430
+ if @api_client.config.client_side_validation && app_id.nil?
431
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling EndpointApi.get_endpoint_stats_api_v1_app_app_id_endpoint_endpoint_id_stats_get"
432
+ end
433
+ if @api_client.config.client_side_validation && app_id.to_s.length > 256
434
+ fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.get_endpoint_stats_api_v1_app_app_id_endpoint_endpoint_id_stats_get, the character length must be smaller than or equal to 256.'
435
+ end
436
+
437
+ if @api_client.config.client_side_validation && app_id.to_s.length < 1
438
+ fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.get_endpoint_stats_api_v1_app_app_id_endpoint_endpoint_id_stats_get, the character length must be great than or equal to 1.'
439
+ end
440
+
441
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
442
+ if @api_client.config.client_side_validation && app_id !~ pattern
443
+ fail ArgumentError, "invalid value for 'app_id' when calling EndpointApi.get_endpoint_stats_api_v1_app_app_id_endpoint_endpoint_id_stats_get, must conform to the pattern #{pattern}."
444
+ end
445
+
446
+ # resource path
447
+ local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/stats/'.sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_id.to_s)).sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
448
+
449
+ # query parameters
450
+ query_params = opts[:query_params] || {}
451
+
452
+ # header parameters
453
+ header_params = opts[:header_params] || {}
454
+ # HTTP header 'Accept' (if needed)
455
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
456
+
457
+ # form parameters
458
+ form_params = opts[:form_params] || {}
459
+
460
+ # http body (model)
461
+ post_body = opts[:debug_body]
462
+
463
+ # return_type
464
+ return_type = opts[:debug_return_type] || 'EndpointStats'
465
+
466
+ # auth_names
467
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
468
+
469
+ new_options = opts.merge(
470
+ :operation => :"EndpointApi.get_endpoint_stats_api_v1_app_app_id_endpoint_endpoint_id_stats_get",
471
+ :header_params => header_params,
472
+ :query_params => query_params,
473
+ :form_params => form_params,
474
+ :body => post_body,
475
+ :auth_names => auth_names,
476
+ :return_type => return_type
477
+ )
478
+
479
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
480
+ if @api_client.config.debugging
481
+ @api_client.config.logger.debug "API called: EndpointApi#get_endpoint_stats_api_v1_app_app_id_endpoint_endpoint_id_stats_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
482
+ end
483
+ return data, status_code, headers
484
+ end
485
+
486
+ # List Endpoints
487
+ # List the application's endpoints.
488
+ # @param app_id [String]
489
+ # @param [Hash] opts the optional parameters
490
+ # @option opts [String] :iterator
491
+ # @option opts [Integer] :limit (default to 50)
492
+ # @return [ListResponseEndpointOut]
493
+ def list_endpoints_api_v1_app_app_id_endpoint_get(app_id, opts = {})
494
+ data, _status_code, _headers = list_endpoints_api_v1_app_app_id_endpoint_get_with_http_info(app_id, opts)
495
+ data
496
+ end
497
+
498
+ # List Endpoints
499
+ # List the application&#39;s endpoints.
500
+ # @param app_id [String]
501
+ # @param [Hash] opts the optional parameters
502
+ # @option opts [String] :iterator
503
+ # @option opts [Integer] :limit
504
+ # @return [Array<(ListResponseEndpointOut, Integer, Hash)>] ListResponseEndpointOut data, response status code and response headers
505
+ def list_endpoints_api_v1_app_app_id_endpoint_get_with_http_info(app_id, opts = {})
506
+ if @api_client.config.debugging
507
+ @api_client.config.logger.debug 'Calling API: EndpointApi.list_endpoints_api_v1_app_app_id_endpoint_get ...'
508
+ end
509
+ # verify the required parameter 'app_id' is set
510
+ if @api_client.config.client_side_validation && app_id.nil?
511
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling EndpointApi.list_endpoints_api_v1_app_app_id_endpoint_get"
512
+ end
513
+ if @api_client.config.client_side_validation && app_id.to_s.length > 256
514
+ fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.list_endpoints_api_v1_app_app_id_endpoint_get, the character length must be smaller than or equal to 256.'
515
+ end
516
+
517
+ if @api_client.config.client_side_validation && app_id.to_s.length < 1
518
+ fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.list_endpoints_api_v1_app_app_id_endpoint_get, the character length must be great than or equal to 1.'
519
+ end
520
+
521
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
522
+ if @api_client.config.client_side_validation && app_id !~ pattern
523
+ fail ArgumentError, "invalid value for 'app_id' when calling EndpointApi.list_endpoints_api_v1_app_app_id_endpoint_get, must conform to the pattern #{pattern}."
524
+ end
525
+
526
+ # resource path
527
+ local_var_path = '/api/v1/app/{app_id}/endpoint/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
528
+
529
+ # query parameters
530
+ query_params = opts[:query_params] || {}
531
+ query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil?
532
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
533
+
534
+ # header parameters
535
+ header_params = opts[:header_params] || {}
536
+ # HTTP header 'Accept' (if needed)
537
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
538
+
539
+ # form parameters
540
+ form_params = opts[:form_params] || {}
541
+
542
+ # http body (model)
543
+ post_body = opts[:debug_body]
544
+
545
+ # return_type
546
+ return_type = opts[:debug_return_type] || 'ListResponseEndpointOut'
547
+
548
+ # auth_names
549
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
550
+
551
+ new_options = opts.merge(
552
+ :operation => :"EndpointApi.list_endpoints_api_v1_app_app_id_endpoint_get",
553
+ :header_params => header_params,
554
+ :query_params => query_params,
555
+ :form_params => form_params,
556
+ :body => post_body,
557
+ :auth_names => auth_names,
558
+ :return_type => return_type
559
+ )
560
+
561
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
562
+ if @api_client.config.debugging
563
+ @api_client.config.logger.debug "API called: EndpointApi#list_endpoints_api_v1_app_app_id_endpoint_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
564
+ end
565
+ return data, status_code, headers
566
+ end
567
+
568
+ # Rotate Endpoint Secret
569
+ # Rotates the endpoint's signing secret. The previous secret will be valid for the next 24 hours.
570
+ # @param endpoint_id [String]
571
+ # @param app_id [String]
572
+ # @param endpoint_secret_rotate_in [EndpointSecretRotateIn]
573
+ # @param [Hash] opts the optional parameters
574
+ # @return [nil]
575
+ def rotate_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_rotate_post(endpoint_id, app_id, endpoint_secret_rotate_in, opts = {})
576
+ rotate_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_rotate_post_with_http_info(endpoint_id, app_id, endpoint_secret_rotate_in, opts)
577
+ nil
578
+ end
579
+
580
+ # Rotate Endpoint Secret
581
+ # Rotates the endpoint&#39;s signing secret. The previous secret will be valid for the next 24 hours.
582
+ # @param endpoint_id [String]
583
+ # @param app_id [String]
584
+ # @param endpoint_secret_rotate_in [EndpointSecretRotateIn]
585
+ # @param [Hash] opts the optional parameters
586
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
587
+ def rotate_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_rotate_post_with_http_info(endpoint_id, app_id, endpoint_secret_rotate_in, opts = {})
588
+ if @api_client.config.debugging
589
+ @api_client.config.logger.debug 'Calling API: EndpointApi.rotate_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_rotate_post ...'
590
+ end
591
+ # verify the required parameter 'endpoint_id' is set
592
+ if @api_client.config.client_side_validation && endpoint_id.nil?
593
+ fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling EndpointApi.rotate_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_rotate_post"
594
+ end
595
+ if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256
596
+ fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.rotate_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_rotate_post, the character length must be smaller than or equal to 256.'
597
+ end
598
+
599
+ if @api_client.config.client_side_validation && endpoint_id.to_s.length < 1
600
+ fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.rotate_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_rotate_post, the character length must be great than or equal to 1.'
601
+ end
602
+
603
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
604
+ if @api_client.config.client_side_validation && endpoint_id !~ pattern
605
+ fail ArgumentError, "invalid value for 'endpoint_id' when calling EndpointApi.rotate_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_rotate_post, must conform to the pattern #{pattern}."
606
+ end
607
+
608
+ # verify the required parameter 'app_id' is set
609
+ if @api_client.config.client_side_validation && app_id.nil?
610
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling EndpointApi.rotate_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_rotate_post"
611
+ end
612
+ if @api_client.config.client_side_validation && app_id.to_s.length > 256
613
+ fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.rotate_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_rotate_post, the character length must be smaller than or equal to 256.'
614
+ end
615
+
616
+ if @api_client.config.client_side_validation && app_id.to_s.length < 1
617
+ fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.rotate_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_rotate_post, the character length must be great than or equal to 1.'
618
+ end
619
+
620
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
621
+ if @api_client.config.client_side_validation && app_id !~ pattern
622
+ fail ArgumentError, "invalid value for 'app_id' when calling EndpointApi.rotate_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_rotate_post, must conform to the pattern #{pattern}."
623
+ end
624
+
625
+ # verify the required parameter 'endpoint_secret_rotate_in' is set
626
+ if @api_client.config.client_side_validation && endpoint_secret_rotate_in.nil?
627
+ fail ArgumentError, "Missing the required parameter 'endpoint_secret_rotate_in' when calling EndpointApi.rotate_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_rotate_post"
628
+ end
629
+ # resource path
630
+ local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/secret/rotate/'.sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_id.to_s)).sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
631
+
632
+ # query parameters
633
+ query_params = opts[:query_params] || {}
634
+
635
+ # header parameters
636
+ header_params = opts[:header_params] || {}
637
+ # HTTP header 'Accept' (if needed)
638
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
639
+ # HTTP header 'Content-Type'
640
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
641
+
642
+ # form parameters
643
+ form_params = opts[:form_params] || {}
644
+
645
+ # http body (model)
646
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(endpoint_secret_rotate_in)
647
+
648
+ # return_type
649
+ return_type = opts[:debug_return_type]
650
+
651
+ # auth_names
652
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
653
+
654
+ new_options = opts.merge(
655
+ :operation => :"EndpointApi.rotate_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_rotate_post",
656
+ :header_params => header_params,
657
+ :query_params => query_params,
658
+ :form_params => form_params,
659
+ :body => post_body,
660
+ :auth_names => auth_names,
661
+ :return_type => return_type
662
+ )
663
+
664
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
665
+ if @api_client.config.debugging
666
+ @api_client.config.logger.debug "API called: EndpointApi#rotate_endpoint_secret_api_v1_app_app_id_endpoint_endpoint_id_secret_rotate_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
667
+ end
668
+ return data, status_code, headers
669
+ end
670
+
671
+ # Send Event Type Example Message
672
+ # Send an example message for event
673
+ # @param app_id [String]
674
+ # @param endpoint_id [String]
675
+ # @param event_example_in [EventExampleIn]
676
+ # @param [Hash] opts the optional parameters
677
+ # @return [MessageOut]
678
+ def send_event_type_example_message_api_v1_app_app_id_endpoint_endpoint_id_send_example_post(app_id, endpoint_id, event_example_in, opts = {})
679
+ data, _status_code, _headers = send_event_type_example_message_api_v1_app_app_id_endpoint_endpoint_id_send_example_post_with_http_info(app_id, endpoint_id, event_example_in, opts)
680
+ data
681
+ end
682
+
683
+ # Send Event Type Example Message
684
+ # Send an example message for event
685
+ # @param app_id [String]
686
+ # @param endpoint_id [String]
687
+ # @param event_example_in [EventExampleIn]
688
+ # @param [Hash] opts the optional parameters
689
+ # @return [Array<(MessageOut, Integer, Hash)>] MessageOut data, response status code and response headers
690
+ def send_event_type_example_message_api_v1_app_app_id_endpoint_endpoint_id_send_example_post_with_http_info(app_id, endpoint_id, event_example_in, opts = {})
691
+ if @api_client.config.debugging
692
+ @api_client.config.logger.debug 'Calling API: EndpointApi.send_event_type_example_message_api_v1_app_app_id_endpoint_endpoint_id_send_example_post ...'
693
+ end
694
+ # verify the required parameter 'app_id' is set
695
+ if @api_client.config.client_side_validation && app_id.nil?
696
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling EndpointApi.send_event_type_example_message_api_v1_app_app_id_endpoint_endpoint_id_send_example_post"
697
+ end
698
+ if @api_client.config.client_side_validation && app_id.to_s.length > 256
699
+ fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.send_event_type_example_message_api_v1_app_app_id_endpoint_endpoint_id_send_example_post, the character length must be smaller than or equal to 256.'
700
+ end
701
+
702
+ if @api_client.config.client_side_validation && app_id.to_s.length < 1
703
+ fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.send_event_type_example_message_api_v1_app_app_id_endpoint_endpoint_id_send_example_post, the character length must be great than or equal to 1.'
704
+ end
705
+
706
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
707
+ if @api_client.config.client_side_validation && app_id !~ pattern
708
+ fail ArgumentError, "invalid value for 'app_id' when calling EndpointApi.send_event_type_example_message_api_v1_app_app_id_endpoint_endpoint_id_send_example_post, must conform to the pattern #{pattern}."
709
+ end
710
+
711
+ # verify the required parameter 'endpoint_id' is set
712
+ if @api_client.config.client_side_validation && endpoint_id.nil?
713
+ fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling EndpointApi.send_event_type_example_message_api_v1_app_app_id_endpoint_endpoint_id_send_example_post"
714
+ end
715
+ if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256
716
+ fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.send_event_type_example_message_api_v1_app_app_id_endpoint_endpoint_id_send_example_post, the character length must be smaller than or equal to 256.'
717
+ end
718
+
719
+ if @api_client.config.client_side_validation && endpoint_id.to_s.length < 1
720
+ fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.send_event_type_example_message_api_v1_app_app_id_endpoint_endpoint_id_send_example_post, the character length must be great than or equal to 1.'
721
+ end
722
+
723
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
724
+ if @api_client.config.client_side_validation && endpoint_id !~ pattern
725
+ fail ArgumentError, "invalid value for 'endpoint_id' when calling EndpointApi.send_event_type_example_message_api_v1_app_app_id_endpoint_endpoint_id_send_example_post, must conform to the pattern #{pattern}."
726
+ end
727
+
728
+ # verify the required parameter 'event_example_in' is set
729
+ if @api_client.config.client_side_validation && event_example_in.nil?
730
+ fail ArgumentError, "Missing the required parameter 'event_example_in' when calling EndpointApi.send_event_type_example_message_api_v1_app_app_id_endpoint_endpoint_id_send_example_post"
731
+ end
732
+ # resource path
733
+ local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/send-example/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_id.to_s))
734
+
735
+ # query parameters
736
+ query_params = opts[:query_params] || {}
737
+
738
+ # header parameters
739
+ header_params = opts[:header_params] || {}
740
+ # HTTP header 'Accept' (if needed)
741
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
742
+ # HTTP header 'Content-Type'
743
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
744
+
745
+ # form parameters
746
+ form_params = opts[:form_params] || {}
747
+
748
+ # http body (model)
749
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(event_example_in)
750
+
751
+ # return_type
752
+ return_type = opts[:debug_return_type] || 'MessageOut'
753
+
754
+ # auth_names
755
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
756
+
757
+ new_options = opts.merge(
758
+ :operation => :"EndpointApi.send_event_type_example_message_api_v1_app_app_id_endpoint_endpoint_id_send_example_post",
759
+ :header_params => header_params,
760
+ :query_params => query_params,
761
+ :form_params => form_params,
762
+ :body => post_body,
763
+ :auth_names => auth_names,
764
+ :return_type => return_type
765
+ )
766
+
767
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
768
+ if @api_client.config.debugging
769
+ @api_client.config.logger.debug "API called: EndpointApi#send_event_type_example_message_api_v1_app_app_id_endpoint_endpoint_id_send_example_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
770
+ end
771
+ return data, status_code, headers
772
+ end
773
+
774
+ # Update Endpoint
775
+ # Update an endpoint.
776
+ # @param endpoint_id [String]
777
+ # @param app_id [String]
778
+ # @param endpoint_update [EndpointUpdate]
779
+ # @param [Hash] opts the optional parameters
780
+ # @return [EndpointOut]
781
+ def update_endpoint_api_v1_app_app_id_endpoint_endpoint_id_put(endpoint_id, app_id, endpoint_update, opts = {})
782
+ data, _status_code, _headers = update_endpoint_api_v1_app_app_id_endpoint_endpoint_id_put_with_http_info(endpoint_id, app_id, endpoint_update, opts)
783
+ data
784
+ end
785
+
786
+ # Update Endpoint
787
+ # Update an endpoint.
788
+ # @param endpoint_id [String]
789
+ # @param app_id [String]
790
+ # @param endpoint_update [EndpointUpdate]
791
+ # @param [Hash] opts the optional parameters
792
+ # @return [Array<(EndpointOut, Integer, Hash)>] EndpointOut data, response status code and response headers
793
+ def update_endpoint_api_v1_app_app_id_endpoint_endpoint_id_put_with_http_info(endpoint_id, app_id, endpoint_update, opts = {})
794
+ if @api_client.config.debugging
795
+ @api_client.config.logger.debug 'Calling API: EndpointApi.update_endpoint_api_v1_app_app_id_endpoint_endpoint_id_put ...'
796
+ end
797
+ # verify the required parameter 'endpoint_id' is set
798
+ if @api_client.config.client_side_validation && endpoint_id.nil?
799
+ fail ArgumentError, "Missing the required parameter 'endpoint_id' when calling EndpointApi.update_endpoint_api_v1_app_app_id_endpoint_endpoint_id_put"
800
+ end
801
+ if @api_client.config.client_side_validation && endpoint_id.to_s.length > 256
802
+ fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.update_endpoint_api_v1_app_app_id_endpoint_endpoint_id_put, the character length must be smaller than or equal to 256.'
803
+ end
804
+
805
+ if @api_client.config.client_side_validation && endpoint_id.to_s.length < 1
806
+ fail ArgumentError, 'invalid value for "endpoint_id" when calling EndpointApi.update_endpoint_api_v1_app_app_id_endpoint_endpoint_id_put, the character length must be great than or equal to 1.'
807
+ end
808
+
809
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
810
+ if @api_client.config.client_side_validation && endpoint_id !~ pattern
811
+ fail ArgumentError, "invalid value for 'endpoint_id' when calling EndpointApi.update_endpoint_api_v1_app_app_id_endpoint_endpoint_id_put, must conform to the pattern #{pattern}."
812
+ end
813
+
814
+ # verify the required parameter 'app_id' is set
815
+ if @api_client.config.client_side_validation && app_id.nil?
816
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling EndpointApi.update_endpoint_api_v1_app_app_id_endpoint_endpoint_id_put"
817
+ end
818
+ if @api_client.config.client_side_validation && app_id.to_s.length > 256
819
+ fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.update_endpoint_api_v1_app_app_id_endpoint_endpoint_id_put, the character length must be smaller than or equal to 256.'
820
+ end
821
+
822
+ if @api_client.config.client_side_validation && app_id.to_s.length < 1
823
+ fail ArgumentError, 'invalid value for "app_id" when calling EndpointApi.update_endpoint_api_v1_app_app_id_endpoint_endpoint_id_put, the character length must be great than or equal to 1.'
824
+ end
825
+
826
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
827
+ if @api_client.config.client_side_validation && app_id !~ pattern
828
+ fail ArgumentError, "invalid value for 'app_id' when calling EndpointApi.update_endpoint_api_v1_app_app_id_endpoint_endpoint_id_put, must conform to the pattern #{pattern}."
829
+ end
830
+
831
+ # verify the required parameter 'endpoint_update' is set
832
+ if @api_client.config.client_side_validation && endpoint_update.nil?
833
+ fail ArgumentError, "Missing the required parameter 'endpoint_update' when calling EndpointApi.update_endpoint_api_v1_app_app_id_endpoint_endpoint_id_put"
834
+ end
835
+ # resource path
836
+ local_var_path = '/api/v1/app/{app_id}/endpoint/{endpoint_id}/'.sub('{' + 'endpoint_id' + '}', CGI.escape(endpoint_id.to_s)).sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
837
+
838
+ # query parameters
839
+ query_params = opts[:query_params] || {}
840
+
841
+ # header parameters
842
+ header_params = opts[:header_params] || {}
843
+ # HTTP header 'Accept' (if needed)
844
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
845
+ # HTTP header 'Content-Type'
846
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
847
+
848
+ # form parameters
849
+ form_params = opts[:form_params] || {}
850
+
851
+ # http body (model)
852
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(endpoint_update)
853
+
854
+ # return_type
855
+ return_type = opts[:debug_return_type] || 'EndpointOut'
856
+
857
+ # auth_names
858
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
859
+
860
+ new_options = opts.merge(
861
+ :operation => :"EndpointApi.update_endpoint_api_v1_app_app_id_endpoint_endpoint_id_put",
862
+ :header_params => header_params,
863
+ :query_params => query_params,
864
+ :form_params => form_params,
865
+ :body => post_body,
866
+ :auth_names => auth_names,
867
+ :return_type => return_type
868
+ )
869
+
870
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
871
+ if @api_client.config.debugging
872
+ @api_client.config.logger.debug "API called: EndpointApi#update_endpoint_api_v1_app_app_id_endpoint_endpoint_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
873
+ end
874
+ return data, status_code, headers
875
+ end
876
+ end
877
+ end