svix 0.41.0 → 0.48.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/README.md +62 -8
  4. data/lib/svix/api/application_api.rb +23 -1
  5. data/lib/svix/api/authentication_api.rb +7 -1
  6. data/lib/svix/api/endpoint_api.rb +61 -18
  7. data/lib/svix/api/environment_api.rb +158 -0
  8. data/lib/svix/api/environment_settings_api.rb +82 -0
  9. data/lib/svix/api/event_type_api.rb +23 -1
  10. data/lib/svix/api/health_api.rb +6 -1
  11. data/lib/svix/api/integration_api.rb +627 -0
  12. data/lib/svix/api/message_api.rb +31 -3
  13. data/lib/svix/api/message_attempt_api.rb +359 -5
  14. data/lib/svix/api/organization_api.rb +152 -0
  15. data/lib/svix/api/organization_settings_api.rb +7 -7
  16. data/lib/svix/api/statistics_api.rb +7 -1
  17. data/lib/svix/api_client.rb +1 -1
  18. data/lib/svix/api_error.rb +1 -1
  19. data/lib/svix/configuration.rb +1 -1
  20. data/lib/svix/endpoint_api.rb +1 -1
  21. data/lib/svix/integration_api.rb +38 -0
  22. data/lib/svix/internal.rb +1 -0
  23. data/lib/svix/message_attempt_api.rb +11 -1
  24. data/lib/svix/models/application_in.rb +1 -1
  25. data/lib/svix/models/application_out.rb +1 -1
  26. data/lib/svix/models/attempt_statistics_data.rb +1 -1
  27. data/lib/svix/models/attempt_statistics_response.rb +1 -1
  28. data/lib/svix/models/border_radius_config.rb +1 -1
  29. data/lib/svix/models/border_radius_enum.rb +1 -1
  30. data/lib/svix/models/custom_theme_override.rb +1 -1
  31. data/lib/svix/models/dashboard_access_out.rb +1 -1
  32. data/lib/svix/models/endpoint_created_event.rb +1 -1
  33. data/lib/svix/models/endpoint_created_event_data.rb +1 -1
  34. data/lib/svix/models/endpoint_deleted_event.rb +1 -1
  35. data/lib/svix/models/endpoint_deleted_event_data.rb +1 -1
  36. data/lib/svix/models/endpoint_disabled_event.rb +1 -1
  37. data/lib/svix/models/endpoint_disabled_event_data.rb +1 -1
  38. data/lib/svix/models/endpoint_headers_in.rb +1 -1
  39. data/lib/svix/models/endpoint_headers_out.rb +1 -1
  40. data/lib/svix/models/endpoint_in.rb +38 -2
  41. data/lib/svix/models/endpoint_message_out.rb +38 -2
  42. data/lib/svix/models/endpoint_out.rb +38 -2
  43. data/lib/svix/models/endpoint_secret_out.rb +1 -1
  44. data/lib/svix/models/endpoint_secret_rotate_in.rb +1 -1
  45. data/lib/svix/models/endpoint_stats.rb +1 -1
  46. data/lib/svix/models/endpoint_update.rb +38 -2
  47. data/lib/svix/models/endpoint_updated_event.rb +1 -1
  48. data/lib/svix/models/endpoint_updated_event_data.rb +1 -1
  49. data/lib/svix/models/environment_in.rb +257 -0
  50. data/lib/svix/models/environment_out.rb +259 -0
  51. data/lib/svix/models/environment_settings_out.rb +308 -0
  52. data/lib/svix/models/event_example_in.rb +1 -1
  53. data/lib/svix/models/event_type_example_out.rb +1 -1
  54. data/lib/svix/models/event_type_in.rb +1 -1
  55. data/lib/svix/models/event_type_out.rb +1 -1
  56. data/lib/svix/models/event_type_schema_in.rb +1 -1
  57. data/lib/svix/models/event_type_update.rb +1 -1
  58. data/lib/svix/models/export_organization_out.rb +259 -0
  59. data/lib/svix/models/font_size_config.rb +1 -1
  60. data/lib/svix/models/http_error_out.rb +1 -1
  61. data/lib/svix/models/http_validation_error.rb +1 -1
  62. data/lib/svix/models/import_organization_in.rb +257 -0
  63. data/lib/svix/models/integration_in.rb +223 -0
  64. data/lib/svix/models/integration_key_out.rb +223 -0
  65. data/lib/svix/models/integration_out.rb +265 -0
  66. data/lib/svix/models/integration_update.rb +223 -0
  67. data/lib/svix/models/list_response_application_out.rb +1 -1
  68. data/lib/svix/models/list_response_endpoint_message_out.rb +1 -1
  69. data/lib/svix/models/list_response_endpoint_out.rb +1 -1
  70. data/lib/svix/models/list_response_event_type_out.rb +1 -1
  71. data/lib/svix/models/list_response_integration_out.rb +248 -0
  72. data/lib/svix/models/list_response_message_attempt_endpoint_out.rb +1 -1
  73. data/lib/svix/models/list_response_message_attempt_out.rb +1 -1
  74. data/lib/svix/models/list_response_message_endpoint_out.rb +1 -1
  75. data/lib/svix/models/list_response_message_out.rb +1 -1
  76. data/lib/svix/models/message_attempt_endpoint_out.rb +16 -2
  77. data/lib/svix/models/message_attempt_exhausted_event.rb +1 -1
  78. data/lib/svix/models/message_attempt_exhausted_event_data.rb +1 -1
  79. data/lib/svix/models/message_attempt_failed_event.rb +1 -1
  80. data/lib/svix/models/message_attempt_out.rb +1 -1
  81. data/lib/svix/models/message_attempt_trigger_type.rb +1 -1
  82. data/lib/svix/models/message_endpoint_out.rb +38 -2
  83. data/lib/svix/models/message_in.rb +38 -2
  84. data/lib/svix/models/message_out.rb +38 -2
  85. data/lib/svix/models/message_status.rb +1 -1
  86. data/lib/svix/models/portal_settings_out.rb +16 -5
  87. data/lib/svix/models/recover_in.rb +1 -1
  88. data/lib/svix/models/settings_in.rb +339 -0
  89. data/lib/svix/models/settings_out.rb +339 -0
  90. data/lib/svix/models/statistics_period.rb +1 -1
  91. data/lib/svix/models/validation_error.rb +1 -1
  92. data/lib/svix/models/webhook_types.rb +1 -1
  93. data/lib/svix/svix.rb +2 -0
  94. data/lib/svix/version.rb +1 -1
  95. data/lib/svix.rb +8 -2
  96. metadata +23 -6
@@ -0,0 +1,627 @@
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 user on your platform. - `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/). ## Idempotency Svix supports [idempotency](https://en.wikipedia.org/wiki/Idempotence) for safely retrying requests without accidentally performing the same operation twice. This is useful when an API call is disrupted in transit and you do not receive a response. To perform an idempotent request, pass the idempotency key in the `Idempotency-Key` header to the request. The idempotency key should be a unique value generated by the client. You can create the key in however way you like, though we suggest using UUID v4, or any other string with enough entropy to avoid collisions. Svix's idempotency works by saving the resulting status code and body of the first request made for any given idempotency key for any successful request. Subsequent requests with the same key return the same result. Please note that idempotency is only supported for `POST` requests. ## 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 IntegrationApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Create Integration
23
+ # Create an integration.
24
+ # @param app_id [String]
25
+ # @param integration_in [IntegrationIn]
26
+ # @param [Hash] opts the optional parameters
27
+ # @option opts [String] :idempotency_key The request&#39;s idempotency key
28
+ # @return [IntegrationOut]
29
+ def create_integration_api_v1_app_app_id_integration_post(app_id, integration_in, opts = {})
30
+ data, _status_code, _headers = create_integration_api_v1_app_app_id_integration_post_with_http_info(app_id, integration_in, opts)
31
+ data
32
+ end
33
+
34
+ # Create Integration
35
+ # Create an integration.
36
+ # @param app_id [String]
37
+ # @param integration_in [IntegrationIn]
38
+ # @param [Hash] opts the optional parameters
39
+ # @option opts [String] :idempotency_key The request&#39;s idempotency key
40
+ # @return [Array<(IntegrationOut, Integer, Hash)>] IntegrationOut data, response status code and response headers
41
+ def create_integration_api_v1_app_app_id_integration_post_with_http_info(app_id, integration_in, opts = {})
42
+ if @api_client.config.debugging
43
+ @api_client.config.logger.debug 'Calling API: IntegrationApi.create_integration_api_v1_app_app_id_integration_post ...'
44
+ end
45
+ # verify the required parameter 'app_id' is set
46
+ if @api_client.config.client_side_validation && app_id.nil?
47
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling IntegrationApi.create_integration_api_v1_app_app_id_integration_post"
48
+ end
49
+ if @api_client.config.client_side_validation && app_id.to_s.length > 256
50
+ fail ArgumentError, 'invalid value for "app_id" when calling IntegrationApi.create_integration_api_v1_app_app_id_integration_post, the character length must be smaller than or equal to 256.'
51
+ end
52
+
53
+ if @api_client.config.client_side_validation && app_id.to_s.length < 1
54
+ fail ArgumentError, 'invalid value for "app_id" when calling IntegrationApi.create_integration_api_v1_app_app_id_integration_post, the character length must be great than or equal to 1.'
55
+ end
56
+
57
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
58
+ if @api_client.config.client_side_validation && app_id !~ pattern
59
+ fail ArgumentError, "invalid value for 'app_id' when calling IntegrationApi.create_integration_api_v1_app_app_id_integration_post, must conform to the pattern #{pattern}."
60
+ end
61
+
62
+ # verify the required parameter 'integration_in' is set
63
+ if @api_client.config.client_side_validation && integration_in.nil?
64
+ fail ArgumentError, "Missing the required parameter 'integration_in' when calling IntegrationApi.create_integration_api_v1_app_app_id_integration_post"
65
+ end
66
+ # resource path
67
+ local_var_path = '/api/v1/app/{app_id}/integration/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
68
+
69
+ # query parameters
70
+ query_params = opts[:query_params] || {}
71
+
72
+ # header parameters
73
+ header_params = opts[:header_params] || {}
74
+ # HTTP header 'Accept' (if needed)
75
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
76
+ # HTTP header 'Content-Type'
77
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
78
+ header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
79
+
80
+ # form parameters
81
+ form_params = opts[:form_params] || {}
82
+
83
+ # http body (model)
84
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(integration_in)
85
+
86
+ # return_type
87
+ return_type = opts[:debug_return_type] || 'IntegrationOut'
88
+
89
+ # auth_names
90
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
91
+
92
+ new_options = opts.merge(
93
+ :operation => :"IntegrationApi.create_integration_api_v1_app_app_id_integration_post",
94
+ :header_params => header_params,
95
+ :query_params => query_params,
96
+ :form_params => form_params,
97
+ :body => post_body,
98
+ :auth_names => auth_names,
99
+ :return_type => return_type
100
+ )
101
+
102
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
103
+ if @api_client.config.debugging
104
+ @api_client.config.logger.debug "API called: IntegrationApi#create_integration_api_v1_app_app_id_integration_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
105
+ end
106
+ return data, status_code, headers
107
+ end
108
+
109
+ # Delete Integration
110
+ # Delete an integration and revoke it's key.
111
+ # @param integ_id [String]
112
+ # @param app_id [String]
113
+ # @param [Hash] opts the optional parameters
114
+ # @option opts [String] :idempotency_key The request&#39;s idempotency key
115
+ # @return [nil]
116
+ def delete_integration_api_v1_app_app_id_integration_integ_id_delete(integ_id, app_id, opts = {})
117
+ delete_integration_api_v1_app_app_id_integration_integ_id_delete_with_http_info(integ_id, app_id, opts)
118
+ nil
119
+ end
120
+
121
+ # Delete Integration
122
+ # Delete an integration and revoke it&#39;s key.
123
+ # @param integ_id [String]
124
+ # @param app_id [String]
125
+ # @param [Hash] opts the optional parameters
126
+ # @option opts [String] :idempotency_key The request&#39;s idempotency key
127
+ # @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
128
+ def delete_integration_api_v1_app_app_id_integration_integ_id_delete_with_http_info(integ_id, app_id, opts = {})
129
+ if @api_client.config.debugging
130
+ @api_client.config.logger.debug 'Calling API: IntegrationApi.delete_integration_api_v1_app_app_id_integration_integ_id_delete ...'
131
+ end
132
+ # verify the required parameter 'integ_id' is set
133
+ if @api_client.config.client_side_validation && integ_id.nil?
134
+ fail ArgumentError, "Missing the required parameter 'integ_id' when calling IntegrationApi.delete_integration_api_v1_app_app_id_integration_integ_id_delete"
135
+ end
136
+ # verify the required parameter 'app_id' is set
137
+ if @api_client.config.client_side_validation && app_id.nil?
138
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling IntegrationApi.delete_integration_api_v1_app_app_id_integration_integ_id_delete"
139
+ end
140
+ if @api_client.config.client_side_validation && app_id.to_s.length > 256
141
+ fail ArgumentError, 'invalid value for "app_id" when calling IntegrationApi.delete_integration_api_v1_app_app_id_integration_integ_id_delete, the character length must be smaller than or equal to 256.'
142
+ end
143
+
144
+ if @api_client.config.client_side_validation && app_id.to_s.length < 1
145
+ fail ArgumentError, 'invalid value for "app_id" when calling IntegrationApi.delete_integration_api_v1_app_app_id_integration_integ_id_delete, the character length must be great than or equal to 1.'
146
+ end
147
+
148
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
149
+ if @api_client.config.client_side_validation && app_id !~ pattern
150
+ fail ArgumentError, "invalid value for 'app_id' when calling IntegrationApi.delete_integration_api_v1_app_app_id_integration_integ_id_delete, must conform to the pattern #{pattern}."
151
+ end
152
+
153
+ # resource path
154
+ local_var_path = '/api/v1/app/{app_id}/integration/{integ_id}/'.sub('{' + 'integ_id' + '}', CGI.escape(integ_id.to_s)).sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
155
+
156
+ # query parameters
157
+ query_params = opts[:query_params] || {}
158
+
159
+ # header parameters
160
+ header_params = opts[:header_params] || {}
161
+ # HTTP header 'Accept' (if needed)
162
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
163
+ header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
164
+
165
+ # form parameters
166
+ form_params = opts[:form_params] || {}
167
+
168
+ # http body (model)
169
+ post_body = opts[:debug_body]
170
+
171
+ # return_type
172
+ return_type = opts[:debug_return_type]
173
+
174
+ # auth_names
175
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
176
+
177
+ new_options = opts.merge(
178
+ :operation => :"IntegrationApi.delete_integration_api_v1_app_app_id_integration_integ_id_delete",
179
+ :header_params => header_params,
180
+ :query_params => query_params,
181
+ :form_params => form_params,
182
+ :body => post_body,
183
+ :auth_names => auth_names,
184
+ :return_type => return_type
185
+ )
186
+
187
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
188
+ if @api_client.config.debugging
189
+ @api_client.config.logger.debug "API called: IntegrationApi#delete_integration_api_v1_app_app_id_integration_integ_id_delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
190
+ end
191
+ return data, status_code, headers
192
+ end
193
+
194
+ # Get Integration
195
+ # Get an integration.
196
+ # @param integ_id [String]
197
+ # @param app_id [String]
198
+ # @param [Hash] opts the optional parameters
199
+ # @option opts [String] :idempotency_key The request&#39;s idempotency key
200
+ # @return [IntegrationOut]
201
+ def get_integration_api_v1_app_app_id_integration_integ_id_get(integ_id, app_id, opts = {})
202
+ data, _status_code, _headers = get_integration_api_v1_app_app_id_integration_integ_id_get_with_http_info(integ_id, app_id, opts)
203
+ data
204
+ end
205
+
206
+ # Get Integration
207
+ # Get an integration.
208
+ # @param integ_id [String]
209
+ # @param app_id [String]
210
+ # @param [Hash] opts the optional parameters
211
+ # @option opts [String] :idempotency_key The request&#39;s idempotency key
212
+ # @return [Array<(IntegrationOut, Integer, Hash)>] IntegrationOut data, response status code and response headers
213
+ def get_integration_api_v1_app_app_id_integration_integ_id_get_with_http_info(integ_id, app_id, opts = {})
214
+ if @api_client.config.debugging
215
+ @api_client.config.logger.debug 'Calling API: IntegrationApi.get_integration_api_v1_app_app_id_integration_integ_id_get ...'
216
+ end
217
+ # verify the required parameter 'integ_id' is set
218
+ if @api_client.config.client_side_validation && integ_id.nil?
219
+ fail ArgumentError, "Missing the required parameter 'integ_id' when calling IntegrationApi.get_integration_api_v1_app_app_id_integration_integ_id_get"
220
+ end
221
+ # verify the required parameter 'app_id' is set
222
+ if @api_client.config.client_side_validation && app_id.nil?
223
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling IntegrationApi.get_integration_api_v1_app_app_id_integration_integ_id_get"
224
+ end
225
+ if @api_client.config.client_side_validation && app_id.to_s.length > 256
226
+ fail ArgumentError, 'invalid value for "app_id" when calling IntegrationApi.get_integration_api_v1_app_app_id_integration_integ_id_get, the character length must be smaller than or equal to 256.'
227
+ end
228
+
229
+ if @api_client.config.client_side_validation && app_id.to_s.length < 1
230
+ fail ArgumentError, 'invalid value for "app_id" when calling IntegrationApi.get_integration_api_v1_app_app_id_integration_integ_id_get, the character length must be great than or equal to 1.'
231
+ end
232
+
233
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
234
+ if @api_client.config.client_side_validation && app_id !~ pattern
235
+ fail ArgumentError, "invalid value for 'app_id' when calling IntegrationApi.get_integration_api_v1_app_app_id_integration_integ_id_get, must conform to the pattern #{pattern}."
236
+ end
237
+
238
+ # resource path
239
+ local_var_path = '/api/v1/app/{app_id}/integration/{integ_id}/'.sub('{' + 'integ_id' + '}', CGI.escape(integ_id.to_s)).sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
240
+
241
+ # query parameters
242
+ query_params = opts[:query_params] || {}
243
+
244
+ # header parameters
245
+ header_params = opts[:header_params] || {}
246
+ # HTTP header 'Accept' (if needed)
247
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
248
+ header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
249
+
250
+ # form parameters
251
+ form_params = opts[:form_params] || {}
252
+
253
+ # http body (model)
254
+ post_body = opts[:debug_body]
255
+
256
+ # return_type
257
+ return_type = opts[:debug_return_type] || 'IntegrationOut'
258
+
259
+ # auth_names
260
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
261
+
262
+ new_options = opts.merge(
263
+ :operation => :"IntegrationApi.get_integration_api_v1_app_app_id_integration_integ_id_get",
264
+ :header_params => header_params,
265
+ :query_params => query_params,
266
+ :form_params => form_params,
267
+ :body => post_body,
268
+ :auth_names => auth_names,
269
+ :return_type => return_type
270
+ )
271
+
272
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
273
+ if @api_client.config.debugging
274
+ @api_client.config.logger.debug "API called: IntegrationApi#get_integration_api_v1_app_app_id_integration_integ_id_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
275
+ end
276
+ return data, status_code, headers
277
+ end
278
+
279
+ # Get Integration Key
280
+ # Get an integration's key.
281
+ # @param integ_id [String]
282
+ # @param app_id [String]
283
+ # @param [Hash] opts the optional parameters
284
+ # @option opts [String] :idempotency_key The request&#39;s idempotency key
285
+ # @return [IntegrationKeyOut]
286
+ def get_integration_key_api_v1_app_app_id_integration_integ_id_key_get(integ_id, app_id, opts = {})
287
+ data, _status_code, _headers = get_integration_key_api_v1_app_app_id_integration_integ_id_key_get_with_http_info(integ_id, app_id, opts)
288
+ data
289
+ end
290
+
291
+ # Get Integration Key
292
+ # Get an integration&#39;s key.
293
+ # @param integ_id [String]
294
+ # @param app_id [String]
295
+ # @param [Hash] opts the optional parameters
296
+ # @option opts [String] :idempotency_key The request&#39;s idempotency key
297
+ # @return [Array<(IntegrationKeyOut, Integer, Hash)>] IntegrationKeyOut data, response status code and response headers
298
+ def get_integration_key_api_v1_app_app_id_integration_integ_id_key_get_with_http_info(integ_id, app_id, opts = {})
299
+ if @api_client.config.debugging
300
+ @api_client.config.logger.debug 'Calling API: IntegrationApi.get_integration_key_api_v1_app_app_id_integration_integ_id_key_get ...'
301
+ end
302
+ # verify the required parameter 'integ_id' is set
303
+ if @api_client.config.client_side_validation && integ_id.nil?
304
+ fail ArgumentError, "Missing the required parameter 'integ_id' when calling IntegrationApi.get_integration_key_api_v1_app_app_id_integration_integ_id_key_get"
305
+ end
306
+ # verify the required parameter 'app_id' is set
307
+ if @api_client.config.client_side_validation && app_id.nil?
308
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling IntegrationApi.get_integration_key_api_v1_app_app_id_integration_integ_id_key_get"
309
+ end
310
+ if @api_client.config.client_side_validation && app_id.to_s.length > 256
311
+ fail ArgumentError, 'invalid value for "app_id" when calling IntegrationApi.get_integration_key_api_v1_app_app_id_integration_integ_id_key_get, the character length must be smaller than or equal to 256.'
312
+ end
313
+
314
+ if @api_client.config.client_side_validation && app_id.to_s.length < 1
315
+ fail ArgumentError, 'invalid value for "app_id" when calling IntegrationApi.get_integration_key_api_v1_app_app_id_integration_integ_id_key_get, the character length must be great than or equal to 1.'
316
+ end
317
+
318
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
319
+ if @api_client.config.client_side_validation && app_id !~ pattern
320
+ fail ArgumentError, "invalid value for 'app_id' when calling IntegrationApi.get_integration_key_api_v1_app_app_id_integration_integ_id_key_get, must conform to the pattern #{pattern}."
321
+ end
322
+
323
+ # resource path
324
+ local_var_path = '/api/v1/app/{app_id}/integration/{integ_id}/key/'.sub('{' + 'integ_id' + '}', CGI.escape(integ_id.to_s)).sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
325
+
326
+ # query parameters
327
+ query_params = opts[:query_params] || {}
328
+
329
+ # header parameters
330
+ header_params = opts[:header_params] || {}
331
+ # HTTP header 'Accept' (if needed)
332
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
333
+ header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
334
+
335
+ # form parameters
336
+ form_params = opts[:form_params] || {}
337
+
338
+ # http body (model)
339
+ post_body = opts[:debug_body]
340
+
341
+ # return_type
342
+ return_type = opts[:debug_return_type] || 'IntegrationKeyOut'
343
+
344
+ # auth_names
345
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
346
+
347
+ new_options = opts.merge(
348
+ :operation => :"IntegrationApi.get_integration_key_api_v1_app_app_id_integration_integ_id_key_get",
349
+ :header_params => header_params,
350
+ :query_params => query_params,
351
+ :form_params => form_params,
352
+ :body => post_body,
353
+ :auth_names => auth_names,
354
+ :return_type => return_type
355
+ )
356
+
357
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
358
+ if @api_client.config.debugging
359
+ @api_client.config.logger.debug "API called: IntegrationApi#get_integration_key_api_v1_app_app_id_integration_integ_id_key_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
360
+ end
361
+ return data, status_code, headers
362
+ end
363
+
364
+ # List Integrations
365
+ # List the application's integrations.
366
+ # @param app_id [String]
367
+ # @param [Hash] opts the optional parameters
368
+ # @option opts [String] :iterator
369
+ # @option opts [Integer] :limit (default to 50)
370
+ # @option opts [String] :idempotency_key The request&#39;s idempotency key
371
+ # @return [ListResponseIntegrationOut]
372
+ def list_integrations_api_v1_app_app_id_integration_get(app_id, opts = {})
373
+ data, _status_code, _headers = list_integrations_api_v1_app_app_id_integration_get_with_http_info(app_id, opts)
374
+ data
375
+ end
376
+
377
+ # List Integrations
378
+ # List the application&#39;s integrations.
379
+ # @param app_id [String]
380
+ # @param [Hash] opts the optional parameters
381
+ # @option opts [String] :iterator
382
+ # @option opts [Integer] :limit
383
+ # @option opts [String] :idempotency_key The request&#39;s idempotency key
384
+ # @return [Array<(ListResponseIntegrationOut, Integer, Hash)>] ListResponseIntegrationOut data, response status code and response headers
385
+ def list_integrations_api_v1_app_app_id_integration_get_with_http_info(app_id, opts = {})
386
+ if @api_client.config.debugging
387
+ @api_client.config.logger.debug 'Calling API: IntegrationApi.list_integrations_api_v1_app_app_id_integration_get ...'
388
+ end
389
+ # verify the required parameter 'app_id' is set
390
+ if @api_client.config.client_side_validation && app_id.nil?
391
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling IntegrationApi.list_integrations_api_v1_app_app_id_integration_get"
392
+ end
393
+ if @api_client.config.client_side_validation && app_id.to_s.length > 256
394
+ fail ArgumentError, 'invalid value for "app_id" when calling IntegrationApi.list_integrations_api_v1_app_app_id_integration_get, the character length must be smaller than or equal to 256.'
395
+ end
396
+
397
+ if @api_client.config.client_side_validation && app_id.to_s.length < 1
398
+ fail ArgumentError, 'invalid value for "app_id" when calling IntegrationApi.list_integrations_api_v1_app_app_id_integration_get, the character length must be great than or equal to 1.'
399
+ end
400
+
401
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
402
+ if @api_client.config.client_side_validation && app_id !~ pattern
403
+ fail ArgumentError, "invalid value for 'app_id' when calling IntegrationApi.list_integrations_api_v1_app_app_id_integration_get, must conform to the pattern #{pattern}."
404
+ end
405
+
406
+ # resource path
407
+ local_var_path = '/api/v1/app/{app_id}/integration/'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
408
+
409
+ # query parameters
410
+ query_params = opts[:query_params] || {}
411
+ query_params[:'iterator'] = opts[:'iterator'] if !opts[:'iterator'].nil?
412
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].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
+ header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
419
+
420
+ # form parameters
421
+ form_params = opts[:form_params] || {}
422
+
423
+ # http body (model)
424
+ post_body = opts[:debug_body]
425
+
426
+ # return_type
427
+ return_type = opts[:debug_return_type] || 'ListResponseIntegrationOut'
428
+
429
+ # auth_names
430
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
431
+
432
+ new_options = opts.merge(
433
+ :operation => :"IntegrationApi.list_integrations_api_v1_app_app_id_integration_get",
434
+ :header_params => header_params,
435
+ :query_params => query_params,
436
+ :form_params => form_params,
437
+ :body => post_body,
438
+ :auth_names => auth_names,
439
+ :return_type => return_type
440
+ )
441
+
442
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
443
+ if @api_client.config.debugging
444
+ @api_client.config.logger.debug "API called: IntegrationApi#list_integrations_api_v1_app_app_id_integration_get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
445
+ end
446
+ return data, status_code, headers
447
+ end
448
+
449
+ # Rotate Integration Key
450
+ # Rotate the integration's key. The previous key will be immediately revoked.
451
+ # @param integ_id [String]
452
+ # @param app_id [String]
453
+ # @param [Hash] opts the optional parameters
454
+ # @option opts [String] :idempotency_key The request&#39;s idempotency key
455
+ # @return [IntegrationKeyOut]
456
+ def rotate_integration_key_api_v1_app_app_id_integration_integ_id_key_rotate_post(integ_id, app_id, opts = {})
457
+ data, _status_code, _headers = rotate_integration_key_api_v1_app_app_id_integration_integ_id_key_rotate_post_with_http_info(integ_id, app_id, opts)
458
+ data
459
+ end
460
+
461
+ # Rotate Integration Key
462
+ # Rotate the integration&#39;s key. The previous key will be immediately revoked.
463
+ # @param integ_id [String]
464
+ # @param app_id [String]
465
+ # @param [Hash] opts the optional parameters
466
+ # @option opts [String] :idempotency_key The request&#39;s idempotency key
467
+ # @return [Array<(IntegrationKeyOut, Integer, Hash)>] IntegrationKeyOut data, response status code and response headers
468
+ def rotate_integration_key_api_v1_app_app_id_integration_integ_id_key_rotate_post_with_http_info(integ_id, app_id, opts = {})
469
+ if @api_client.config.debugging
470
+ @api_client.config.logger.debug 'Calling API: IntegrationApi.rotate_integration_key_api_v1_app_app_id_integration_integ_id_key_rotate_post ...'
471
+ end
472
+ # verify the required parameter 'integ_id' is set
473
+ if @api_client.config.client_side_validation && integ_id.nil?
474
+ fail ArgumentError, "Missing the required parameter 'integ_id' when calling IntegrationApi.rotate_integration_key_api_v1_app_app_id_integration_integ_id_key_rotate_post"
475
+ end
476
+ # verify the required parameter 'app_id' is set
477
+ if @api_client.config.client_side_validation && app_id.nil?
478
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling IntegrationApi.rotate_integration_key_api_v1_app_app_id_integration_integ_id_key_rotate_post"
479
+ end
480
+ if @api_client.config.client_side_validation && app_id.to_s.length > 256
481
+ fail ArgumentError, 'invalid value for "app_id" when calling IntegrationApi.rotate_integration_key_api_v1_app_app_id_integration_integ_id_key_rotate_post, the character length must be smaller than or equal to 256.'
482
+ end
483
+
484
+ if @api_client.config.client_side_validation && app_id.to_s.length < 1
485
+ fail ArgumentError, 'invalid value for "app_id" when calling IntegrationApi.rotate_integration_key_api_v1_app_app_id_integration_integ_id_key_rotate_post, the character length must be great than or equal to 1.'
486
+ end
487
+
488
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
489
+ if @api_client.config.client_side_validation && app_id !~ pattern
490
+ fail ArgumentError, "invalid value for 'app_id' when calling IntegrationApi.rotate_integration_key_api_v1_app_app_id_integration_integ_id_key_rotate_post, must conform to the pattern #{pattern}."
491
+ end
492
+
493
+ # resource path
494
+ local_var_path = '/api/v1/app/{app_id}/integration/{integ_id}/key/rotate/'.sub('{' + 'integ_id' + '}', CGI.escape(integ_id.to_s)).sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
495
+
496
+ # query parameters
497
+ query_params = opts[:query_params] || {}
498
+
499
+ # header parameters
500
+ header_params = opts[:header_params] || {}
501
+ # HTTP header 'Accept' (if needed)
502
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
503
+ header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
504
+
505
+ # form parameters
506
+ form_params = opts[:form_params] || {}
507
+
508
+ # http body (model)
509
+ post_body = opts[:debug_body]
510
+
511
+ # return_type
512
+ return_type = opts[:debug_return_type] || 'IntegrationKeyOut'
513
+
514
+ # auth_names
515
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
516
+
517
+ new_options = opts.merge(
518
+ :operation => :"IntegrationApi.rotate_integration_key_api_v1_app_app_id_integration_integ_id_key_rotate_post",
519
+ :header_params => header_params,
520
+ :query_params => query_params,
521
+ :form_params => form_params,
522
+ :body => post_body,
523
+ :auth_names => auth_names,
524
+ :return_type => return_type
525
+ )
526
+
527
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
528
+ if @api_client.config.debugging
529
+ @api_client.config.logger.debug "API called: IntegrationApi#rotate_integration_key_api_v1_app_app_id_integration_integ_id_key_rotate_post\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
530
+ end
531
+ return data, status_code, headers
532
+ end
533
+
534
+ # Update Integration
535
+ # Update an integration.
536
+ # @param integ_id [String]
537
+ # @param app_id [String]
538
+ # @param integration_update [IntegrationUpdate]
539
+ # @param [Hash] opts the optional parameters
540
+ # @option opts [String] :idempotency_key The request&#39;s idempotency key
541
+ # @return [IntegrationOut]
542
+ def update_integration_api_v1_app_app_id_integration_integ_id_put(integ_id, app_id, integration_update, opts = {})
543
+ data, _status_code, _headers = update_integration_api_v1_app_app_id_integration_integ_id_put_with_http_info(integ_id, app_id, integration_update, opts)
544
+ data
545
+ end
546
+
547
+ # Update Integration
548
+ # Update an integration.
549
+ # @param integ_id [String]
550
+ # @param app_id [String]
551
+ # @param integration_update [IntegrationUpdate]
552
+ # @param [Hash] opts the optional parameters
553
+ # @option opts [String] :idempotency_key The request&#39;s idempotency key
554
+ # @return [Array<(IntegrationOut, Integer, Hash)>] IntegrationOut data, response status code and response headers
555
+ def update_integration_api_v1_app_app_id_integration_integ_id_put_with_http_info(integ_id, app_id, integration_update, opts = {})
556
+ if @api_client.config.debugging
557
+ @api_client.config.logger.debug 'Calling API: IntegrationApi.update_integration_api_v1_app_app_id_integration_integ_id_put ...'
558
+ end
559
+ # verify the required parameter 'integ_id' is set
560
+ if @api_client.config.client_side_validation && integ_id.nil?
561
+ fail ArgumentError, "Missing the required parameter 'integ_id' when calling IntegrationApi.update_integration_api_v1_app_app_id_integration_integ_id_put"
562
+ end
563
+ # verify the required parameter 'app_id' is set
564
+ if @api_client.config.client_side_validation && app_id.nil?
565
+ fail ArgumentError, "Missing the required parameter 'app_id' when calling IntegrationApi.update_integration_api_v1_app_app_id_integration_integ_id_put"
566
+ end
567
+ if @api_client.config.client_side_validation && app_id.to_s.length > 256
568
+ fail ArgumentError, 'invalid value for "app_id" when calling IntegrationApi.update_integration_api_v1_app_app_id_integration_integ_id_put, the character length must be smaller than or equal to 256.'
569
+ end
570
+
571
+ if @api_client.config.client_side_validation && app_id.to_s.length < 1
572
+ fail ArgumentError, 'invalid value for "app_id" when calling IntegrationApi.update_integration_api_v1_app_app_id_integration_integ_id_put, the character length must be great than or equal to 1.'
573
+ end
574
+
575
+ pattern = Regexp.new(/^[a-zA-Z0-9\-_.]+$/)
576
+ if @api_client.config.client_side_validation && app_id !~ pattern
577
+ fail ArgumentError, "invalid value for 'app_id' when calling IntegrationApi.update_integration_api_v1_app_app_id_integration_integ_id_put, must conform to the pattern #{pattern}."
578
+ end
579
+
580
+ # verify the required parameter 'integration_update' is set
581
+ if @api_client.config.client_side_validation && integration_update.nil?
582
+ fail ArgumentError, "Missing the required parameter 'integration_update' when calling IntegrationApi.update_integration_api_v1_app_app_id_integration_integ_id_put"
583
+ end
584
+ # resource path
585
+ local_var_path = '/api/v1/app/{app_id}/integration/{integ_id}/'.sub('{' + 'integ_id' + '}', CGI.escape(integ_id.to_s)).sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
586
+
587
+ # query parameters
588
+ query_params = opts[:query_params] || {}
589
+
590
+ # header parameters
591
+ header_params = opts[:header_params] || {}
592
+ # HTTP header 'Accept' (if needed)
593
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
594
+ # HTTP header 'Content-Type'
595
+ header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
596
+ header_params[:'idempotency-key'] = opts[:'idempotency_key'] if !opts[:'idempotency_key'].nil?
597
+
598
+ # form parameters
599
+ form_params = opts[:form_params] || {}
600
+
601
+ # http body (model)
602
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(integration_update)
603
+
604
+ # return_type
605
+ return_type = opts[:debug_return_type] || 'IntegrationOut'
606
+
607
+ # auth_names
608
+ auth_names = opts[:debug_auth_names] || ['HTTPBearer']
609
+
610
+ new_options = opts.merge(
611
+ :operation => :"IntegrationApi.update_integration_api_v1_app_app_id_integration_integ_id_put",
612
+ :header_params => header_params,
613
+ :query_params => query_params,
614
+ :form_params => form_params,
615
+ :body => post_body,
616
+ :auth_names => auth_names,
617
+ :return_type => return_type
618
+ )
619
+
620
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
621
+ if @api_client.config.debugging
622
+ @api_client.config.logger.debug "API called: IntegrationApi#update_integration_api_v1_app_app_id_integration_integ_id_put\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
623
+ end
624
+ return data, status_code, headers
625
+ end
626
+ end
627
+ end